diff options
author | Sanjay Patel <spatel@rotateright.com> | 2018-12-05 23:09:33 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2018-12-05 23:09:33 +0000 |
commit | 998ececef0e28adc96edea5a288fd76c1f56187e (patch) | |
tree | 649c0df59135f03bdd641b56a4360e890394ae7f /llvm/lib/Transforms | |
parent | 4ae3b71df002a3f71ae28cb5406535714f17673a (diff) | |
download | bcm5719-llvm-998ececef0e28adc96edea5a288fd76c1f56187e.tar.gz bcm5719-llvm-998ececef0e28adc96edea5a288fd76c1f56187e.zip |
[InstCombine] remove dead code from visitExtractElement
Extracting from a splat constant is always handled by InstSimplify.
Move the test for this from InstCombine to InstSimplify to make
sure that stays true.
llvm-svn: 348423
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp index 12e46a39ad7..bc14f1052ee 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp @@ -267,12 +267,6 @@ Instruction *InstCombiner::visitExtractElementInst(ExtractElementInst &EI) { SQ.getWithInstruction(&EI))) return replaceInstUsesWith(EI, V); - // If vector val is constant with all elements the same, replace EI with - // that element. We handle a known element # below. - if (auto *C = dyn_cast<Constant>(SrcVec)) - if (cheapToScalarize(C, false)) - return replaceInstUsesWith(EI, C->getAggregateElement(0U)); - // If extracting a specified index from the vector, see if we can recursively // find a previously computed scalar that was inserted into the vector. auto *IndexC = dyn_cast<ConstantInt>(Index); |