summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGCall.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-06-26 23:03:20 +0000
committerChris Lattner <sabre@nondot.org>2010-06-26 23:03:20 +0000
commit6c5abe88bff9a4cd5abfa8bb793ecfdfc219a06b (patch)
tree09b525943d33780f6204975d991fed6834904ae3 /clang/lib/CodeGen/CGCall.cpp
parentf00eac5cfff3f3ed6ed99b7f7439664ee2226910 (diff)
downloadbcm5719-llvm-6c5abe88bff9a4cd5abfa8bb793ecfdfc219a06b.tar.gz
bcm5719-llvm-6c5abe88bff9a4cd5abfa8bb793ecfdfc219a06b.zip
Implement rdar://7530813 - collapse multiple GEP instructions in IRgen
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
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud