mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-02 16:56:50 +00:00
Avoid creating 'load X, 0' instead of just 'load X'
This _trivial_ change causes GCSE and LICM to be much more effective at hoisting loads. Before it would not be able to eliminate 'load X' if there was just a dominating 'load X, 0' because the expressions were not identical. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3337 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
db6e4d6625
commit
b9a7793ecb
@ -990,6 +990,9 @@ static void ConvertOperandToType(User *U, Value *OldVal, Value *NewVal,
|
||||
}
|
||||
assert(LoadedTy->isFirstClassType());
|
||||
|
||||
if (Indices.size() == 1)
|
||||
Indices.clear(); // Do not generate load X, 0
|
||||
|
||||
Res = new LoadInst(NewVal, Indices, Name);
|
||||
assert(Res->getType()->isFirstClassType() && "Load of structure or array!");
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user