Fix a batch of x86 tests to be coalescer independent.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Wed, 4 May 2011 23:54:51 +0000 (23:54 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Wed, 4 May 2011 23:54:51 +0000 (23:54 +0000)
Most of these tests require a single mov instruction that can come either before
or after a 2-addr instruction. -join-physregs changes the behavior, but the
results are equivalent.

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

test/CodeGen/X86/sse3.ll
test/CodeGen/X86/sse42.ll
test/CodeGen/X86/tail-opts.ll
test/CodeGen/X86/use-add-flags.ll
test/CodeGen/X86/vec_shuffle-16.ll
test/CodeGen/X86/win64_alloca_dynalloca.ll
test/CodeGen/X86/x86-64-and-mask.ll

index 8e72f133420a9bfafd86d6616db56873b87afc8f..8c2e58d5030295a6b63e73e122f0c6a0f9c4842d 100644 (file)
@@ -62,11 +62,10 @@ define <8 x i16> @t4(<8 x i16> %A, <8 x i16> %B) nounwind {
        %tmp = shufflevector <8 x i16> %A, <8 x i16> %B, <8 x i32> < i32 0, i32 7, i32 2, i32 3, i32 1, i32 5, i32 6, i32 5 >
        ret <8 x i16> %tmp
 ; X64: t4:
-; X64:         pextrw  $7, %xmm0, %eax
-; X64:         pshufhw $100, %xmm0, %xmm1
-; X64:         pinsrw  $1, %eax, %xmm1
-; X64:         pextrw  $1, %xmm0, %eax
-; X64:         movdqa  %xmm1, %xmm0
+; X64:         pextrw  $7, [[XMM0:%xmm[0-9]+]], %eax
+; X64:         pshufhw $100, [[XMM0]], [[XMM1:%xmm[0-9]+]]
+; X64:         pinsrw  $1, %eax, [[XMM1]]
+; X64:         pextrw  $1, [[XMM0]], %eax
 ; X64:         pinsrw  $4, %eax, %xmm0
 ; X64:         ret
 }
@@ -251,13 +250,13 @@ entry:
         %tmp9 = shufflevector <16 x i8> %tmp8, <16 x i8> %T0,  <16 x i32> < i32 0, i32 1, i32 2, i32 17,  i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef , i32 undef >
         ret <16 x i8> %tmp9
 ; X64:         t16:
-; X64:                 pinsrw  $0, %eax, %xmm1
-; X64:                 pextrw  $8, %xmm0, %eax
-; X64:                 pinsrw  $1, %eax, %xmm1
-; X64:                 pextrw  $1, %xmm1, %ecx
-; X64:                 movd    %xmm1, %edx
-; X64:                 pinsrw  $0, %edx, %xmm1
-; X64:                 pinsrw  $1, %eax, %xmm0
+; X64:                 pinsrw  $0, %eax, [[X1:%xmm[0-9]+]]
+; X64:                 pextrw  $8, [[X0:%xmm[0-9]+]], %eax
+; X64:                 pinsrw  $1, %eax, [[X1]]
+; X64:                 pextrw  $1, [[X1]], %ecx
+; X64:                 movd    [[X1]], %edx
+; X64:                 pinsrw  $0, %edx, %xmm
+; X64:                 pinsrw  $1, %eax, %xmm
 ; X64:                 ret
 }
 
index 1723909a4b495ff91d9f91c2b232a867d91c6eb8..f415439cd47e775777f48b025cebe63533462ee9 100644 (file)
@@ -12,7 +12,7 @@ define i32 @crc32_8(i32 %a, i8 %b) nounwind {
 ; X32:     crc32b   8(%esp), %eax
 
 ; X64: _crc32_8:
-; X64:     crc32b   %sil, %eax
+; X64:     crc32b   %sil,
 }
 
 
@@ -23,7 +23,7 @@ define i32 @crc32_16(i32 %a, i16 %b) nounwind {
 ; X32:     crc32w   8(%esp), %eax
 
 ; X64: _crc32_16:
-; X64:     crc32w   %si, %eax
+; X64:     crc32w   %si,
 }
 
 
@@ -34,5 +34,5 @@ define i32 @crc32_32(i32 %a, i32 %b) nounwind {
 ; X32:     crc32l   8(%esp), %eax
 
 ; X64: _crc32_32:
-; X64:     crc32l   %esi, %eax
+; X64:     crc32l   %esi,
 }
index 77710ad56bae99963aa0ef063f6ee034854f4988..d6c16ca0078e66d828a19c8d564fd7c33a65a8c1 100644 (file)
@@ -412,9 +412,9 @@ return:
 ; can fall-through into the ret and the other side has to branch anyway.
 
 ; CHECK: TESTE:
