diff options
| author | Chris Lattner <sabre@nondot.org> | 2002-08-14 22:11:52 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2002-08-14 22:11:52 +0000 |
| commit | 768c2b6bfe3f865e912ad2eadadc64c33c25f4cf (patch) | |
| tree | 3fc349a623fdc6c44e154cf7adc19a71d0065990 /llvm/lib/Transforms | |
| parent | 313fd777678b00f663f15a533ab92510dbe96058 (diff) | |
| download | bcm5719-llvm-768c2b6bfe3f865e912ad2eadadc64c33c25f4cf.tar.gz bcm5719-llvm-768c2b6bfe3f865e912ad2eadadc64c33c25f4cf.zip | |
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.
llvm-svn: 3337
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/ExprTypeConvert.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/ExprTypeConvert.cpp b/llvm/lib/Transforms/ExprTypeConvert.cpp index 98bc9425f45..ede89563717 100644 --- a/llvm/lib/Transforms/ExprTypeConvert.cpp +++ b/llvm/lib/Transforms/ExprTypeConvert.cpp @@ -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; |

