[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-19.ll b/llvm/test/CodeGen/SystemZ/int-cmp-19.ll
index 0a23f06..2a6a979 100644
--- a/llvm/test/CodeGen/SystemZ/int-cmp-19.ll
+++ b/llvm/test/CodeGen/SystemZ/int-cmp-19.ll
@@ -7,7 +7,7 @@
 define double @f1(double %a, double %b, i8 *%ptr) {
 ; CHECK-LABEL: f1:
 ; CHECK: cli 0(%r2), 0
-; CHECK-NEXT: jlh
+; CHECK-NEXT: blhr %r14
 ; CHECK: br %r14
   %val = load i8 , i8 *%ptr
   %ext = zext i8 %val to i64
@@ -20,7 +20,7 @@
 define double @f2(double %a, double %b, i8 *%ptr) {
 ; CHECK-LABEL: f2:
 ; CHECK: cli 0(%r2), 255
-; CHECK-NEXT: jlh
+; CHECK-NEXT: blhr %r14
 ; CHECK: br %r14
   %val = load i8 , i8 *%ptr
   %ext = zext i8 %val to i64
@@ -58,7 +58,7 @@
 define double @f5(double %a, double %b, i8 *%ptr) {
 ; CHECK-LABEL: f5:
 ; CHECK: cli 0(%r2), 0
-; CHECK-NEXT: jlh
+; CHECK-NEXT: blhr %r14
 ; CHECK: br %r14
   %val = load i8 , i8 *%ptr
   %ext = sext i8 %val to i64
@@ -71,7 +71,7 @@
 define double @f6(double %a, double %b, i8 *%ptr) {
 ; CHECK-LABEL: f6:
 ; CHECK: cli 0(%r2), 127
-; CHECK-NEXT: jlh
+; CHECK-NEXT: blhr %r14
 ; CHECK: br %r14
   %val = load i8 , i8 *%ptr
   %ext = sext i8 %val to i64
@@ -97,7 +97,7 @@
 define double @f8(double %a, double %b, i8 *%ptr) {
 ; CHECK-LABEL: f8:
 ; CHECK: cli 0(%r2), 255
-; CHECK-NEXT: jlh
+; CHECK-NEXT: blhr %r14
 ; CHECK: br %r14
   %val = load i8 , i8 *%ptr
   %ext = sext i8 %val to i64
@@ -110,7 +110,7 @@
 define double @f9(double %a, double %b, i8 *%ptr) {
 ; CHECK-LABEL: f9:
 ; CHECK: cli 0(%r2), 128
-; CHECK-NEXT: jlh
+; CHECK-NEXT: blhr %r14
 ; CHECK: br %r14
   %val = load i8 , i8 *%ptr
   %ext = sext i8 %val to i64