summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
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
commiteac2887143bc33febe1cbbe308b2cef749e28284 (patch)
treef2c12bc37981416f8e30ca49bf59661dbec43fb6 /llvm/lib/Transforms
parentd3df6651406ccc3fac87ab12d9ae6de80eefbc97 (diff)
downloadbcm5719-llvm-eac2887143bc33febe1cbbe308b2cef749e28284.tar.gz
bcm5719-llvm-eac2887143bc33febe1cbbe308b2cef749e28284.zip
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. llvm-svn: 167037
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Vectorize/BBVectorize.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Vectorize/BBVectorize.cpp b/llvm/lib/Transforms/Vectorize/BBVectorize.cpp
index 7486af68fdf..dafec2cd244 100644
--- a/llvm/lib/Transforms/Vectorize/BBVectorize.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud