diff options
author | Tim Northover <tnorthover@apple.com> | 2013-08-22 09:57:11 +0000 |
---|---|---|
committer | Tim Northover <tnorthover@apple.com> | 2013-08-22 09:57:11 +0000 |
commit | f7ab3a84b3e1b5a647ae9456a5edb99d86b35329 (patch) | |
tree | def91cf5a4a3ba94fb757beb78a53ae046dfe738 /test/CodeGen/Thumb2/thumb2-select.ll | |
parent | bccc6f89b7a15abda5593a30c101ae85d1dc3b77 (diff) | |
download | llvm-f7ab3a84b3e1b5a647ae9456a5edb99d86b35329.tar.gz llvm-f7ab3a84b3e1b5a647ae9456a5edb99d86b35329.tar.bz2 llvm-f7ab3a84b3e1b5a647ae9456a5edb99d86b35329.tar.xz |
ARM: use TableGen patterns to select CMOV operations.
Back in the mists of time (2008), it seems TableGen couldn't handle the
patterns necessary to match ARM's CMOV node that we convert select operations
to, so we wrote a lot of fairly hairy C++ to do it for us.
TableGen can deal with it now: there were a few minor differences to CodeGen
(see tests), but nothing obviously worse that I could see, so we should
probably address anything that *does* come up in a localised manner.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188995 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/Thumb2/thumb2-select.ll')
-rw-r--r-- | test/CodeGen/Thumb2/thumb2-select.ll | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/test/CodeGen/Thumb2/thumb2-select.ll b/test/CodeGen/Thumb2/thumb2-select.ll index 0feaf9560a..c4d4480965 100644 --- a/test/CodeGen/Thumb2/thumb2-select.ll +++ b/test/CodeGen/Thumb2/thumb2-select.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -march=thumb -mattr=+thumb2 | FileCheck %s +; RUN: llc < %s -march=thumb -mattr=+thumb2 -show-mc-encoding | FileCheck %s define i32 @f1(i32 %a.s) { entry: @@ -66,7 +66,7 @@ define i32 @f7(i32 %a, i32 %b, i32 %c) { entry: ; CHECK-LABEL: f7: ; CHECK: it hi -; CHECK: lsrhi.w +; CHECK: lsrhi {{r[0-9]+}} %tmp1 = icmp ugt i32 %a, %b %tmp2 = udiv i32 %c, 3 %tmp3 = select i1 %tmp1, i32 %tmp2, i32 3 @@ -77,7 +77,7 @@ define i32 @f8(i32 %a, i32 %b, i32 %c) { entry: ; CHECK-LABEL: f8: ; CHECK: it lo -; CHECK: lsllo.w +; CHECK: lsllo {{r[0-9]+}} %tmp1 = icmp ult i32 %a, %b %tmp2 = mul i32 %c, 4 %tmp3 = select i1 %tmp1, i32 %tmp2, i32 3 @@ -96,3 +96,11 @@ entry: %tmp5 = select i1 %tmp1, i32 %tmp4, i32 3 ret i32 %tmp5 } + +define i32 @f10(i32 %a, i32 %b) { +; CHECK-LABEL: f10: +; CHECK: movwne r2, #1234 @ encoding: [0x40,0xf2,0xd2,0x42] + %tst = icmp ne i32 %a, %b + %val = select i1 %tst, i32 1234, i32 12345 + ret i32 %val +} |