diff options
| author | Chris Lattner <sabre@nondot.org> | 2012-06-01 05:29:15 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2012-06-01 05:29:15 +0000 |
| commit | 466076b95fb6a91c008b40e00565a1c1ff4f4ece (patch) | |
| tree | 2fdc1211d66a5b34cda7f64b958a292447f0c248 /llvm/test | |
| parent | df09da83557720ab5ecbe496dfdd21efb8f271f0 (diff) | |
| download | bcm5719-llvm-466076b95fb6a91c008b40e00565a1c1ff4f4ece.tar.gz bcm5719-llvm-466076b95fb6a91c008b40e00565a1c1ff4f4ece.zip | |
enhance the logic for looking through tailcalls to look through transparent casts
in multiple-return value scenarios, like what happens on X86-64 when returning
small structs.
llvm-svn: 157800
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/CodeGen/X86/tailcall-64.ll | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/tailcall-64.ll b/llvm/test/CodeGen/X86/tailcall-64.ll index a3ef2dc8ef4..98e728c909c 100644 --- a/llvm/test/CodeGen/X86/tailcall-64.ll +++ b/llvm/test/CodeGen/X86/tailcall-64.ll @@ -41,3 +41,49 @@ define <4 x i32> @test_vectorbitcast() { } ; CHECK: test_vectorbitcast: ; CHECK: jmp _testv ## TAILCALL + + +declare { i64, i64 } @testp() + +define {i64, i64} @test_pair_trivial() { + %A = tail call { i64, i64} @testp() + ret { i64, i64} %A +} +; CHECK: test_pair_trivial: +; CHECK: jmp _testp ## TAILCALL + + + +define {i64, i64} @test_pair_trivial_extract() { + %A = tail call { i64, i64} @testp() + %x = extractvalue { i64, i64} %A, 0 + %y = extractvalue { i64, i64} %A, 1 + + %b = insertvalue {i64, i64} undef, i64 %x, 0 + %c = insertvalue {i64, i64} %b, i64 %y, 1 + + ret { i64, i64} %c +} + +; CHECK: test_pair_trivial_extract: +; CHECK: jmp _testp ## TAILCALL + +define {i8*, i64} @test_pair_conv_extract() { + %A = tail call { i64, i64} @testp() + %x = extractvalue { i64, i64} %A, 0 + %y = extractvalue { i64, i64} %A, 1 + + %x1 = inttoptr i64 %x to i8* + + %b = insertvalue {i8*, i64} undef, i8* %x1, 0 + %c = insertvalue {i8*, i64} %b, i64 %y, 1 + + ret { i8*, i64} %c +} + +; CHECK: test_pair_conv_extract: +; CHECK: jmp _testp ## TAILCALL + + + + |

