-
Notifications
You must be signed in to change notification settings - Fork 14.9k
[llvm-exegesis] Exclude loads/stores from aliasing instruction set #156300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[llvm-exegesis] Exclude loads/stores from aliasing instruction set #156300
Conversation
In the serial snippet generator and function that computes the aliasing instructions, I don't think we want to include load/store instructions to create a chain as that could make the results more unreliable. There is a hasMemoryOperands() check, but I think that's an X86 way for checking for loads/stores. For AArch64, we should check mayLoad() and mayStore(), and probably for other architectures too.
@llvm/pr-subscribers-tools-llvm-exegesis Author: Sjoerd Meijer (sjoerdmeijer) ChangesIn the serial snippet generator and function that computes the aliasing instructions, I don't think we want to include load/store instructions to create a chain as that could make the results more unreliable. There is a hasMemoryOperands() check, but I think that's an X86 way for checking for loads/stores. For AArch64, we should check mayLoad() and mayStore(), and probably for other architectures too. Full diff: https://github.com/llvm/llvm-project/pull/156300.diff 2 Files Affected:
diff --git a/llvm/test/tools/llvm-exegesis/AArch64/no-aliasing-ld-str.s b/llvm/test/tools/llvm-exegesis/AArch64/no-aliasing-ld-str.s
new file mode 100644
index 0000000000000..65e1203bb275d
--- /dev/null
+++ b/llvm/test/tools/llvm-exegesis/AArch64/no-aliasing-ld-str.s
@@ -0,0 +1,8 @@
+REQUIRES: aarch64-registered-target
+
+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
+RUN: llvm-objdump -d %d > %t.s
+RUN: FileCheck %s < %t.s
+
+CHECK-NOT: ld{{[1-4]}}
+CHECK-NOT: st{{[1-4]}}
diff --git a/llvm/tools/llvm-exegesis/lib/SerialSnippetGenerator.cpp b/llvm/tools/llvm-exegesis/lib/SerialSnippetGenerator.cpp
index bdfc93e22273b..551da570685d2 100644
--- a/llvm/tools/llvm-exegesis/lib/SerialSnippetGenerator.cpp
+++ b/llvm/tools/llvm-exegesis/lib/SerialSnippetGenerator.cpp
@@ -57,6 +57,8 @@ computeAliasingInstructions(const LLVMState &State, const Instruction *Instr,
continue;
if (OtherInstr.hasMemoryOperands())
continue;
+ if (OtherInstr.Description.mayLoad() || OtherInstr.Description.mayStore())
+ continue;
if (!ET.allowAsBackToBack(OtherInstr))
continue;
if (Instr->hasAliasingRegistersThrough(OtherInstr, ForbiddenRegisters))
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hasMemoryOperands
(inside llvm-exegesis
in
bool Instruction::hasMemoryOperands() const { |
09c2839 changed it from just requiring a memory operand to also requiring that the operand by explicit and a register. Not sure why it was changed. I'm thinking updating the condition there is the better option.
Thanks for the suggestion, have move the checks to that place. |
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/33/builds/22310 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/11/builds/23173 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/137/builds/24800 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/175/builds/24640 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/185/builds/24650 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/94/builds/10479 Here is the relevant piece of the build log for the reference
|
… instruction set" (#156735) Reverts llvm/llvm-project#156300 Need to look at the X86 test failures.
…n set" (llvm#156735) Reverts llvm#156300 Need to look at the X86 test failures.
In the serial snippet generator and function that computes the aliasing instructions, I don't think we want to include load/store instructions to create a chain as that could make the results more unreliable.
There is a hasMemoryOperands() check, but I think that's an X86 way for checking for loads/stores. For AArch64, we should check mayLoad() and mayStore(), and probably for other architectures too.