Skip to content

Commit

Permalink
[AArch64] Fix scheduling model issue llvm#96394
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
david-arm committed Jun 28, 2024
1 parent de528ff commit a76a342
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions llvm/lib/Target/AArch64/AArch64SchedPredNeoverse.td
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a76a342

Please sign in to comment.