From a76a342cf670aeb3c726923f6efdc3ed1607572b Mon Sep 17 00:00:00 2001 From: David Sherwood Date: Fri, 28 Jun 2024 12:26:30 +0000 Subject: [PATCH] [AArch64] Fix scheduling model issue #96394 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/lib/Target/AArch64/AArch64SchedPredNeoverse.td | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Target/AArch64/AArch64SchedPredNeoverse.td b/llvm/lib/Target/AArch64/AArch64SchedPredNeoverse.td index 97abec10f79429..33b76a4f65f05f 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