projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d5a6381
)
Fix some code to work if TargetLowering is not available.
author
Dan Gohman
<gohman@apple.com>
Fri, 1 May 2009 16:29:14 +0000
(16:29 +0000)
committer
Dan Gohman
<gohman@apple.com>
Fri, 1 May 2009 16:29:14 +0000
(16:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70546
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Transforms/Scalar/LoopStrengthReduce.cpp
patch
|
blob
|
history
diff --git
a/lib/Transforms/Scalar/LoopStrengthReduce.cpp
b/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index 2dc62823ec441c3d1bf8e640da1faa671fb4695d..89429b6731db0e3eba2a951b5d56548ce77e8167 100644
(file)
--- a/
lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/
lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@
-794,10
+794,14
@@
static bool fitsInAddressMode(const SCEVHandle &V, const Type *UseTy,
if (const SCEVUnknown *SU = dyn_cast<SCEVUnknown>(V))
if (GlobalValue *GV = dyn_cast<GlobalValue>(SU->getValue())) {
- TargetLowering::AddrMode AM;
- AM.BaseGV = GV;
- AM.HasBaseReg = HasBaseReg;
- return TLI->isLegalAddressingMode(AM, UseTy);
+ if (TLI) {
+ TargetLowering::AddrMode AM;
+ AM.BaseGV = GV;
+ AM.HasBaseReg = HasBaseReg;
+ return TLI->isLegalAddressingMode(AM, UseTy);
+ } else {
+ // Default: assume global addresses are not legal.
+ }
}
return false;