mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Fix a regression in my previous patch, fixing GlobalOpt/2005-09-27-Crash.ll
and PR632. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23484 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ee35a4f958
commit
9a5582f251
@ -337,7 +337,7 @@ static bool CleanupConstantGlobalUsers(Value *V, Constant *Init) {
|
||||
Constant *SubInit = 0;
|
||||
ConstantExpr *CE =
|
||||
dyn_cast_or_null<ConstantExpr>(ConstantFoldInstruction(GEP));
|
||||
if (CE && CE->getOpcode() == Instruction::GetElementPtr)
|
||||
if (Init && CE && CE->getOpcode() == Instruction::GetElementPtr)
|
||||
SubInit = ConstantFoldLoadThroughGEPConstantExpr(Init, CE);
|
||||
Changed |= CleanupConstantGlobalUsers(GEP, SubInit);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user