Skip to content

Commit 369bddf

Browse files
committed
Fix a batch of x86 tests to be coalescer independent.
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. llvm-svn: 130891
1 parent d4a8ced commit 369bddf

File tree

7 files changed

+38
-29
lines changed

7 files changed

+38
-29
lines changed

llvm/test/CodeGen/X86/sse3.ll

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,10 @@ define <8 x i16> @t4(<8 x i16> %A, <8 x i16> %B) nounwind {
6262
%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 >
6363
ret <8 x i16> %tmp
6464
; X64: t4:
65-
; X64: pextrw $7, %xmm0, %eax
66-
; X64: pshufhw $100, %xmm0, %xmm1
67-
; X64: pinsrw $1, %eax, %xmm1
68-
; X64: pextrw $1, %xmm0, %eax
69-
; X64: movdqa %xmm1, %xmm0
65+
; X64: pextrw $7, [[XMM0:%xmm[0-9]+]], %eax
66+
; X64: pshufhw $100, [[XMM0]], [[XMM1:%xmm[0-9]+]]
67+
; X64: pinsrw $1, %eax, [[XMM1]]
68+
; X64: pextrw $1, [[XMM0]], %eax
7069
; X64: pinsrw $4, %eax, %xmm0
7170
; X64: ret
7271
}
@@ -251,13 +250,13 @@ entry:
251250
%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 >
252251
ret <16 x i8> %tmp9
253252
; X64: t16:
254-
; X64: pinsrw $0, %eax, %xmm1
255-
; X64: pextrw $8, %xmm0, %eax
256-
; X64: pinsrw $1, %eax, %xmm1
257-
; X64: pextrw $1, %xmm1, %ecx
258-
; X64: movd %xmm1, %edx
259-
; X64: pinsrw $0, %edx, %xmm1
260-
; X64: pinsrw $1, %eax, %xmm0
253+
; X64: pinsrw $0, %eax, [[X1:%xmm[0-9]+]]
254+
; X64: pextrw $8, [[X0:%xmm[0-9]+]], %eax
255+
; X64: pinsrw $1, %eax, [[X1]]
256+
; X64: pextrw $1, [[X1]], %ecx
257+
; X64: movd [[X1]], %edx
258+
; X64: pinsrw $0, %edx, %xmm
259+
; X64: pinsrw $1, %eax, %xmm
261260
; X64: ret
262261
}
263262

llvm/test/CodeGen/X86/sse42.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ define i32 @crc32_8(i32 %a, i8 %b) nounwind {
1212
; X32: crc32b 8(%esp), %eax
1313

1414
; X64: _crc32_8:
15-
; X64: crc32b %sil, %eax
15+
; X64: crc32b %sil,
1616
}
1717

1818

@@ -23,7 +23,7 @@ define i32 @crc32_16(i32 %a, i16 %b) nounwind {
2323
; X32: crc32w 8(%esp), %eax
2424

2525
; X64: _crc32_16:
26-
; X64: crc32w %si, %eax
26+
; X64: crc32w %si,
2727
}
2828

2929

@@ -34,5 +34,5 @@ define i32 @crc32_32(i32 %a, i32 %b) nounwind {
3434
; X32: crc32l 8(%esp), %eax
3535

3636
; X64: _crc32_32:
37-
; X64: crc32l %esi, %eax
37+
; X64: crc32l %esi,
3838
}

llvm/test/CodeGen/X86/tail-opts.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -412,9 +412,9 @@ return:
412412
; can fall-through into the ret and the other side has to branch anyway.
413413

414414
; CHECK: TESTE:
415-
; CHECK: imulq
416-
; CHECK-NEXT: LBB8_2:
417-
; CHECK-NEXT: ret
415+
; CHECK: ret
416+
; CHECK-NOT: ret
417+
; CHECK: size TESTE
418418

