diff options
author | Matthijs Kooijman <matthijs@stdin.nl> | 2008-06-11 09:00:12 +0000 |
---|---|---|
committer | Matthijs Kooijman <matthijs@stdin.nl> | 2008-06-11 09:00:12 +0000 |
commit | b4d6a5a76cca5828c9e2599f12036c7f9c5f89d7 (patch) | |
tree | 7e59205cd168dd3a6b8f641035f98ba98bcc4cfd | |
parent | f7ea3638e0f85a9793e7c9f081ed6ddb1ebb832e (diff) | |
download | external_llvm-b4d6a5a76cca5828c9e2599f12036c7f9c5f89d7.zip external_llvm-b4d6a5a76cca5828c9e2599f12036c7f9c5f89d7.tar.gz external_llvm-b4d6a5a76cca5828c9e2599f12036c7f9c5f89d7.tar.bz2 |
Clarify a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52212 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 3b181c8..a1a3333 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -10613,7 +10613,6 @@ static Value *FindScalarElement(Value *V, unsigned EltNo) { } Instruction *InstCombiner::visitExtractElementInst(ExtractElementInst &EI) { - // If vector val is undef, replace extract with scalar undef. if (isa<UndefValue>(EI.getOperand(0))) return ReplaceInstUsesWith(EI, UndefValue::get(EI.getType())); @@ -10623,8 +10622,9 @@ Instruction *InstCombiner::visitExtractElementInst(ExtractElementInst &EI) { return ReplaceInstUsesWith(EI, Constant::getNullValue(EI.getType())); if (ConstantVector *C = dyn_cast<ConstantVector>(EI.getOperand(0))) { - // If vector val is constant with uniform operands, replace EI - // with that operand + // If vector val is constant with all elements the same, replace EI with + // that element. When the elements are not identical, we cannot replace yet + // (we do that below, but only when the index is constant). Constant *op0 = C->getOperand(0); for (unsigned i = 1; i < C->getNumOperands(); ++i) if (C->getOperand(i) != op0) { |