forked from OSchip/llvm-project
6c5abe88bf
This avoids generating two gep's for common array operations. Before we would generate something like: %tmp = load i32* %X.addr ; <i32> [#uses=1] %arraydecay = getelementptr inbounds [100 x i32]* %A, i32 0, i32 0 ; <i32*> [#uses=1] %arrayidx = getelementptr inbounds i32* %arraydecay, i32 %tmp ; <i32*> [#uses=1] %tmp1 = load i32* %arrayidx ; <i32> [#uses=1] Now we generate: %tmp = load i32* %X.addr ; <i32> [#uses=1] %arrayidx = getelementptr inbounds [100 x i32]* %A, i32 0, i32 %tmp ; <i32*> [#uses=1] %tmp1 = load i32* %arrayidx ; <i32> [#uses=1] Less IR is better at -O0. llvm-svn: 106966 |
||
---|---|---|
.. | ||
AST | ||
Analysis | ||
Basic | ||
Checker | ||
CodeGen | ||
Driver | ||
Frontend | ||
Headers | ||
Index | ||
Lex | ||
Parse | ||
Rewrite | ||
Runtime | ||
Sema | ||
CMakeLists.txt | ||
Makefile |