419419
define i64 @TESTE(i64 %parami, i64 %paraml) nounwind readnone {
420420
entry:

llvm/test/CodeGen/X86/use-add-flags.ll

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
; Use the flags on the add.
88

99
; CHECK: test1:
10-
; CHECK: addl (%r[[A0:di|cx]]), {{%esi|%edx}}
11-
; CHECK-NEXT: movl {{%edx|%r8d}}, %eax
12-
; CHECK-NEXT: cmovnsl {{%ecx|%r9d}}, %eax
13-
; CHECK-NEXT: ret
10+
; CHECK: addl
11+
; CHECK-NOT: test
12+
; CHECK: cmovnsl
13+
; CHECK: ret
1414

1515
define i32 @test1(i32* %x, i32 %y, i32 %a, i32 %b) nounwind {
1616
%tmp2 = load i32* %x, align 4 ; <i32> [#uses=1]
@@ -42,7 +42,7 @@ false:
4242
; Do use the flags result of the and here, since the and has another use.
4343

4444
; CHECK: test3:
45-
; CHECK: andl $16, %e[[A0]]
45+
; CHECK: andl $16, %e
4646
; CHECK-NEXT: jne
4747

4848
define void @test3(i32 %x) nounwind {

llvm/test/CodeGen/X86/vec_shuffle-16.ll

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
; RUN: llc < %s -march=x86 -mattr=+sse,-sse2 -mtriple=i386-apple-darwin | FileCheck %s -check-prefix=sse
22
; RUN: llc < %s -march=x86 -mattr=+sse2 -mtriple=i386-apple-darwin | FileCheck %s -check-prefix=sse2
33

4+
; sse: t1:
5+
; sse2: t1:
46
define <4 x float> @t1(<4 x float> %a, <4 x float> %b) nounwind {
5-
; sse: movaps
67
; sse: shufps
78
; sse2: pshufd
89
; sse2-NEXT: ret
910
%tmp1 = shufflevector <4 x float> %b, <4 x float> undef, <4 x i32> zeroinitializer
1011
ret <4 x float> %tmp1
1112
}
1213

14+
; sse: t2:
15+
; sse2: t2:
1316
define <4 x float> @t2(<4 x float> %A, <4 x float> %B) nounwind {
1417
; sse: shufps
1518
; sse2: pshufd
@@ -18,16 +21,20 @@ define <4 x float> @t2(<4 x float> %A, <4 x float> %B) nounwind {
1821
ret <4 x float> %tmp
1922
}
2023

24+
; sse: t3:
25+
; sse2: t3:
2126
define <4 x float> @t3(<4 x float> %A, <4 x float> %B) nounwind {
22-
; sse: movaps
2327
; sse: shufps
2428
; sse2: pshufd
2529
; sse2-NEXT: ret
2630
%tmp = shufflevector <4 x float> %A, <4 x float> %B, <4 x i32> < i32 4, i32 4, i32 4, i32 4 >
2731
ret <4 x float> %tmp
2832
}
2933

34+
; sse: t4:
35+
; sse2: t4:
3036
define <4 x float> @t4(<4 x float> %A, <4 x float> %B) nounwind {
37+
3138
; sse: shufps
3239
; sse2: pshufd
3340
; sse2-NEXT: ret

llvm/test/CodeGen/X86/win64_alloca_dynalloca.ll

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
; RUN: llc < %s -mtriple=x86_64-mingw32 | FileCheck %s -check-prefix=M64
2-
; RUN: llc < %s -mtriple=x86_64-win32 | FileCheck %s -check-prefix=W64
3-
; RUN: llc < %s -mtriple=x86_64-win32-macho | FileCheck %s -check-prefix=EFI
1+
; RUN: llc < %s -join-physregs -mtriple=x86_64-mingw32 | FileCheck %s -check-prefix=M64
2+
; RUN: llc < %s -join-physregs -mtriple=x86_64-win32 | FileCheck %s -check-prefix=W64
3+
; RUN: llc < %s -join-physregs -mtriple=x86_64-win32-macho | FileCheck %s -check-prefix=EFI
44
; PR8777
55
; PR8778
66

7+
; Passing the same value in two registers creates a false interference that
8+
; only -join-physregs resolves. It could also be handled by a parallel copy.
9+
710
define i64 @foo(i64 %n, i64 %x) nounwind {
811
entry:
912

llvm/test/CodeGen/X86/x86-64-and-mask.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ define void @ccc(i64 %x) nounwind {
3939

4040
; This requires a mov and a 64-bit and.
4141
; CHECK: ddd:
42-
; CHECK: movabsq $4294967296, %rax
42+
; CHECK: movabsq $4294967296, %r
4343
; CHECK: andq %rax, %rdi
4444

4545
define void @ddd(i64 %x) nounwind {

0 commit comments

Comments
 (0)