-; CHECK: imulq
-; CHECK-NEXT: LBB8_2:
-; CHECK-NEXT: ret
+; CHECK: ret
+; CHECK-NOT: ret
+; CHECK: size TESTE
 
 define i64 @TESTE(i64 %parami, i64 %paraml) nounwind readnone {
 entry:
index 8fbbd397b8af289af69fda6431abcde9b33da489..a0448ecee4fa18f609d3af19022fb2dc5ed7f444 100644 (file)
@@ -7,10 +7,10 @@
 ; Use the flags on the add.
 
 ; CHECK: test1:
-;      CHECK: addl    (%r[[A0:di|cx]]), {{%esi|%edx}}
-; CHECK-NEXT: movl    {{%edx|%r8d}}, %eax
-; CHECK-NEXT: cmovnsl {{%ecx|%r9d}}, %eax
-; CHECK-NEXT: ret
+;     CHECK: addl
+; CHECK-NOT: test
+;     CHECK: cmovnsl
+;     CHECK: ret
 
 define i32 @test1(i32* %x, i32 %y, i32 %a, i32 %b) nounwind {
        %tmp2 = load i32* %x, align 4           ; <i32> [#uses=1]
@@ -42,7 +42,7 @@ false:
 ; Do use the flags result of the and here, since the and has another use.
 
 ; CHECK: test3:
-;      CHECK: andl    $16, %e[[A0]]
+;      CHECK: andl    $16, %e
 ; CHECK-NEXT: jne
 
 define void @test3(i32 %x) nounwind {
index 2ee87fe4ff8604867c31e5beef4695d9ddfe84bd..06f38ed842723fbd738810e0ead1175a1e5accb3 100644 (file)
@@ -1,8 +1,9 @@
 ; RUN: llc < %s -march=x86 -mattr=+sse,-sse2 -mtriple=i386-apple-darwin | FileCheck %s -check-prefix=sse
 ; RUN: llc < %s -march=x86 -mattr=+sse2 -mtriple=i386-apple-darwin | FileCheck %s -check-prefix=sse2
 
+; sse:  t1:
+; sse2: t1:
 define <4 x float> @t1(<4 x float> %a, <4 x float> %b) nounwind  {
-; sse: movaps
 ; sse: shufps
 ; sse2: pshufd
 ; sse2-NEXT: ret
@@ -10,6 +11,8 @@ define <4 x float> @t1(<4 x float> %a, <4 x float> %b) nounwind  {
         ret <4 x float> %tmp1
 }
 
+; sse:  t2:
+; sse2: t2:
 define <4 x float> @t2(<4 x float> %A, <4 x float> %B) nounwind {
 ; sse: shufps
 ; sse2: pshufd
@@ -18,8 +21,9 @@ define <4 x float> @t2(<4 x float> %A, <4 x float> %B) nounwind {
        ret <4 x float> %tmp
 }
 
+; sse:  t3:
+; sse2: t3:
 define <4 x float> @t3(<4 x float> %A, <4 x float> %B) nounwind {
-; sse: movaps
 ; sse: shufps
 ; sse2: pshufd
 ; sse2-NEXT: ret
@@ -27,7 +31,10 @@ define <4 x float> @t3(<4 x float> %A, <4 x float> %B) nounwind {
        ret <4 x float> %tmp
 }
 
+; sse:  t4:
+; sse2: t4:
 define <4 x float> @t4(<4 x float> %A, <4 x float> %B) nounwind {
+
 ; sse: shufps
 ; sse2: pshufd
 ; sse2-NEXT: ret
index cbd38da60e9604923f05790e7ae0802832164412..566501cda93eb1d1557f2e6af7157c78e320f2c5 100644 (file)
@@ -1,9 +1,12 @@
-; RUN: llc < %s -mtriple=x86_64-mingw32     | FileCheck %s -check-prefix=M64
-; RUN: llc < %s -mtriple=x86_64-win32       | FileCheck %s -check-prefix=W64
-; RUN: llc < %s -mtriple=x86_64-win32-macho | FileCheck %s -check-prefix=EFI
+; RUN: llc < %s -join-physregs -mtriple=x86_64-mingw32     | FileCheck %s -check-prefix=M64
+; RUN: llc < %s -join-physregs -mtriple=x86_64-win32       | FileCheck %s -check-prefix=W64
+; RUN: llc < %s -join-physregs -mtriple=x86_64-win32-macho | FileCheck %s -check-prefix=EFI
 ; PR8777
 ; PR8778
 
+; Passing the same value in two registers creates a false interference that
+; only -join-physregs resolves. It could also be handled by a parallel copy.
+
 define i64 @foo(i64 %n, i64 %x) nounwind {
 entry:
 
index 2465f23a7689a845339232d21427327cd937cb1b..07ccb2337e752a2f615b1fed2992eb06dce895a2 100644 (file)
@@ -39,7 +39,7 @@ define void @ccc(i64 %x) nounwind {
 
 ; This requires a mov and a 64-bit and.
 ; CHECK: ddd:
-; CHECK: movabsq $4294967296, %rax
+; CHECK: movabsq $4294967296, %r
 ; CHECK: andq %rax, %rdi
 
 define void @ddd(i64 %x) nounwind {