diff options
author | Hans Wennborg <hans@hanshq.net> | 2014-06-26 00:30:52 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2014-06-26 00:30:52 +0000 |
commit | 0545f16700b4757fa9523e9de199a101d16e6996 (patch) | |
tree | b547bc8520326ab8cd7e4d6c215ad84ced191b97 /lib/Transforms | |
parent | 45f166017c803d0fe1e24ad0f1a3f0a6989489e4 (diff) | |
download | llvm-0545f16700b4757fa9523e9de199a101d16e6996.tar.gz llvm-0545f16700b4757fa9523e9de199a101d16e6996.tar.bz2 llvm-0545f16700b4757fa9523e9de199a101d16e6996.tar.xz |
Don't build switch tables for dllimport and TLS variables in GEPs
This is a follow-up to r211331, which failed to notice that we were
returning early from ValidLookupTableConstant for GEPs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211753 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Utils/SimplifyCFG.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp index ff2f2a0362..b1f9bff537 100644 --- a/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/lib/Transforms/Utils/SimplifyCFG.cpp @@ -3311,13 +3311,14 @@ static bool ForwardSwitchConditionToPHI(SwitchInst *SI) { /// ValidLookupTableConstant - Return true if the backend will be able to handle /// initializing an array of constants like C. static bool ValidLookupTableConstant(Constant *C) { - if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) - return CE->isGEPWithNoNotionalOverIndexing(); if (C->isThreadDependent()) return false; if (C->isDLLImportDependent()) return false; + if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) + return CE->isGEPWithNoNotionalOverIndexing(); + return isa<ConstantFP>(C) || isa<ConstantInt>(C) || isa<ConstantPointerNull>(C) || |