Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion llvm/lib/Target/X86/X86.td
Original file line number Diff line number Diff line change
Expand Up @@ -1291,7 +1291,9 @@ def ProcessorFeatures {
list<SubtargetFeature> ADLAdditionalTuning = [TuningPERMFalseDeps,
TuningPreferMovmskOverVTest,
TuningFastImmVectorShift];
list<SubtargetFeature> ADLTuning = !listconcat(SKLTuning, ADLAdditionalTuning);
list<SubtargetFeature> ADLRemoveTuning = [TuningPOPCNTFalseDeps];
list<SubtargetFeature> ADLTuning =
!listremove(!listconcat(SKLTuning, ADLAdditionalTuning), ADLRemoveTuning);
list<SubtargetFeature> ADLFeatures =
!listconcat(TRMFeatures, ADLAdditionalFeatures);

Expand Down
9 changes: 9 additions & 0 deletions llvm/test/CodeGen/X86/bitcnt-false-dep.ll
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=haswell | FileCheck %s --check-prefix=HSW
; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=skylake | FileCheck %s --check-prefix=SKL
; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=skx | FileCheck %s --check-prefix=SKL
; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=alderlake | FileCheck %s --check-prefix=ADL
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this file be generated with the update script and we share more prefixes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if there are specific features that you have in mind for update_llc_test_checks.py that I'm unfamiliar with, but I don't think it makes a ton of sense here.

We end up having to assert the codegen for the entire function rather than just the bit counting instructions/xors that we're interested in. The new ADL lines will also still be unique as well.

Happy to follow up postcommit if there is a simpler way to do this.

; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=silvermont -mattr=+lzcnt,+bmi | FileCheck %s --check-prefix=SKL
; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=goldmont -mattr=+lzcnt,+bmi | FileCheck %s --check-prefix=SKL

Expand Down Expand Up @@ -37,6 +38,10 @@ ret:
;SKL-LABEL:@loopdep_popcnt32
;SKL: xorl [[GPR0:%e[a-d]x]], [[GPR0]]
;SKL-NEXT: popcntl {{.*}}, [[GPR0]]

;ADL-LABEL:@loopdep_popcnt32
;ADL-NOT: xor
;ADL: popcntl
}

define i64 @loopdep_popcnt64(ptr nocapture %x, ptr nocapture %y) nounwind {
Expand All @@ -63,6 +68,10 @@ ret:
;SKL-LABEL:@loopdep_popcnt64
;SKL: xorl %e[[GPR0:[a-d]x]], %e[[GPR0]]
;SKL-NEXT: popcntq {{.*}}, %r[[GPR0]]

;ADL-LABEL:@loopdep_popcnt64
;ADL-NOT: xor
;ADL: popcntq
}

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