aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Vectorize
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-11-27 05:34:53 +0000
committerBill Wendling <isanbard@gmail.com>2013-11-27 05:34:53 +0000
commit3209153cc9728358211b7305305b83cdd0ad1435 (patch)
tree71c142f243c713b031a52161180529a33e8ebf11 /lib/Transforms/Vectorize
parentfcb80cc5656e4672702e3150bfe425f4a58b7a65 (diff)
downloadexternal_llvm-3209153cc9728358211b7305305b83cdd0ad1435.zip
external_llvm-3209153cc9728358211b7305305b83cdd0ad1435.tar.gz
external_llvm-3209153cc9728358211b7305305b83cdd0ad1435.tar.bz2
Merging r195773:
------------------------------------------------------------------------ r195773 | nadav | 2013-11-26 09:29:19 -0800 (Tue, 26 Nov 2013) | 6 lines PR18060 - When we RAUW values with ExtractElement instructions in some cases we generate PHI nodes with multiple entries from the same basic block but with different values. Enabling CSE on ExtractElement instructions make sure that all of the RAUWed instructions are the same. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_34@195817 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Vectorize')
-rw-r--r--lib/Transforms/Vectorize/SLPVectorizer.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Transforms/Vectorize/SLPVectorizer.cpp b/lib/Transforms/Vectorize/SLPVectorizer.cpp
index f29efad..699be95 100644
--- a/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -1588,6 +1588,8 @@ Value *BoUpSLP::vectorizeTree() {
if (PHINode *PN = dyn_cast<PHINode>(Vec)) {
Builder.SetInsertPoint(PN->getParent()->getFirstInsertionPt());
Value *Ex = Builder.CreateExtractElement(Vec, Lane);
+ if (Instruction *Ins = dyn_cast<Instruction>(Ex))
+ GatherSeq.insert(Ins);
User->replaceUsesOfWith(Scalar, Ex);
} else if (isa<Instruction>(Vec)){
if (PHINode *PH = dyn_cast<PHINode>(User)) {
@@ -1595,17 +1597,23 @@ Value *BoUpSLP::vectorizeTree() {
if (PH->getIncomingValue(i) == Scalar) {
Builder.SetInsertPoint(PH->getIncomingBlock(i)->getTerminator());
Value *Ex = Builder.CreateExtractElement(Vec, Lane);
+ if (Instruction *Ins = dyn_cast<Instruction>(Ex))
+ GatherSeq.insert(Ins);
PH->setOperand(i, Ex);
}
}
} else {
Builder.SetInsertPoint(cast<Instruction>(User));
Value *Ex = Builder.CreateExtractElement(Vec, Lane);
+ if (Instruction *Ins = dyn_cast<Instruction>(Ex))
+ GatherSeq.insert(Ins);
User->replaceUsesOfWith(Scalar, Ex);
}
} else {
Builder.SetInsertPoint(F->getEntryBlock().begin());
Value *Ex = Builder.CreateExtractElement(Vec, Lane);
+ if (Instruction *Ins = dyn_cast<Instruction>(Ex))
+ GatherSeq.insert(Ins);
User->replaceUsesOfWith(Scalar, Ex);
}