summaryrefslogtreecommitdiff
path: root/lib/Transforms/Vectorize/BBVectorize.cpp
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2012-10-30 18:55:49 +0000
committerHal Finkel <hfinkel@anl.gov>2012-10-30 18:55:49 +0000
commit93f6f457614299eee3d22f376ab8f42a130f1912 (patch)
treed015a02c0536df854c01eac64895bc8844b622e2 /lib/Transforms/Vectorize/BBVectorize.cpp
parent9210cc3a173224b40d9fc45b202f52cc7acf5c5a (diff)
downloadllvm-93f6f457614299eee3d22f376ab8f42a130f1912.tar.gz
llvm-93f6f457614299eee3d22f376ab8f42a130f1912.tar.bz2
llvm-93f6f457614299eee3d22f376ab8f42a130f1912.tar.xz
BBVectorize: Don't make calls to SE when the result is unused.
SE was being called during the instruction-fusion process (when the result is unreliable, and thus ignored). No functionality change is intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167037 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Vectorize/BBVectorize.cpp')
-rw-r--r--lib/Transforms/Vectorize/BBVectorize.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Transforms/Vectorize/BBVectorize.cpp b/lib/Transforms/Vectorize/BBVectorize.cpp
index 7486af68fd..dafec2cd24 100644
--- a/lib/Transforms/Vectorize/BBVectorize.cpp
+++ b/lib/Transforms/Vectorize/BBVectorize.cpp
@@ -547,7 +547,7 @@ namespace {
bool getPairPtrInfo(Instruction *I, Instruction *J,
Value *&IPtr, Value *&JPtr, unsigned &IAlignment, unsigned &JAlignment,
unsigned &IAddressSpace, unsigned &JAddressSpace,
- int64_t &OffsetInElmts) {
+ int64_t &OffsetInElmts, bool ComputeOffset = true) {
OffsetInElmts = 0;
if (LoadInst *LI = dyn_cast<LoadInst>(I)) {
LoadInst *LJ = cast<LoadInst>(J);
@@ -567,6 +567,9 @@ namespace {
JAddressSpace = SJ->getPointerAddressSpace();
}
+ if (!ComputeOffset)
+ return true;
+
const SCEV *IPtrSCEV = SE->getSCEV(IPtr);
const SCEV *JPtrSCEV = SE->getSCEV(JPtr);
@@ -1677,7 +1680,7 @@ namespace {
// been precomputed (OffsetInElmts must be unused here).
(void) getPairPtrInfo(I, J, IPtr, JPtr, IAlignment, JAlignment,
IAddressSpace, JAddressSpace,
- OffsetInElmts);
+ OffsetInElmts, false);
// The pointer value is taken to be the one with the lowest offset.
Value *VPtr;