diff options
| author | James Molloy <james.molloy@arm.com> | 2016-09-09 12:52:24 +0000 |
|---|---|---|
| committer | James Molloy <james.molloy@arm.com> | 2016-09-09 12:52:24 +0000 |
| commit | 4d86bed0bb2d109f9aa802cc09377900b84c09bb (patch) | |
| tree | 19d55765b086baec9f875b689c46d4006c30bd9a /llvm/test/CodeGen/ARM | |
| parent | a6987a4dddc61168fbccba7493c176d35689a004 (diff) | |
| download | bcm5719-llvm-4d86bed0bb2d109f9aa802cc09377900b84c09bb.tar.gz bcm5719-llvm-4d86bed0bb2d109f9aa802cc09377900b84c09bb.zip | |
[Thumb] Select (CMPZ X, -C) -> (CMPZ (ADDS X, C), 0)
The CMPZ #0 disappears during peepholing, leaving just a tADDi3, tADDi8 or t2ADDri. This avoids having to materialize the expensive negative constant in Thumb-1, and allows a shrinking from a 32-bit CMN to a 16-bit ADDS in Thumb-2.
llvm-svn: 281040
Diffstat (limited to 'llvm/test/CodeGen/ARM')
| -rw-r--r-- | llvm/test/CodeGen/ARM/lsr-icmp-imm.ll | 7 | ||||
| -rw-r--r-- | llvm/test/CodeGen/ARM/select_xform.ll | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/llvm/test/CodeGen/ARM/lsr-icmp-imm.ll b/llvm/test/CodeGen/ARM/lsr-icmp-imm.ll index ef98727344e..3c68cc70aa8 100644 --- a/llvm/test/CodeGen/ARM/lsr-icmp-imm.ll +++ b/llvm/test/CodeGen/ARM/lsr-icmp-imm.ll @@ -1,5 +1,5 @@ -; RUN: llc -mtriple=thumbv7-apple-ios -disable-block-placement < %s | FileCheck %s -; RUN: llc -mtriple=armv7-apple-ios -disable-block-placement < %s | FileCheck %s +; RUN: llc -mtriple=thumbv7-apple-ios -disable-block-placement < %s | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-T +; RUN: llc -mtriple=armv7-apple-ios -disable-block-placement < %s | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-A ; LSR should compare against the post-incremented induction variable. ; In this case, the immediate value is -2 which requires a cmn instruction. @@ -7,7 +7,8 @@ ; CHECK-LABEL: f: ; CHECK: %for.body ; CHECK: sub{{.*}}[[IV:r[0-9]+]], #2 -; CHECK: cmn{{.*}}[[IV]], #2 +; CHECK-T: adds{{.*}}[[IV]], #2 +; CHECK-A: cmn{{.*}}[[IV]], #2 ; CHECK: bne define i32 @f(i32* nocapture %a, i32 %i) nounwind readonly ssp { entry: diff --git a/llvm/test/CodeGen/ARM/select_xform.ll b/llvm/test/CodeGen/ARM/select_xform.ll index 460ca8f1840..8c1502e1465 100644 --- a/llvm/test/CodeGen/ARM/select_xform.ll +++ b/llvm/test/CodeGen/ARM/select_xform.ll @@ -280,7 +280,7 @@ entry: ; ARM: and r0, {{r[0-9]+}}, {{r[0-9]+}} ; T2-LABEL: t18: -; T2: and.w r0, {{r[0-9]+}} +; T2: and{{s|.w}} r0, {{r[0-9]+}} %cmp = icmp ne i32 %x, 0 %cond = select i1 %cmp, i32 5, i32 2 %cmp1 = icmp ne i32 %x, -1 |

