summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
diff options
context:
space:
mode:
authorJustin Lebar <jlebar@google.com>2016-09-07 15:49:48 +0000
committerJustin Lebar <jlebar@google.com>2016-09-07 15:49:48 +0000
commit3a5f40c19175390e3790867972820599060016de (patch)
tree70b9455538b4c653b641eca6de3e4af7b1202b83 /llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
parent0bf9a99c7dbbffb2ba9998c2b89010b5d4c9622a (diff)
downloadbcm5719-llvm-3a5f40c19175390e3790867972820599060016de.tar.gz
bcm5719-llvm-3a5f40c19175390e3790867972820599060016de.zip
[LSV] Use the original loads' names for the extractelement instructions.
Summary: LSV replaces multiple adjacent loads with one vectorized load and a bunch of extractelement instructions. This patch makes the extractelement instructions' names match those of the original loads, for (hopefully) improved readability. Reviewers: asbirlea, tstellarAMD Subscribers: arsenm, mzolotukhin Differential Revision: https://reviews.llvm.org/D23748 llvm-svn: 280818
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp')
-rw-r--r--llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp b/llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
index 90adf9f90e0..72a0965293d 100644
--- a/llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
@@ -983,7 +983,8 @@ bool Vectorizer::vectorizeLoadChain(
Instruction *UI = cast<Instruction>(Use);
unsigned Idx = cast<ConstantInt>(UI->getOperand(1))->getZExtValue();
unsigned NewIdx = Idx + I * VecWidth;
- Value *V = Builder.CreateExtractElement(LI, Builder.getInt32(NewIdx));
+ Value *V = Builder.CreateExtractElement(LI, Builder.getInt32(NewIdx),
+ UI->getName());
if (V->getType() != UI->getType())
V = Builder.CreateBitCast(V, UI->getType());
@@ -1002,8 +1003,9 @@ bool Vectorizer::vectorizeLoadChain(
I->eraseFromParent();
} else {
for (unsigned I = 0, E = Chain.size(); I != E; ++I) {
- Value *V = Builder.CreateExtractElement(LI, Builder.getInt32(I));
Value *CV = Chain[I];
+ Value *V =
+ Builder.CreateExtractElement(LI, Builder.getInt32(I), CV->getName());
if (V->getType() != CV->getType()) {
V = Builder.CreateBitOrPointerCast(V, CV->getType());
}
OpenPOWER on IntegriCloud