[llvm] [LoongArch] Strengthen stack size estimation for LSX/LASX extension (PR #146455)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 7 21:57:41 PDT 2025


================
@@ -158,7 +158,12 @@ void LoongArchFrameLowering::processFunctionBeforeFrameFinalized(
   // estimateStackSize has been observed to under-estimate the final stack
   // size, so give ourselves wiggle-room by checking for stack size
   // representable an 11-bit signed field rather than 12-bits.
-  if (!isInt<11>(MFI.estimateStackSize(MF)))
+  // For [x]vstelm.{b/h/w/d} memory instructions with 8 imm offset, 7-bit
+  // signed field is fine.
----------------
heiher wrote:

Could you add a test case for this?

https://github.com/llvm/llvm-project/pull/146455


More information about the llvm-commits mailing list