[PATCH] D19896: [ARM] Fix Scavenger assert due to underestimated stack size

Weiming Zhao via llvm-commits llvm-commits at lists.llvm.org
Wed May 4 11:07:54 PDT 2016


weimingz added a comment.

Thanks Renato. I will add comments to the test case. The test case has already been reduced by bugpoint and manual cleanup. It's still large because we need to stress the reg allocation to expose the issue.


================
Comment at: lib/Target/ARM/ARMFrameLowering.cpp:1623
@@ +1622,3 @@
+      (RS && (MFI->estimateStackSize(MF) + 4 * (NumGPRSpills + NumFPRSpills) +
+                  (!hasFP(MF) ? ArgStackSize : 0) + 16 /* possible paddings */ +
+                  ((hasFP(MF) && AFI->hasStackFrame()) ? 4 : 0) >=
----------------
rengolin wrote:
> Why does ArgStackSize depends on hasFP()?
> 
> Also, what's the expected value for the stack limit here? I hope 16 is not a big fraction of it, or we'll be pessimising it on some corner cases.
estimateRSStackSizeLimit() will return 4096.

When FP(r7) is used, it can use FP as a base reg to address parameters. So accessing parameters should be fine.


Repository:
  rL LLVM

http://reviews.llvm.org/D19896





More information about the llvm-commits mailing list