Skip to content

Commit 1650e4a

Browse files
[X86] Remove TuningPOPCNTFalseDeps from AlderLake (#154004)
This false dependency issue was fixed in CannonLake looking at the data from uops.info. This is confirmed not to be an issue based on benchmarking data in #153983. Setting this can potentially lead to extra xor instructions whihc could consume extra frontend/renaming resources. None of the other CPUs that have had this fixed have the tuning flag. Fixes #153983.
1 parent f84aaa6 commit 1650e4a

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

llvm/lib/Target/X86/X86.td

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1291,7 +1291,9 @@ def ProcessorFeatures {
12911291
list<SubtargetFeature> ADLAdditionalTuning = [TuningPERMFalseDeps,
12921292
TuningPreferMovmskOverVTest,
12931293
TuningFastImmVectorShift];
1294-
list<SubtargetFeature> ADLTuning = !listconcat(SKLTuning, ADLAdditionalTuning);
1294+
list<SubtargetFeature> ADLRemoveTuning = [TuningPOPCNTFalseDeps];
1295+
list<SubtargetFeature> ADLTuning =
1296+
!listremove(!listconcat(SKLTuning, ADLAdditionalTuning), ADLRemoveTuning);
12951297
list<SubtargetFeature> ADLFeatures =
12961298
!listconcat(TRMFeatures, ADLAdditionalFeatures);
12971299

llvm/test/CodeGen/X86/bitcnt-false-dep.ll

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=haswell | FileCheck %s --check-prefix=HSW
22
; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=skylake | FileCheck %s --check-prefix=SKL
33
; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=skx | FileCheck %s --check-prefix=SKL
4+
; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=alderlake | FileCheck %s --check-prefix=ADL
45
; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=silvermont -mattr=+lzcnt,+bmi | FileCheck %s --check-prefix=SKL
56
; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=goldmont -mattr=+lzcnt,+bmi | FileCheck %s --check-prefix=SKL
67

@@ -37,6 +38,10 @@ ret:
3738
;SKL-LABEL:@loopdep_popcnt32
3839
;SKL: xorl [[GPR0:%e[a-d]x]], [[GPR0]]
3940
;SKL-NEXT: popcntl {{.*}}, [[GPR0]]
41+
42+
;ADL-LABEL:@loopdep_popcnt32
43+
;ADL-NOT: xor
44+
;ADL: popcntl
4045
}
4146

4247
define i64 @loopdep_popcnt64(ptr nocapture %x, ptr nocapture %y) nounwind {
@@ -63,6 +68,10 @@ ret:
6368
;SKL-LABEL:@loopdep_popcnt64
6469
;SKL: xorl %e[[GPR0:[a-d]x]], %e[[GPR0]]
6570
;SKL-NEXT: popcntq {{.*}}, %r[[GPR0]]
71+
72+
;ADL-LABEL:@loopdep_popcnt64
73+
;ADL-NOT: xor
74+
;ADL: popcntq
6675
}
6776

6877
define i32 @loopdep_tzct32(ptr nocapture %x, ptr nocapture %y) nounwind {

0 commit comments

Comments
 (0)