Skip to content

Commit 899ee37

Browse files
authored
[llvm-exegesis] Exclude loads/stores from aliasing instruction set (#156300)
In the serial snippet generator and function that computes the aliasing instructions, we don't want to include load/store instructions to create a chain as that could make the results more unreliable. There is a hasMemoryOperands() check, but currently that looks like a X86 way for checking for loads/stores. For AArch64 and other architectures, we should check mayLoad() and mayStore().
1 parent 7753f61 commit 899ee37

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
REQUIRES: aarch64-registered-target
2+
3+
RUN: llvm-exegesis -mtriple=aarch64 -mcpu=neoverse-v2 -mode=latency --dump-object-to-disk=%d --opcode-name=FMOVWSr --benchmark-phase=assemble-measured-code 2>&1
4+
RUN: llvm-objdump -d %d > %t.s
5+
RUN: FileCheck %s < %t.s
6+
7+
CHECK-NOT: ld{{[1-4]}}
8+
CHECK-NOT: st{{[1-4]}}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,8 @@ const Operand &Instruction::getPrimaryOperand(const Variable &Var) const {
206206
}
207207

208208
bool Instruction::hasMemoryOperands() const {
209+
if (Description.mayLoad() || Description.mayStore())
210+
return true;
209211
return any_of(Operands, [](const Operand &Op) {
210212
return Op.isReg() && Op.isExplicit() && Op.isMemory();
211213
});

0 commit comments

Comments
 (0)