Skip to content

Commit 1ca5d43

Browse files
tclin914fschlimb
authored andcommitted
[llvm-exegesis] Ignore the instructions for which InstrDesc.getSchedClass() == 0 (llvm#143840)
This allows llvm-exegesis to skip instructions that lack scheduling information, avoiding invalid benchmarking. e.g. `InstB` in RISC-V.
1 parent ddf96f2 commit 1ca5d43

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# RUN: llvm-exegesis -mtriple=riscv64-unknown-linux-gnu -mcpu=generic --benchmark-phase=assemble-measured-code -mode=inverse_throughput -opcode-name=InsnB 2>&1 | FileCheck %s
2+
3+
CHECK: Unsupported opcode: No Sched Class

llvm/tools/llvm-exegesis/lib/Target.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ ExegesisTarget::getIgnoredOpcodeReasonOrNull(const LLVMState &State,
4545
return "Unsupported opcode: isBranch/isIndirectBranch";
4646
if (InstrDesc.isCall() || InstrDesc.isReturn())
4747
return "Unsupported opcode: isCall/isReturn";
48+
if (InstrDesc.getSchedClass() == 0)
49+
return "Unsupported opcode: No Sched Class";
4850
return nullptr;
4951
}
5052

0 commit comments

Comments
 (0)