diff options
author | Richard Sandiford <rsandifo@linux.vnet.ibm.com> | 2013-08-23 11:27:19 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@linux.vnet.ibm.com> | 2013-08-23 11:27:19 +0000 |
commit | 35c93e4e42d7a35a90e89211fa62f478e25ba0a4 (patch) | |
tree | 639fbed77642a320f45ade7a571b37f1fbdf7b3c /test/CodeGen/SystemZ/int-cmp-41.ll | |
parent | 65ddcfa8c1c05aeecd9d4fb062bb121e376aaceb (diff) | |
download | external_llvm-35c93e4e42d7a35a90e89211fa62f478e25ba0a4.zip external_llvm-35c93e4e42d7a35a90e89211fa62f478e25ba0a4.tar.gz external_llvm-35c93e4e42d7a35a90e89211fa62f478e25ba0a4.tar.bz2 |
[SystemZ] Try reversing comparisons whose first operand is in memory
This allows us to make more use of the many compare reg,mem instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189099 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/SystemZ/int-cmp-41.ll')
-rw-r--r-- | test/CodeGen/SystemZ/int-cmp-41.ll | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/CodeGen/SystemZ/int-cmp-41.ll b/test/CodeGen/SystemZ/int-cmp-41.ll index 099681d..77f6e7d 100644 --- a/test/CodeGen/SystemZ/int-cmp-41.ll +++ b/test/CodeGen/SystemZ/int-cmp-41.ll @@ -100,3 +100,22 @@ exit: %res = phi i64 [ %src1, %entry ], [ %mul, %mulb ] ret i64 %res } + +; Check the comparison can be reversed if that allows CGFRL to be used. +define i64 @f6(i64 %src2) { +; CHECK-LABEL: f6: +; CHECK: cgfrl %r2, g +; CHECK-NEXT: jh {{\.L.*}} +; CHECK: br %r14 +entry: + %val = load i32 *@g + %src1 = sext i32 %val to i64 + %cond = icmp slt i64 %src1, %src2 + br i1 %cond, label %exit, label %mulb +mulb: + %mul = mul i64 %src2, %src2 + br label %exit +exit: + %res = phi i64 [ %src2, %entry ], [ %mul, %mulb ] + ret i64 %res +} |