diff options
| author | Matthijs Kooijman <matthijs@stdin.nl> | 2008-07-15 14:03:10 +0000 |
|---|---|---|
| committer | Matthijs Kooijman <matthijs@stdin.nl> | 2008-07-15 14:03:10 +0000 |
| commit | c1da8744782af8b32158667f27327d79af68abca (patch) | |
| tree | 9f150c80adab2c68f174643ecb0a2992c8f19816 /llvm/test/Transforms | |
| parent | 04d4c328ac6001f7563ddf7f49cbad4b85dbc781 (diff) | |
| download | bcm5719-llvm-c1da8744782af8b32158667f27327d79af68abca.tar.gz bcm5719-llvm-c1da8744782af8b32158667f27327d79af68abca.zip | |
Make deadargelim a bit less smart, so it doesn't choke on nested structs as
return values that are still (partially) live. Instead of updating all uses of
a call instruction after removing some elements, it now just rebuilds the
original struct (With undef gaps where the unused values were) and leaves it to
instcombine to clean this up.
The added testcase still fails currently, but this is due to instcombine which
isn't good enough yet. I will fix that part next.
llvm-svn: 53608
Diffstat (limited to 'llvm/test/Transforms')
| -rw-r--r-- | llvm/test/Transforms/DeadArgElim/multdeadretval.ll | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/llvm/test/Transforms/DeadArgElim/multdeadretval.ll b/llvm/test/Transforms/DeadArgElim/multdeadretval.ll index f60fd0fc395..6e0474a6f8d 100644 --- a/llvm/test/Transforms/DeadArgElim/multdeadretval.ll +++ b/llvm/test/Transforms/DeadArgElim/multdeadretval.ll @@ -38,6 +38,14 @@ define internal {i32, i32, i16} @test5() { ret {i32, i32, i16} %C } +; Nested return values +define internal {{i32}, {i16, i16}} @test6() { + %A = insertvalue {{i32}, {i16, i16}} undef, i32 1, 0, 0 + %B = insertvalue {{i32}, {i16, i16}} %A, i16 2, 1, 0 + %C = insertvalue {{i32}, {i16, i16}} %B, i16 3, 1, 1 + ret {{i32}, {i16, i16}} %C +} + define i32 @main() { %ret = call {i32, i16} @test2() ; <i32> [#uses=1] %LIVE = extractvalue {i32, i16} %ret, 0 @@ -51,5 +59,10 @@ define i32 @main() { %DEAD2 = extractvalue { i32, i32, i16} %ret1, 2 %V = add i32 %LIVE3, %LIVE4 %W = add i32 %Z, %V - ret i32 %W + %ret2 = call { { i32 }, { i16, i16 } } @test6 () + %LIVE5 = extractvalue { { i32 }, { i16, i16 } } %ret2, 0, 0 + %DEAD3 = extractvalue { { i32 }, { i16, i16 } } %ret2, 1, 0 + %DEAD4 = extractvalue { { i32 }, { i16, i16 } } %ret2, 1, 1 + %Q = add i32 %W, %LIVE5 + ret i32 %Q } |

