summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2012-11-16 18:22:08 +0000
committerHans Wennborg <hans@hanshq.net>2012-11-16 18:22:08 +0000
commit7b8af0ea058f3d2f269ad99db8d14614e3df9ddf (patch)
tree0e657cbcba75948d0e6bc03811eb6d412f94a90e /llvm/lib/Transforms
parent8832924acb2c878eb342ccdb69d74ddd9c642c69 (diff)
downloadbcm5719-llvm-7b8af0ea058f3d2f269ad99db8d14614e3df9ddf.tar.gz
bcm5719-llvm-7b8af0ea058f3d2f269ad99db8d14614e3df9ddf.zip
SimplifyCFG: Don't assume non-null ScalarTargetTransformInfo.
Patch by Pekka Jääskeläinen! llvm-svn: 168176
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Utils/SimplifyCFG.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
index 4c14aa698fb..6c34eed13d6 100644
--- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -3539,7 +3539,8 @@ static bool SwitchToLookupTable(SwitchInst *SI,
assert(SI->getNumCases() > 1 && "Degenerate switch?");
// Only build lookup table when we have a target that supports it.
- if (!TTI || !TTI->getScalarTargetTransformInfo()->shouldBuildLookupTables())
+ if (!TTI || !TTI->getScalarTargetTransformInfo() ||
+ !TTI->getScalarTargetTransformInfo()->shouldBuildLookupTables())
return false;
// FIXME: If the switch is too sparse for a lookup table, perhaps we could
OpenPOWER on IntegriCloud