diff options
| author | Ulrich Weigand <ulrich.weigand@de.ibm.com> | 2016-04-07 16:11:44 +0000 |
|---|---|---|
| committer | Ulrich Weigand <ulrich.weigand@de.ibm.com> | 2016-04-07 16:11:44 +0000 |
| commit | 2eb027d21f882e03f0658cddbdfee31efbf08663 (patch) | |
| tree | df88bad9a10f8b4870b77b2a2089a4a807962979 /llvm/test/CodeGen/SystemZ/int-cmp-13.ll | |
| parent | 14e351a553ea84d864174793a0a58b7ecda36c5d (diff) | |
| download | bcm5719-llvm-2eb027d21f882e03f0658cddbdfee31efbf08663.tar.gz bcm5719-llvm-2eb027d21f882e03f0658cddbdfee31efbf08663.zip | |
[SystemZ] Implement conditional returns
Return is now considered a predicable instruction, and is converted
to a newly-added CondReturn (which maps to BCR to %r14) instruction by
the if conversion pass.
Also, fused compare-and-branch transform knows about conditional
returns, emitting the proper fused instructions for them.
This transform triggers on a *lot* of tests, hence the huge diffstat.
The changes are mostly jX to br %r14 -> bXr %r14.
Author: koriakin
Differential Revision: http://reviews.llvm.org/D17339
llvm-svn: 265689
Diffstat (limited to 'llvm/test/CodeGen/SystemZ/int-cmp-13.ll')
| -rw-r--r-- | llvm/test/CodeGen/SystemZ/int-cmp-13.ll | 48 |
1 files changed, 32 insertions, 16 deletions
diff --git a/llvm/test/CodeGen/SystemZ/int-cmp-13.ll b/llvm/test/CodeGen/SystemZ/int-cmp-13.ll index 53af0c868a2..fda4496a961 100644 --- a/llvm/test/CodeGen/SystemZ/int-cmp-13.ll +++ b/llvm/test/CodeGen/SystemZ/int-cmp-13.ll @@ -9,7 +9,8 @@ define double @f1(double %a, double %b, i64 %i1) { ; CHECK: ldr %f0, %f2 ; CHECK: br %r14 %cond = icmp eq i64 %i1, 0 - %res = select i1 %cond, double %a, double %b + %tmp = select i1 %cond, double %a, double %b + %res = fadd double %tmp, 1.0 ret double %res } @@ -20,7 +21,8 @@ define double @f2(double %a, double %b, i64 %i1) { ; CHECK: ldr %f0, %f2 ; CHECK: br %r14 %cond = icmp eq i64 %i1, 127 - %res = select i1 %cond, double %a, double %b + %tmp = select i1 %cond, double %a, double %b + %res = fadd double %tmp, 1.0 ret double %res } @@ -32,7 +34,8 @@ define double @f3(double %a, double %b, i64 %i1) { ; CHECK: ldr %f0, %f2 ; CHECK: br %r14 %cond = icmp eq i64 %i1, 128 - %res = select i1 %cond, double %a, double %b + %tmp = select i1 %cond, double %a, double %b + %res = fadd double %tmp, 1.0 ret double %res } @@ -44,7 +47,8 @@ define double @f4(double %a, double %b, i64 %i1) { ; CHECK: ldr %f0, %f2 ; CHECK: br %r14 %cond = icmp eq i64 %i1, 32767 - %res = select i1 %cond, double %a, double %b + %tmp = select i1 %cond, double %a, double %b + %res = fadd double %tmp, 1.0 ret double %res } @@ -56,7 +60,8 @@ define double @f5(double %a, double %b, i64 %i1) { ; CHECK: ldr %f0, %f2 ; CHECK: br %r14 %cond = icmp eq i64 %i1, 32768 - %res = select i1 %cond, double %a, double %b + %tmp = select i1 %cond, double %a, double %b + %res = fadd double %tmp, 1.0 ret double %res } @@ -68,7 +73,8 @@ define double @f6(double %a, double %b, i64 %i1) { ; CHECK: ldr %f0, %f2 ; CHECK: br %r14 %cond = icmp eq i64 %i1, 2147483647 - %res = select i1 %cond, double %a, double %b + %tmp = select i1 %cond, double %a, double %b + %res = fadd double %tmp, 1.0 ret double %res } @@ -80,7 +86,8 @@ define double @f7(double %a, double %b, i64 %i1) { ; CHECK: ldr %f0, %f2 ; CHECK: br %r14 %cond = icmp eq i64 %i1, 2147483648 - %res = select i1 %cond, double %a, double %b + %tmp = select i1 %cond, double %a, double %b + %res = fadd double %tmp, 1.0 ret double %res } @@ -92,7 +99,8 @@ define double @f8(double %a, double %b, i64 %i1) { ; CHECK: ldr %f0, %f2 ; CHECK: br %r14 %cond = icmp eq i64 %i1, 4294967295 - %res = select i1 %cond, double %a, double %b + %tmp = select i1 %cond, double %a, double %b + %res = fadd double %tmp, 1.0 ret double %res } @@ -103,7 +111,8 @@ define double @f9(double %a, double %b, i64 %i1) { ; CHECK: ldr %f0, %f2 ; CHECK: br %r14 %cond = icmp eq i64 %i1, 4294967296 - %res = select i1 %cond, double %a, double %b + %tmp = select i1 %cond, double %a, double %b + %res = fadd double %tmp, 1.0 ret double %res } @@ -114,7 +123,8 @@ define double @f10(double %a, double %b, i64 %i1) { ; CHECK: ldr %f0, %f2 ; CHECK: br %r14 %cond = icmp eq i64 %i1, -1 - %res = select i1 %cond, double %a, double %b + %tmp = select i1 %cond, double %a, double %b + %res = fadd double %tmp, 1.0 ret double %res } @@ -125,7 +135,8 @@ define double @f11(double %a, double %b, i64 %i1) { ; CHECK: ldr %f0, %f2 ; CHECK: br %r14 %cond = icmp eq i64 %i1, -128 - %res = select i1 %cond, double %a, double %b + %tmp = select i1 %cond, double %a, double %b + %res = fadd double %tmp, 1.0 ret double %res } @@ -137,7 +148,8 @@ define double @f12(double %a, double %b, i64 %i1) { ; CHECK: ldr %f0, %f2 ; CHECK: br %r14 %cond = icmp eq i64 %i1, -129 - %res = select i1 %cond, double %a, double %b + %tmp = select i1 %cond, double %a, double %b + %res = fadd double %tmp, 1.0 ret double %res } @@ -149,7 +161,8 @@ define double @f13(double %a, double %b, i64 %i1) { ; CHECK: ldr %f0, %f2 ; CHECK: br %r14 %cond = icmp eq i64 %i1, -32768 - %res = select i1 %cond, double %a, double %b + %tmp = select i1 %cond, double %a, double %b + %res = fadd double %tmp, 1.0 ret double %res } @@ -161,7 +174,8 @@ define double @f14(double %a, double %b, i64 %i1) { ; CHECK: ldr %f0, %f2 ; CHECK: br %r14 %cond = icmp eq i64 %i1, -32769 - %res = select i1 %cond, double %a, double %b + %tmp = select i1 %cond, double %a, double %b + %res = fadd double %tmp, 1.0 ret double %res } @@ -173,7 +187,8 @@ define double @f15(double %a, double %b, i64 %i1) { ; CHECK: ldr %f0, %f2 ; CHECK: br %r14 %cond = icmp eq i64 %i1, -2147483648 - %res = select i1 %cond, double %a, double %b + %tmp = select i1 %cond, double %a, double %b + %res = fadd double %tmp, 1.0 ret double %res } @@ -184,6 +199,7 @@ define double @f16(double %a, double %b, i64 %i1) { ; CHECK: ldr %f0, %f2 ; CHECK: br %r14 %cond = icmp eq i64 %i1, -2147483649 - %res = select i1 %cond, double %a, double %b + %tmp = select i1 %cond, double %a, double %b + %res = fadd double %tmp, 1.0 ret double %res } |

