Skip to content

Commit 6bba958

Browse files
committed
[X86] Change the scheduler model for 'pentium4' to SandyBridgeModel.
I meant to do this in D83913, but missed it while updating the feature list. Interestingly I think this is disabling the postRA scheduler. But it does match our default 64-bit behavior. Reviewed By: echristo Differential Revision: https://reviews.llvm.org/D83996
1 parent addbf73 commit 6bba958

7 files changed

Lines changed: 71 additions & 47 deletions

File tree

‎llvm/lib/Target/X86/X86.td‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1080,7 +1080,7 @@ foreach P = ["pentium4", "pentium4m"] in {
10801080
// Since 'pentium4' is the default 32-bit CPU on Linux and Windows,
10811081
// give it more modern tunings.
10821082
// FIXME: This wouldn't be needed if we supported mtune.
1083-
def : ProcessorModel<P, GenericPostRAModel,
1083+
def : ProcessorModel<P, SandyBridgeModel,
10841084
[FeatureX87, FeatureCMPXCHG8B,
10851085
FeatureMMX, FeatureSSE2, FeatureFXSR, FeatureNOPL,
10861086
FeatureCMOV, FeatureInsertVZEROUPPER,

‎llvm/test/CodeGen/X86/cfguard-x86-vectorcall.ll‎

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,35 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --no_x86_scrub_rip
12
; RUN: llc < %s -mtriple=i686-pc-windows-msvc | FileCheck %s -check-prefix=X32
23
; Control Flow Guard is currently only available on Windows
34

45

56
; Test that Control Flow Guard checks are correctly added for x86 vector calls.
67
define void @func_cf_vector_x86(void (%struct.HVA)* %0, %struct.HVA* %1) #0 {
8+
; X32-LABEL: func_cf_vector_x86:
9+
; X32: # %bb.0: # %entry
10+
; X32-NEXT: pushl %ebp
11+
; X32-NEXT: movl %esp, %ebp
12+
; X32-NEXT: andl $-16, %esp
13+
; X32-NEXT: subl $48, %esp
14+
; X32-NEXT: movl 8(%ebp), %ecx
15+
; X32-NEXT: movl 12(%ebp), %eax
16+
; X32-NEXT: movups (%eax), %xmm0
17+
; X32-NEXT: movups 16(%eax), %xmm1
18+
; X32-NEXT: movaps %xmm0, (%esp)
19+
; X32-NEXT: movaps %xmm1, 16(%esp)
20+
; X32-NEXT: movsd (%esp), %xmm4
21+
; X32-NEXT: movsd 8(%esp), %xmm5
22+
; X32-NEXT: movsd 16(%esp), %xmm6
23+
; X32-NEXT: movsd 24(%esp), %xmm7
24+
; X32-NEXT: calll *___guard_check_icall_fptr
25+
; X32-NEXT: movaps %xmm4, %xmm0
26+
; X32-NEXT: movaps %xmm5, %xmm1
27+
; X32-NEXT: movaps %xmm6, %xmm2
28+
; X32-NEXT: movaps %xmm7, %xmm3
29+
; X32-NEXT: calll *%ecx
30+
; X32-NEXT: movl %ebp, %esp
31+
; X32-NEXT: popl %ebp
32+
; X32-NEXT: retl
733
entry:
834
%2 = alloca %struct.HVA, align 8
935
%3 = bitcast %struct.HVA* %2 to i8*
@@ -13,23 +39,6 @@ entry:
1339
call x86_vectorcallcc void %0(%struct.HVA inreg %5)
1440
ret void
1541

16-
; X32-LABEL: func_cf_vector_x86
17-
; X32: movl 12(%ebp), %eax
18-
; X32: movl 8(%ebp), %ecx
19-
; X32: movups (%eax), %xmm0
20-
; X32: movups 16(%eax), %xmm1
21-
; X32: movaps %xmm0, (%esp)
22-
; X32: movaps %xmm1, 16(%esp)
23-
; X32: movsd (%esp), %xmm4
24-
; X32: movsd 8(%esp), %xmm5
25-
; X32: movsd 16(%esp), %xmm6
26-
; X32: movsd 24(%esp), %xmm7
27-
; X32: calll *___guard_check_icall_fptr
28-
; X32: movaps %xmm4, %xmm0
29-
; X32: movaps %xmm5, %xmm1
30-
; X32: movaps %xmm6, %xmm2
31-
; X32: movaps %xmm7, %xmm3
32-
; X32: calll *%ecx
3342
}
3443
attributes #0 = { "target-cpu"="pentium4" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" }
3544

‎llvm/test/CodeGen/X86/cmov-fp.ll‎

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,11 +1056,11 @@ define float @test16(i32 %a, i32 %b, float %x) nounwind {
10561056
define x86_fp80 @test17(i32 %a, i32 %b, x86_fp80 %x) nounwind {
10571057
; SSE-LABEL: test17:
10581058
; SSE: # %bb.0:
1059-
; SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
10601059
; SSE-NEXT: fldt {{[0-9]+}}(%esp)
1060+
; SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
1061+
; SSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
10611062
; SSE-NEXT: flds {{\.LCPI.*}}
10621063
; SSE-NEXT: fxch %st(1)
1063-
; SSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
10641064
; SSE-NEXT: fcmovnbe %st(1), %st
10651065
; SSE-NEXT: fstp %st(1)
10661066
; SSE-NEXT: retl
@@ -1109,11 +1109,11 @@ define x86_fp80 @test17(i32 %a, i32 %b, x86_fp80 %x) nounwind {
11091109
define x86_fp80 @test18(i32 %a, i32 %b, x86_fp80 %x) nounwind {
11101110
; SSE-LABEL: test18:
11111111
; SSE: # %bb.0:
1112-
; SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
11131112
; SSE-NEXT: fldt {{[0-9]+}}(%esp)
1113+
; SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
1114+
; SSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
11141115
; SSE-NEXT: flds {{\.LCPI.*}}
11151116
; SSE-NEXT: fxch %st(1)
1116-
; SSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
11171117
; SSE-NEXT: fcmovnb %st(1), %st
11181118
; SSE-NEXT: fstp %st(1)
11191119
; SSE-NEXT: retl
@@ -1162,11 +1162,11 @@ define x86_fp80 @test18(i32 %a, i32 %b, x86_fp80 %x) nounwind {
11621162
define x86_fp80 @test19(i32 %a, i32 %b, x86_fp80 %x) nounwind {
11631163
; SSE-LABEL: test19:
11641164
; SSE: # %bb.0:
1165-
; SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
11661165
; SSE-NEXT: fldt {{[0-9]+}}(%esp)
1166+
; SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
1167+
; SSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
11671168
; SSE-NEXT: flds {{\.LCPI.*}}
11681169
; SSE-NEXT: fxch %st(1)
1169-
; SSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
11701170
; SSE-NEXT: fcmovb %st(1), %st
11711171
; SSE-NEXT: fstp %st(1)
11721172
; SSE-NEXT: retl
@@ -1215,11 +1215,11 @@ define x86_fp80 @test19(i32 %a, i32 %b, x86_fp80 %x) nounwind {
12151215
define x86_fp80 @test20(i32 %a, i32 %b, x86_fp80 %x) nounwind {
12161216
; SSE-LABEL: test20:
12171217
; SSE: # %bb.0:
1218-
; SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
12191218
; SSE-NEXT: fldt {{[0-9]+}}(%esp)
1219+
; SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
1220+
; SSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
12201221
; SSE-NEXT: flds {{\.LCPI.*}}
12211222
; SSE-NEXT: fxch %st(1)
1222-
; SSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
12231223
; SSE-NEXT: fcmovbe %st(1), %st
12241224
; SSE-NEXT: fstp %st(1)
12251225
; SSE-NEXT: retl
@@ -1268,13 +1268,13 @@ define x86_fp80 @test20(i32 %a, i32 %b, x86_fp80 %x) nounwind {
12681268
define x86_fp80 @test21(i32 %a, i32 %b, x86_fp80 %x) nounwind {
12691269
; SSE-LABEL: test21:
12701270
; SSE: # %bb.0:
1271-
; SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
12721271
; SSE-NEXT: fldt {{[0-9]+}}(%esp)
1273-
; SSE-NEXT: flds {{\.LCPI.*}}
1274-
; SSE-NEXT: fxch %st(1)
1272+
; SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
12751273
; SSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
12761274
; SSE-NEXT: setg %al
12771275
; SSE-NEXT: testb %al, %al
1276+
; SSE-NEXT: flds {{\.LCPI.*}}
1277+
; SSE-NEXT: fxch %st(1)
12781278
; SSE-NEXT: fcmovne %st(1), %st
12791279
; SSE-NEXT: fstp %st(1)
12801280
; SSE-NEXT: retl
@@ -1328,13 +1328,13 @@ define x86_fp80 @test21(i32 %a, i32 %b, x86_fp80 %x) nounwind {
13281328
define x86_fp80 @test22(i32 %a, i32 %b, x86_fp80 %x) nounwind {
13291329
; SSE-LABEL: test22:
13301330
; SSE: # %bb.0:
1331-
; SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
13321331
; SSE-NEXT: fldt {{[0-9]+}}(%esp)
1333-
; SSE-NEXT: flds {{\.LCPI.*}}
1334-
; SSE-NEXT: fxch %st(1)
1332+
; SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
13351333
; SSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
13361334
; SSE-NEXT: setge %al
13371335
; SSE-NEXT: testb %al, %al
1336+
; SSE-NEXT: flds {{\.LCPI.*}}
1337+
; SSE-NEXT: fxch %st(1)
13381338
; SSE-NEXT: fcmovne %st(1), %st
13391339
; SSE-NEXT: fstp %st(1)
13401340
; SSE-NEXT: retl
@@ -1387,13 +1387,13 @@ define x86_fp80 @test22(i32 %a, i32 %b, x86_fp80 %x) nounwind {
13871387
define x86_fp80 @test23(i32 %a, i32 %b, x86_fp80 %x) nounwind {
13881388
; SSE-LABEL: test23:
13891389
; SSE: # %bb.0:
1390-
; SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
13911390
; SSE-NEXT: fldt {{[0-9]+}}(%esp)
1392-
; SSE-NEXT: flds {{\.LCPI.*}}
1393-
; SSE-NEXT: fxch %st(1)
1391+
; SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
13941392
; SSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
13951393
; SSE-NEXT: setl %al
13961394
; SSE-NEXT: testb %al, %al
1395+
; SSE-NEXT: flds {{\.LCPI.*}}
1396+
; SSE-NEXT: fxch %st(1)
13971397
; SSE-NEXT: fcmovne %st(1), %st
13981398
; SSE-NEXT: fstp %st(1)
13991399
; SSE-NEXT: retl
@@ -1446,13 +1446,13 @@ define x86_fp80 @test23(i32 %a, i32 %b, x86_fp80 %x) nounwind {
14461446
define x86_fp80 @test24(i32 %a, i32 %b, x86_fp80 %x) nounwind {
14471447
; SSE-LABEL: test24:
14481448
; SSE: # %bb.0:
1449-
; SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
14501449
; SSE-NEXT: fldt {{[0-9]+}}(%esp)
1451-
; SSE-NEXT: flds {{\.LCPI.*}}
1452-
; SSE-NEXT: fxch %st(1)
1450+
; SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
14531451
; SSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
14541452
; SSE-NEXT: setle %al
14551453
; SSE-NEXT: testb %al, %al
1454+
; SSE-NEXT: flds {{\.LCPI.*}}
1455+
; SSE-NEXT: fxch %st(1)
14561456
; SSE-NEXT: fcmovne %st(1), %st
14571457
; SSE-NEXT: fstp %st(1)
14581458
; SSE-NEXT: retl

‎llvm/test/CodeGen/X86/post-ra-sched.ll‎

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
; RUN: llc < %s -mtriple=i386 -mcpu=pentium4 | FileCheck %s
2-
; RUN: llc < %s -mtriple=i386 -mcpu=pentium4m | FileCheck %s
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2+
; RUN: llc < %s -mtriple=i386 -mcpu=pentium4 | FileCheck %s --check-prefix=PENTIUM4
3+
; RUN: llc < %s -mtriple=i386 -mcpu=pentium4m | FileCheck %s --check-prefix=PENTIUM4
34
; RUN: llc < %s -mtriple=i386 -mcpu=pentium-m | FileCheck %s
45
; RUN: llc < %s -mtriple=i386 -mcpu=prescott | FileCheck %s
56
; RUN: llc < %s -mtriple=i386 -mcpu=nocona | FileCheck %s
@@ -9,12 +10,26 @@
910
; happens during the post-RA-scheduler, which should be enabled by
1011
; default with the above specified cpus.
1112

13+
; Pentium4 is the default 32-bit CPU on Linux and currently has the postRA
14+
; scheduler disabled. Leaving the command lines in place in case we change that.
15+
1216
@ptrs = external global [0 x i32*], align 4
1317
@idxa = common global i32 0, align 4
1418
@idxb = common global i32 0, align 4
1519
@res = common global i32 0, align 4
1620

1721
define void @addindirect() {
22+
; PENTIUM4-LABEL: addindirect:
23+
; PENTIUM4: # %bb.0: # %entry
24+
; PENTIUM4-NEXT: movl idxa, %eax
25+
; PENTIUM4-NEXT: movl ptrs(,%eax,4), %eax
26+
; PENTIUM4-NEXT: movl idxb, %ecx
27+
; PENTIUM4-NEXT: movl ptrs(,%ecx,4), %ecx
28+
; PENTIUM4-NEXT: movl (%ecx), %ecx
29+
; PENTIUM4-NEXT: addl (%eax), %ecx
30+
; PENTIUM4-NEXT: movl %ecx, res
31+
; PENTIUM4-NEXT: retl
32+
;
1833
; CHECK-LABEL: addindirect:
1934
; CHECK: # %bb.0: # %entry
2035
; CHECK-NEXT: movl idxb, %ecx

‎llvm/test/CodeGen/X86/pr34088.ll‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
%struct.Buffer = type { i8*, i32 }
77

88
; This test checks that the load of store %2 is not dropped.
9-
;
9+
;
1010
define i32 @pr34088() local_unnamed_addr {
1111
; CHECK-LABEL: pr34088:
1212
; CHECK: # %bb.0: # %entry
@@ -18,13 +18,13 @@ define i32 @pr34088() local_unnamed_addr {
1818
; CHECK-NEXT: andl $-16, %esp
1919
; CHECK-NEXT: subl $32, %esp
2020
; CHECK-NEXT: xorps %xmm0, %xmm0
21-
; CHECK-NEXT: movaps {{.*#+}} xmm1 = [205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205]
22-
; CHECK-NEXT: xorl %eax, %eax
2321
; CHECK-NEXT: movaps %xmm0, (%esp)
2422
; CHECK-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
25-
; CHECK-NEXT: movl $-842150451, {{[0-9]+}}(%esp) # imm = 0xCDCDCDCD
23+
; CHECK-NEXT: movaps {{.*#+}} xmm1 = [205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205]
2624
; CHECK-NEXT: movaps %xmm1, (%esp)
25+
; CHECK-NEXT: movl $-842150451, {{[0-9]+}}(%esp) # imm = 0xCDCDCDCD
2726
; CHECK-NEXT: movsd %xmm0, {{[0-9]+}}(%esp)
27+
; CHECK-NEXT: xorl %eax, %eax
2828
; CHECK-NEXT: movl %ebp, %esp
2929
; CHECK-NEXT: popl %ebp
3030
; CHECK-NEXT: .cfi_def_cfa %esp, 4

‎llvm/test/CodeGen/X86/pr40539.ll‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ define zeroext i1 @_Z8test_cosv() {
4040
; CHECK-NEXT: subl $8, %esp
4141
; CHECK-NEXT: .cfi_def_cfa_offset 12
4242
; CHECK-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
43-
; CHECK-NEXT: movss {{.*#+}} xmm1 = mem[0],zero,zero,zero
4443
; CHECK-NEXT: divss {{\.LCPI.*}}, %xmm0
4544
; CHECK-NEXT: movss %xmm0, {{[0-9]+}}(%esp)
4645
; CHECK-NEXT: flds {{[0-9]+}}(%esp)
@@ -49,6 +48,7 @@ define zeroext i1 @_Z8test_cosv() {
4948
; CHECK-NEXT: #NO_APP
5049
; CHECK-NEXT: fstps (%esp)
5150
; CHECK-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
51+
; CHECK-NEXT: movss {{.*#+}} xmm1 = mem[0],zero,zero,zero
5252
; CHECK-NEXT: ucomiss %xmm0, %xmm1
5353
; CHECK-NEXT: setae %cl
5454
; CHECK-NEXT: ucomiss {{\.LCPI.*}}, %xmm0

‎llvm/test/DebugInfo/COFF/fpo-stack-protect.ll‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
; CHECK: subl $20, %esp
1616
; CHECK: .cv_fpo_stackalloc 20
1717
; CHECK: .cv_fpo_endprologue
18+
; CHECK: movl 28(%esp), %esi
1819
; CHECK: ___security_cookie
1920

20-
; CHECK: movl 28(%esp), %esi
2121
; CHECK: movl %esi, {{[0-9]*}}(%esp)
2222
; CHECK: movl %esi, {{[0-9]*}}(%esp)
2323
; CHECK: movl %esi, {{[0-9]*}}(%esp)
@@ -30,7 +30,7 @@
3030
; CHECK: addl $20, %esp
3131
; CHECK: popl %esi
3232
; CHECK: retl
33-
; CHECK: Ltmp3:
33+
; CHECK: Ltmp2:
3434
; CHECK: .cv_fpo_endproc
3535

3636
; ModuleID = 't.c'

0 commit comments

Comments
 (0)