summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2017-09-25 16:41:34 +0000
committerSanjay Patel <spatel@rotateright.com>2017-09-25 16:41:34 +0000
commit9639897d7786d176f4c0e42ab4a9a7029ea50b78 (patch)
tree3b2adc0164bf2b5e7ce86764631d7c91789a68a2 /llvm/lib/Transforms/InstCombine
parent0a62b2d88767bd2836bcf3182e6d58c89cc84cdf (diff)
downloadbcm5719-llvm-9639897d7786d176f4c0e42ab4a9a7029ea50b78.tar.gz
bcm5719-llvm-9639897d7786d176f4c0e42ab4a9a7029ea50b78.zip
[InstCombine] remove extract-of-select vector transform
The transform to convert an extract-of-a-select-of-vectors was added at: rL194013 And a question about the validity of this transform was raised in the review: https://reviews.llvm.org/D1539: ...but not answered AFAICT> Most of the motivating cases in that patch are now handled by other combines. These are the tests that were added with the original commit, but they are not regressing even after we remove the transform in this patch. The diffs we see after removing this transform cause us to avoid increasing the instruction count, so we don't want to do those transforms as canonicalizations. The motivation for not turning a vector-select-of-vectors into a scalar operation is shown in PR33301: https://bugs.llvm.org/show_bug.cgi?id=33301 ...in those cases, we'll get vector ops with this patch rather than the vector/scalar mix that we currently see. Differential Revision: https://reviews.llvm.org/D38006 llvm-svn: 314117
Diffstat (limited to 'llvm/lib/Transforms/InstCombine')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp33
1 files changed, 0 insertions, 33 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
index 0d327795acf..d760101281a 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
@@ -255,39 +255,6 @@ Instruction *InstCombiner::visitExtractElementInst(ExtractElementInst &EI) {
Worklist.AddValue(EE);
return CastInst::Create(CI->getOpcode(), EE, EI.getType());
}
- } else if (SelectInst *SI = dyn_cast<SelectInst>(I)) {
- if (SI->hasOneUse()) {
- // TODO: For a select on vectors, it might be useful to do this if it
- // has multiple extractelement uses. For vector select, that seems to
- // fight the vectorizer.
-
- // If we are extracting an element from a vector select or a select on
- // vectors, create a select on the scalars extracted from the vector
- // arguments.
- Value *TrueVal = SI->getTrueValue();
- Value *FalseVal = SI->getFalseValue();
-
- Value *Cond = SI->getCondition();
- if (Cond->getType()->isVectorTy()) {
- Cond = Builder.CreateExtractElement(Cond,
- EI.getIndexOperand(),
- Cond->getName() + ".elt");
- }
-
- Value *V1Elem
- = Builder.CreateExtractElement(TrueVal,
- EI.getIndexOperand(),
- TrueVal->getName() + ".elt");
-
- Value *V2Elem
- = Builder.CreateExtractElement(FalseVal,
- EI.getIndexOperand(),
- FalseVal->getName() + ".elt");
- return SelectInst::Create(Cond,
- V1Elem,
- V2Elem,
- SI->getName() + ".elt");
- }
}
}
return nullptr;
OpenPOWER on IntegriCloud