Skip to content

Commit 0b7669f

Browse files
committed
[X86] Introduce more common modern tunings into generic
GCC has updated its generic `-mtune` to haswell. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81616 Update it to match with GCC. Reviewed By: spatel Differential Revision: https://reviews.llvm.org/D118534
1 parent 997f2a5 commit 0b7669f

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

llvm/lib/Target/X86/X86.td

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1213,12 +1213,16 @@ class ProcModel<string Name, SchedMachineModel Model,
12131213
// NOTE: 64Bit is here as "generic" is the default llc CPU. The X86Subtarget
12141214
// constructor checks that any CPU used in 64-bit mode has Feature64Bit enabled.
12151215
// It has no effect on code generation.
1216+
// NOTE: As a default tuning, "generic" aims to produce code optimized for the
1217+
// most common X86 processors. The tunings might be changed over time. It is
1218+
// recommended to use "x86-64" in lit tests for consistency.
12161219
def : ProcModel<"generic", SandyBridgeModel,
12171220
[FeatureX87, FeatureCMPXCHG8B, Feature64Bit],
12181221
[TuningSlow3OpsLEA,
12191222
TuningSlowDivide64,
1220-
TuningSlowIncDec,
12211223
TuningMacroFusion,
1224+
TuningFastScalarFSQRT,
1225+
TuningFast15ByteNOP,
12221226
TuningInsertVZEROUPPER]>;
12231227

12241228
def : Proc<"i386", [FeatureX87],

llvm/test/CodeGen/X86/segmented-stacks-dynamic.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ define i32 @test_basic(i32 %l) #0 {
4747
; X86-NEXT: testl %esi, %esi
4848
; X86-NEXT: je .LBB0_6
4949
; X86-NEXT: # %bb.8: # %false
50-
; X86-NEXT: addl $-1, %esi
50+
; X86-NEXT: decl %esi
5151
; X86-NEXT: subl $12, %esp
5252
; X86-NEXT: pushl %esi
5353
; X86-NEXT: calll test_basic@PLT
@@ -103,7 +103,7 @@ define i32 @test_basic(i32 %l) #0 {
103103
; X64-NEXT: testl %ebx, %ebx
104104
; X64-NEXT: je .LBB0_6
105105
; X64-NEXT: # %bb.8: # %false
106-
; X64-NEXT: addl $-1, %ebx
106+
; X64-NEXT: decl %ebx
107107
; X64-NEXT: movl %ebx, %edi
108108
; X64-NEXT: callq test_basic@PLT
109109
; X64-NEXT: jmp .LBB0_7
@@ -157,7 +157,7 @@ define i32 @test_basic(i32 %l) #0 {
157157
; X32ABI-NEXT: testl %ebx, %ebx
158158
; X32ABI-NEXT: je .LBB0_6
159159
; X32ABI-NEXT: # %bb.8: # %false
160-
; X32ABI-NEXT: addl $-1, %ebx
160+
; X32ABI-NEXT: decl %ebx
161161
; X32ABI-NEXT: movl %ebx, %edi
162162
; X32ABI-NEXT: callq test_basic@PLT
163163
; X32ABI-NEXT: jmp .LBB0_7

llvm/test/CodeGen/X86/twoaddr-lea.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ define void @ham() {
108108
; CHECK-NEXT: jne LBB3_9
109109
; CHECK-NEXT: ## %bb.5: ## %bb5
110110
; CHECK-NEXT: ## in Loop: Header=BB3_4 Depth=2
111-
; CHECK-NEXT: addq $1, %rdx
111+
; CHECK-NEXT: incq %rdx
112112
; CHECK-NEXT: cmpq %rcx, %rdx
113113
; CHECK-NEXT: jl LBB3_4
114114
; CHECK-NEXT: jmp LBB3_3

llvm/test/MC/X86/x86-directive-nops-errors.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# RUN: not llvm-mc -triple i386 %s -filetype=obj -o /dev/null 2>&1 | FileCheck --check-prefix=X86 %s
2-
# RUN: not llvm-mc -triple=x86_64 %s -filetype=obj -o /dev/null 2>&1 | FileCheck --check-prefix=X64 %s
2+
# RUN: not llvm-mc -triple=x86_64 -mcpu=x86-64 %s -filetype=obj -o /dev/null 2>&1 | FileCheck --check-prefix=X64 %s
33

44
.nops 4, 3
55
# X86: :[[@LINE-1]]:1: error: illegal NOP size 3.

0 commit comments

Comments
 (0)