[PATCH] D155447: [AArch64] Fix an immediate out of range for large realignments on Windows

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 18 00:19:41 PDT 2023


mstorsjo added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64FrameLowering.cpp:1748
+            .addReg(AArch64::SP)
+            .addReg(AArch64::X16);
+      } else {
----------------
efriedma wrote:
> You could stick a kill flag on x16 here, I guess, although it doesn't matter much this late in the pipeline.
> 
> Probably we should stick a FrameSetup flag on the add (for both cases).
Thanks, will do.


================
Comment at: llvm/lib/Target/AArch64/AArch64FrameLowering.cpp:1753
+            .addImm(RealignmentPadding)
+            .addImm(0);
+      }
----------------
efriedma wrote:
> If we care, for constants up to 1<<23, we can use a shifted immediate.  ("add sp, sp, #1, lsl #12"  etc.)   But probably not worth bothering.
Yeah, but that doesn't work if the immediate contains bit set both below and above the 12 bit boundary; the constants here are like `0x1ff0`, so it's still `0x1, lsl #12` combined with `0xff0`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155447/new/

https://reviews.llvm.org/D155447



More information about the llvm-commits mailing list