[llvm-exegesis] Don't erroneously refuse to measure POPCNT instruction

This commit is contained in:
Roman Lebedev 2021-04-04 14:36:56 +03:00
parent 6fbbb093ae
commit 64a52e1e32
No known key found for this signature in database
GPG Key ID: 083C3EBB4A1689E0
2 changed files with 10 additions and 2 deletions

View File

@ -0,0 +1,7 @@
# RUN: llvm-exegesis -mode=uops -opcode-name=POPCNT32rr 2>&1 | FileCheck %s
CHECK: ---
CHECK-NEXT: mode: uops
CHECK-NEXT: key:
CHECK-NEXT: instructions:
CHECK-NEXT: - 'POPCNT32rr

View File

@ -194,8 +194,9 @@ static const char *isInvalidOpcode(const Instruction &Instr) {
const auto OpcodeName = Instr.Name;
if ((Instr.Description.TSFlags & X86II::FormMask) == X86II::Pseudo)
return "unsupported opcode: pseudo instruction";
if (OpcodeName.startswith("POP") || OpcodeName.startswith("PUSH") ||
OpcodeName.startswith("ADJCALLSTACK") || OpcodeName.startswith("LEAVE"))
if ((OpcodeName.startswith("POP") && !OpcodeName.startswith("POPCNT")) ||
OpcodeName.startswith("PUSH") || OpcodeName.startswith("ADJCALLSTACK") ||
OpcodeName.startswith("LEAVE"))
return "unsupported opcode: Push/Pop/AdjCallStack/Leave";
switch (Instr.Description.Opcode) {
case X86::LFS16rm: