diff options
author | Sanjoy Das <sanjoy@playingwithpointers.com> | 2015-12-14 19:11:40 +0000 |
---|---|---|
committer | Sanjoy Das <sanjoy@playingwithpointers.com> | 2015-12-14 19:11:40 +0000 |
commit | 32d33b59bceec080b40771fc3893f202ccbae1ee (patch) | |
tree | b4ac4122df8acd7ea81509d95f49881a5b7388e6 /test/Feature | |
parent | 97a58d8cf4ee932a0ad2b6b75fc5b7743e2e4bde (diff) |
Teach MergeFunctions about operand bundles
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255528 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Feature')
-rw-r--r-- | test/Feature/OperandBundles/merge-func.ll | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/Feature/OperandBundles/merge-func.ll b/test/Feature/OperandBundles/merge-func.ll new file mode 100644 index 00000000000..aad9262c901 --- /dev/null +++ b/test/Feature/OperandBundles/merge-func.ll @@ -0,0 +1,34 @@ +; RUN: opt -S -mergefunc < %s | FileCheck %s + +; Minor note: functions need to be at least three instructions long +; to be considered by -mergefunc. + +declare i32 @foo(...) + +define i32 @f() { +; CHECK-LABEL: @f( + entry: + %v0 = call i32 (...) @foo(i32 10) [ "foo"(i32 20) ] + %v1 = call i32 (...) @foo(i32 10) [ "foo"(i32 20) ] + %v2 = call i32 (...) @foo(i32 10) [ "foo"(i32 20) ] + +; CHECK: %v0 = call i32 (...) @foo(i32 10) [ "foo"(i32 20) ] +; CHECK: %v1 = call i32 (...) @foo(i32 10) [ "foo"(i32 20) ] +; CHECK: %v2 = call i32 (...) @foo(i32 10) [ "foo"(i32 20) ] + + ret i32 %v2 +} + +define i32 @g() { +; CHECK-LABEL: @g( + entry: + %v0 = call i32 (...) @foo() [ "foo"(i32 10, i32 20) ] + %v1 = call i32 (...) @foo() [ "foo"(i32 10, i32 20) ] + %v2 = call i32 (...) @foo() [ "foo"(i32 10, i32 20) ] + +; CHECK: %v0 = call i32 (...) @foo() [ "foo"(i32 10, i32 20) ] +; CHECK: %v1 = call i32 (...) @foo() [ "foo"(i32 10, i32 20) ] +; CHECK: %v2 = call i32 (...) @foo() [ "foo"(i32 10, i32 20) ] + + ret i32 %v2 +} |