mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
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
This commit is contained in:
@@ -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) ||
|
||||
|
Reference in New Issue
Block a user