summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
diff options
context:
space:
mode:
authorMichael Zolotukhin <mzolotukhin@apple.com>2015-09-16 03:25:09 +0000
committerMichael Zolotukhin <mzolotukhin@apple.com>2015-09-16 03:25:09 +0000
commitfc314be0ec871771d2c7ecb31aa4c20a76328bfa (patch)
tree300189eb7955ffe034733ea969986548134b0986 /llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
parent141dd91ac5d089c3ff3c8f8cd050c88c6ba50fc9 (diff)
downloadbcm5719-llvm-fc314be0ec871771d2c7ecb31aa4c20a76328bfa.tar.gz
bcm5719-llvm-fc314be0ec871771d2c7ecb31aa4c20a76328bfa.zip
[Unroll] Fix a bug in UnrolledInstAnalyzer::visitLoad.
We only checked that a global is initialized with constants, which is incorrect. We should be checking that GlobalVariable *is* a constant, not just initialized with it. llvm-svn: 247769
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp b/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
index 6c510a5f9d9..0e4462618aa 100644
--- a/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
@@ -415,7 +415,7 @@ private:
auto *GV = dyn_cast<GlobalVariable>(AddressIt->second.Base);
// We're only interested in loads that can be completely folded to a
// constant.
- if (!GV || !GV->hasInitializer())
+ if (!GV || !GV->hasInitializer() || !GV->isConstant())
return false;
ConstantDataSequential *CDS =
OpenPOWER on IntegriCloud