[llvm] [AArch64] Avoid applying S-form on frame index in peephole (PR #158597)
Sander de Smalen via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 15 06:51:35 PDT 2025
================
@@ -1920,6 +1920,11 @@ static bool canInstrSubstituteCmpInstr(MachineInstr &MI, MachineInstr &CmpInstr,
CmpInstr.getOperand(2).getImm() == 0) &&
"Caller guarantees that CmpInstr compares with constant 0");
+ // NZCV is not supported if the stack offset is scalable.
+ auto &ST = MI.getParent()->getParent()->getSubtarget<AArch64Subtarget>();
+ if ((ST.hasSVE() || ST.isStreaming()) && MI.getOperand(1).isFI())
----------------
sdesmalen-arm wrote:
Nothing here is checking that the stack offset is scalable. If you want to know if the frame-index is describing an object on the stack with scalable size, then you should like at its stack ID.
https://github.com/llvm/llvm-project/pull/158597
More information about the llvm-commits
mailing list