Explicitly request physreg coalesing for a bunch of Thumb2 unit tests.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Wed, 4 May 2011 19:02:07 +0000 (19:02 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Wed, 4 May 2011 19:02:07 +0000 (19:02 +0000)
These tests all follow the same pattern:

mov r2, r0
movs r0, #0
$CMP r2, r1
it eq
moveq r0, #1
bx lr

The first 'mov' can be eliminated by rematerializing 'movs r0, #0' below the
test instruction:

$CMP r0, r1
mov.w r0, #0
it eq
moveq r0, #1
bx lr

So far, only physreg coalescing can do that. The register allocators won't yet
split live ranges just to eliminate copies. They can learn, but this particular
problem is not likely to show up in real code. It only appears because r0 is
used for both the function argument and return value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130858 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGen/Thumb2/thumb2-cmn.ll
test/CodeGen/Thumb2/thumb2-cmp.ll
test/CodeGen/Thumb2/thumb2-cmp2.ll
test/CodeGen/Thumb2/thumb2-teq.ll
test/CodeGen/Thumb2/thumb2-teq2.ll
test/CodeGen/Thumb2/thumb2-tst.ll
test/CodeGen/Thumb2/thumb2-tst2.ll

index eeaaa7fbdf918a2fc0b489ddc822d3d228067621..df221b945e2ac170349a65130ab72d423ae4074c 100644 (file)
@@ -1,4 +1,7 @@
-; RUN: llc < %s -march=thumb -mattr=+thumb2 | FileCheck %s
+; RUN: llc < %s -march=thumb -mattr=+thumb2 -join-physregs | FileCheck %s
+
+; These tests implicitly depend on 'movs r0, #0' being rematerialized below the
+; test as 'mov.w r0, #0'. So far, that requires physreg joining.
 
 define i1 @f1(i32 %a, i32 %b) {
     %nb = sub i32 0, %b
index 63249f4cf14527043b49400e933b1eca5c5c035a..da121140be20958915234cbaddc6679b35b4ee5c 100644 (file)
@@ -1,4 +1,7 @@
-; RUN: llc < %s -march=thumb -mattr=+thumb2 | FileCheck %s
+; RUN: llc < %s -march=thumb -mattr=+thumb2 -join-physregs | FileCheck %s
+
+; These tests implicitly depend on 'movs r0, #0' being rematerialized below the
+; test as 'mov.w r0, #0'. So far, that requires physreg joining.
 
 ; 0x000000bb = 187
 define i1 @f1(i32 %a) {
index 55c321dc2b31e25d8556b260ac2dbbbd7933c79b..15052e00671049a47f4a944aba6ff3fa2dc5ee43 100644 (file)
@@ -1,4 +1,7 @@
-; RUN: llc < %s -march=thumb -mattr=+thumb2 | FileCheck %s
+; RUN: llc < %s -march=thumb -mattr=+thumb2 -join-physregs | FileCheck %s
+
+; These tests implicitly depend on 'movs r0, #0' being rematerialized below the
+; test as 'mov.w r0, #0'. So far, that requires physreg joining.
 
 define i1 @f1(i32 %a, i32 %b) {
 ; CHECK: f1:
index 69f03837f4bf2120746b04c712b2cb03d71990b3..566408a6048358e0c91c10b33862cad7ee933507 100644 (file)
@@ -1,5 +1,7 @@
-; RUN: llc < %s -march=thumb -mattr=+thumb2 | FileCheck %s
+; RUN: llc < %s -march=thumb -mattr=+thumb2 -join-physregs | FileCheck %s
 
+; These tests implicitly depend on 'movs r0, #0' being rematerialized below the
+; test as 'mov.w r0, #0'. So far, that requires physreg joining.
 
 ; 0x000000bb = 187
 define i1 @f1(i32 %a) {
index 0f122f253844e6db63a79272dee737fbed136b09..cdd3489c50d1f8641e74443c6998a548fa70b92a 100644 (file)
@@ -1,4 +1,7 @@
-; RUN: llc < %s -march=thumb -mattr=+thumb2 | FileCheck %s
+; RUN: llc < %s -march=thumb -mattr=+thumb2 -join-physregs | FileCheck %s
+
+; 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
index d905217189f4a0adf9f91c8cbf1648a60b014ee7..47f553f2048630b57554d81bc2817df48f837215 100644 (file)
@@ -1,5 +1,7 @@
-; RUN: llc < %s -march=thumb -mattr=+thumb2 | FileCheck %s
+; RUN: llc < %s -march=thumb -mattr=+thumb2 -join-physregs | FileCheck %s
 
+; These tests implicitly depend on 'movs r0, #0' being rematerialized below the
+; tst as 'mov.w r0, #0'. So far, that requires physreg joining.
 
 ; 0x000000bb = 187
 define i1 @f1(i32 %a) {
index db202dd2cbcd8f72a42f614b3398a69407f9e55d..405b3bb1d38510fb27671cd6b60f0bf9a2047b77 100644 (file)
@@ -1,4 +1,7 @@
-; RUN: llc < %s -march=thumb -mattr=+thumb2 | FileCheck %s
+; RUN: llc < %s -march=thumb -mattr=+thumb2 -join-physregs | FileCheck %s
+
+; 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: