[PATCH] D83464: [MachineOutliner][AArch64] Fix for noreturn functions

Puyan Lotfi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 15 17:50:29 PDT 2020


plotfi added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64InstrInfo.cpp:6162
     } else {
       SetCandidateCallInfo(MachineOutlinerDefault, 12);
     }
----------------
paquette wrote:
> plotfi wrote:
> > From what I can tell, bailing here with a `RepeatedSequenceLocs.clear(); return outliner::OutlinedFunction();` also works. It seems to be if the candidate does not have an available LR or is noreturn, doesn't have available registers, and isn't using using the SP is is probably highly likely to get set to `MachineOutlinerDefault` unless the candidate size doesn't exceed the 12 bytes of a standard LR/BL/restore LR. 
> You don't always want to bail out here.
> 
> You only want to bail out here when the candidates contain a call, or `IsNoReturn == true`.
> 
> This just says that we'll save LR to the stack.
Ah! Yeah, that makes sense. The case that I was hitting does have a call. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83464





More information about the llvm-commits mailing list