Skip to content

Commit 16835f4

Browse files
sjoerdmeijeraokblast
authored andcommitted
Reapply "[llvm-exegesis] Exclude loads/stores from aliasing instruction set" (#156735) (#159366)
Move the mayLoad/mayStore checks out of hasMemoryOperands; there are instructions with these properties that don't have operands. This is relanding 899ee37 with a minor tweak.
1 parent ac96ce9 commit 16835f4

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-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/SerialSnippetGenerator.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ computeAliasingInstructions(const LLVMState &State, const Instruction *Instr,
5757
continue;
5858
if (OtherInstr.hasMemoryOperands())
5959
continue;
60+
// Filtering out loads/stores might belong in hasMemoryOperands(), but that
61+
// complicates things as there are instructions with may load/store that
62+
// don't have operands (e.g. X86's CLUI instruction). So, it's easier to
63+
// filter them out here.
64+
if (OtherInstr.Description.mayLoad() || OtherInstr.Description.mayStore())
65+
continue;
6066
if (!ET.allowAsBackToBack(OtherInstr))
6167
continue;
6268
if (Instr->hasAliasingRegistersThrough(OtherInstr, ForbiddenRegisters))

0 commit comments

Comments
 (0)