diff options
| author | Jonas Paulsson <jonas.paulsson@ericsson.com> | 2015-10-08 07:40:23 +0000 |
|---|---|---|
| committer | Jonas Paulsson <jonas.paulsson@ericsson.com> | 2015-10-08 07:40:23 +0000 |
| commit | 5d3fbd373345ab902c3e0c47402f7b934e5bdbbc (patch) | |
| tree | d8b7315a98b390636725ec2d8a76aa98aaf57edd /llvm/test/CodeGen/SystemZ | |
| parent | 29d9d8d95572c9794eb29762f163e842b4837140 (diff) | |
| download | bcm5719-llvm-5d3fbd373345ab902c3e0c47402f7b934e5bdbbc.tar.gz bcm5719-llvm-5d3fbd373345ab902c3e0c47402f7b934e5bdbbc.zip | |
[SystemZ] SystemZElimCompare pass improved.
Compare elimination extended to recognize load-and-test instructions used
for comparison and eliminate them the same way as with compare instructions.
Test case fp-cmp-05.ll updated to expect optimized results now also for z13.
The order of instruction shortening and compare elimination passes have been
changed so that opcodes do not have to be handled in both passes.
Reviewed by Ulrich Weigand.
llvm-svn: 249666
Diffstat (limited to 'llvm/test/CodeGen/SystemZ')
| -rw-r--r-- | llvm/test/CodeGen/SystemZ/fp-cmp-05.ll | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/llvm/test/CodeGen/SystemZ/fp-cmp-05.ll b/llvm/test/CodeGen/SystemZ/fp-cmp-05.ll index 1d71a0fcec5..7e937d1adae 100644 --- a/llvm/test/CodeGen/SystemZ/fp-cmp-05.ll +++ b/llvm/test/CodeGen/SystemZ/fp-cmp-05.ll @@ -4,14 +4,15 @@ ; handled by SystemZElimcompare, so for Z13 this is currently ; unimplemented. ; -; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z10 | FileCheck %s -check-prefix=CHECK-Z10 +; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z10 | FileCheck %s +; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s ; Load complement (sign-bit flipped). ; Test f32 define float @f1(float %a, float %b, float %f) { ; CHECK-LABEL: f1: -; CHECK-Z10: lcebr -; CHECK-Z10-NEXT: je +; CHECK: lcebr +; CHECK-NEXT: je %neg = fsub float -0.0, %f %cond = fcmp oeq float %neg, 0.0 %res = select i1 %cond, float %a, float %b @@ -21,8 +22,8 @@ define float @f1(float %a, float %b, float %f) { ; Test f64 define double @f2(double %a, double %b, double %f) { ; CHECK-LABEL: f2: -; CHECK-Z10: lcdbr -; CHECK-Z10-NEXT: je +; CHECK: lcdbr +; CHECK-NEXT: je %neg = fsub double -0.0, %f %cond = fcmp oeq double %neg, 0.0 %res = select i1 %cond, double %a, double %b @@ -34,8 +35,8 @@ define double @f2(double %a, double %b, double %f) { declare float @llvm.fabs.f32(float %f) define float @f3(float %a, float %b, float %f) { ; CHECK-LABEL: f3: -; CHECK-Z10: lnebr -; CHECK-Z10-NEXT: je +; CHECK: lnebr +; CHECK-NEXT: je %abs = call float @llvm.fabs.f32(float %f) %neg = fsub float -0.0, %abs %cond = fcmp oeq float %neg, 0.0 @@ -47,8 +48,8 @@ define float @f3(float %a, float %b, float %f) { declare double @llvm.fabs.f64(double %f) define double @f4(double %a, double %b, double %f) { ; CHECK-LABEL: f4: -; CHECK-Z10: lndbr -; CHECK-Z10-NEXT: je +; CHECK: lndbr +; CHECK-NEXT: je %abs = call double @llvm.fabs.f64(double %f) %neg = fsub double -0.0, %abs %cond = fcmp oeq double %neg, 0.0 @@ -60,8 +61,8 @@ define double @f4(double %a, double %b, double %f) { ; Test f32 define float @f5(float %a, float %b, float %f) { ; CHECK-LABEL: f5: -; CHECK-Z10: lpebr -; CHECK-Z10-NEXT: je +; CHECK: lpebr +; CHECK-NEXT: je %abs = call float @llvm.fabs.f32(float %f) %cond = fcmp oeq float %abs, 0.0 %res = select i1 %cond, float %a, float %b @@ -71,8 +72,8 @@ define float @f5(float %a, float %b, float %f) { ; Test f64 define double @f6(double %a, double %b, double %f) { ; CHECK-LABEL: f6: -; CHECK-Z10: lpdbr -; CHECK-Z10-NEXT: je +; CHECK: lpdbr +; CHECK-NEXT: je %abs = call double @llvm.fabs.f64(double %f) %cond = fcmp oeq double %abs, 0.0 %res = select i1 %cond, double %a, double %b |

