-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
[AArch64] Fix scheduling model issue #96394 #97047
Conversation
The NeoverseZeroMove predicate assumes that the first operand is always an immediate, which isn't always true. For example, it could be a stack offset, etc. This patch fixes that by checking if the operand is an immediate first.
@llvm/pr-subscribers-backend-aarch64 Author: David Sherwood (david-arm) ChangesThe NeoverseZeroMove predicate assumes that the first operand is always an immediate, which isn't always true. For example, it could be a stack offset, etc. This patch fixes that by checking if the operand is an immediate first. Full diff: https://github.com/llvm/llvm-project/pull/97047.diff 1 Files Affected:
diff --git a/llvm/lib/Target/AArch64/AArch64SchedPredNeoverse.td b/llvm/lib/Target/AArch64/AArch64SchedPredNeoverse.td
index 97abec10f7942..33b76a4f65f05 100644
--- a/llvm/lib/Target/AArch64/AArch64SchedPredNeoverse.td
+++ b/llvm/lib/Target/AArch64/AArch64SchedPredNeoverse.td
@@ -60,8 +60,9 @@ def NeoverseZeroMove : MCSchedPredicate<
// MOV Wd, #0
// MOV Xd, #0
CheckAll<[CheckOpcode<[MOVZWi, MOVZXi]>,
- CheckAll<[CheckImmOperand<1, 0>,
- CheckImmOperand<2, 0>]>]>,
+ CheckIsImmOperand<1>,
+ CheckImmOperand<1, 0>,
+ CheckImmOperand<2, 0>]>,
// MOV Wd, WZR
// MOV Xd, XZR
// MOV Wd, Wn
|
Is it possible to add a quick test to make sure we don't hit the same thing again? Otherwise it LGTM |
Done! I've tried to add the simplest mir file test I could think of and verified it crashes without this patch. |
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.
Thanks, LGTM
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.
Thanks for fixing this, LGTM!
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/66/builds/830 Here is the relevant piece of the build log for the reference:
|
The NeoverseZeroMove predicate assumes that the first operand is always an immediate, which isn't always true. For example, it could be a stack offset, etc. This patch fixes that by checking if the operand is an immediate first.
The NeoverseZeroMove predicate assumes that the first operand is always an immediate, which isn't always true. For example, it could be a stack offset, etc. This patch fixes that by checking if the operand is an immediate first.
The NeoverseZeroMove predicate assumes that the first operand is always an immediate, which isn't always true. For example, it could be a stack offset, etc. This patch fixes that by checking if the operand is an immediate first.