diff options
author | Evan Cheng <evan.cheng@apple.com> | 2011-07-13 00:42:17 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2011-07-13 00:42:17 +0000 |
commit | e721f5c8d3ea2cc2cc8c3c308ce8bdd8a3fc3b32 (patch) | |
tree | 9d3a3b566011131e0112dd247270ca0dfc4f92d8 /test/CodeGen/Thumb2/thumb2-tst2.ll | |
parent | 3641e811729fc7f21039af595d62bc8e696ff407 (diff) | |
download | external_llvm-e721f5c8d3ea2cc2cc8c3c308ce8bdd8a3fc3b32.zip external_llvm-e721f5c8d3ea2cc2cc8c3c308ce8bdd8a3fc3b32.tar.gz external_llvm-e721f5c8d3ea2cc2cc8c3c308ce8bdd8a3fc3b32.tar.bz2 |
Improve codegen for select's:
if (x != 0) x = 1
if (x == 1) x = 1
Previous codegen looks like this:
mov r1, r0
cmp r1, #1
mov r0, #0
moveq r0, #1
The naive lowering select between two different values. It should recognize the
test is equality test so it's more a conditional move rather than a select:
cmp r0, #1
movne r0, #0
rdar://9758317
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135017 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/Thumb2/thumb2-tst2.ll')
-rw-r--r-- | test/CodeGen/Thumb2/thumb2-tst2.ll | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/test/CodeGen/Thumb2/thumb2-tst2.ll b/test/CodeGen/Thumb2/thumb2-tst2.ll index 405b3bb..bfe016f 100644 --- a/test/CodeGen/Thumb2/thumb2-tst2.ll +++ b/test/CodeGen/Thumb2/thumb2-tst2.ll @@ -3,14 +3,6 @@ ; These tests implicitly depend on 'movs r0, #0' being rematerialized below the ; tst as 'mov.w r0, #0'. So far, that requires physreg joining. -define i1 @f1(i32 %a, i32 %b) { -; CHECK: f1: -; CHECK: tst r0, r1 - %tmp = and i32 %a, %b - %tmp1 = icmp ne i32 %tmp, 0 - ret i1 %tmp1 -} - define i1 @f2(i32 %a, i32 %b) { ; CHECK: f2: ; CHECK: tst r0, r1 @@ -19,14 +11,6 @@ define i1 @f2(i32 %a, i32 %b) { ret i1 %tmp1 } -define i1 @f3(i32 %a, i32 %b) { -; CHECK: f3: -; CHECK: tst r0, r1 - %tmp = and i32 %a, %b - %tmp1 = icmp ne i32 0, %tmp - ret i1 %tmp1 -} - define i1 @f4(i32 %a, i32 %b) { ; CHECK: f4: ; CHECK: tst r0, r1 |