summaryrefslogtreecommitdiff
path: root/test/CodeGen/SystemZ/int-cmp-37.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/SystemZ/int-cmp-37.ll')
-rw-r--r--test/CodeGen/SystemZ/int-cmp-37.ll19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/CodeGen/SystemZ/int-cmp-37.ll b/test/CodeGen/SystemZ/int-cmp-37.ll
index 97d210e5f5..dc11a5cba7 100644
--- a/test/CodeGen/SystemZ/int-cmp-37.ll
+++ b/test/CodeGen/SystemZ/int-cmp-37.ll
@@ -101,3 +101,22 @@ exit:
%res = phi i32 [ %src1, %entry ], [ %mul, %mulb ]
ret i32 %res
}
+
+; Check the comparison can be reversed if that allows CLHRL to be used.
+define i32 @f6(i32 %src2) {
+; CHECK-LABEL: f6:
+; CHECK: clhrl %r2, g
+; CHECK-NEXT: jh {{\.L.*}}
+; CHECK: br %r14
+entry:
+ %val = load i16 *@g
+ %src1 = zext i16 %val to i32
+ %cond = icmp ult i32 %src1, %src2
+ br i1 %cond, label %exit, label %mulb
+mulb:
+ %mul = mul i32 %src2, %src2
+ br label %exit
+exit:
+ %res = phi i32 [ %src2, %entry ], [ %mul, %mulb ]
+ ret i32 %res
+}