[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
diff --git a/llvm/test/CodeGen/SystemZ/int-cmp-10.ll b/llvm/test/CodeGen/SystemZ/int-cmp-10.ll
index 4d4c4bb..e2a0c1a 100644
--- a/llvm/test/CodeGen/SystemZ/int-cmp-10.ll
+++ b/llvm/test/CodeGen/SystemZ/int-cmp-10.ll
@@ -10,7 +10,8 @@
; CHECK: ldr %f0, %f2
; CHECK: br %r14
%cond = icmp ugt i32 %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
}
@@ -21,7 +22,8 @@
; CHECK: ldr %f0, %f2
; CHECK: br %r14
%cond = icmp ult i32 %i1, 255
- %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
}
@@ -33,7 +35,8 @@
; CHECK: ldr %f0, %f2
; CHECK: br %r14
%cond = icmp ult i32 %i1, 256
- %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
}
@@ -45,6 +48,7 @@
; CHECK: ldr %f0, %f2
; CHECK: br %r14
%cond = icmp ult i32 %i1, 4294967280
- %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
}