[PATCH] D97193: [AArch64][SVE] Ensure hasFP has a consistent return value

Bradley Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 1 09:05:09 PST 2021


bsmith added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64FrameLowering.cpp:2951
 
+void AArch64FrameLowering::processFunctionBeforeCalleeSpill(
+    MachineFunction &MF) const {
----------------
sdesmalen wrote:
> Given that the approach is probably temporary, does it necessarily need a new generic callback, or could this be called from early-on in determineCalleeSaves?
Ideally probably not, however `determineCalleeSaves` is actually called from more that just `PrologEpilogInserter`, hence it makes more sense to call this directly from `PrologEpilogInserter` rather than `determineCalleeSaves`.


================
Comment at: llvm/test/CodeGen/AArch64/sve-calling-convention-mixed.ll:45
 ; CHECK-NEXT:    addvl sp, sp, #-4
+; CHECK-NEXT:    sub sp, sp, #16 // =16
 ; CHECK-NEXT:    ptrue p0.b
----------------
sdesmalen wrote:
> Why does this function not require the frame-pointer? (it has both locals for passing GPRs and ZPRs)
Unfortunately I think this is just going to have to be a deficiency in this approach and will have to get fixed when done properly.

The issue here is that when `processFunctionBeforeCalleeSpill()` is called the stack has only one object on it (the SVE one), the non-SVE objects only appear during `assignCalleeSavedSpillSlots()` in `PrologEpilogInserter`, which is done after `determineCalleeSaves()`. The calculation of whether an FP should be used can't be delayed until after this point otherwise you end up with rogue frame pointer setup where it isn't used.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97193



More information about the llvm-commits mailing list