mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-13 23:18:58 +00:00
Added code that checks to see if a global variable is external before replacing
a load of the global variable with the variable's constant value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7216 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cf2a7385dd
commit
067947380c
@ -1294,7 +1294,7 @@ Instruction *InstCombiner::visitLoadInst(LoadInst &LI) {
|
||||
|
||||
// Instcombine load (constant global) into the value loaded...
|
||||
if (GlobalVariable *GV = dyn_cast<GlobalVariable>(Op))
|
||||
if (GV->isConstant())
|
||||
if ((GV->isConstant()) && (!(GV->isExternal())))
|
||||
return ReplaceInstUsesWith(LI, GV->getInitializer());
|
||||
|
||||
// Instcombine load (constantexpr_GEP global, 0, ...) into the value loaded...
|
||||
|
Loading…
Reference in New Issue
Block a user