[PATCH] D51474: Consider CSRs in computeRegisterLiveness
Matthias Braun via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 30 09:37:10 PDT 2018
MatzeB added a comment.
Thanks for looking into this!
================
Comment at: lib/CodeGen/MachineBasicBlock.cpp:1412-1418
+ const MachineFrameInfo &MFI = MF.getFrameInfo();
+ if (MFI.isCalleeSavedInfoValid()) {
+ for (const CalleeSavedInfo &Info : MFI.getCalleeSavedInfo()) {
+ if (Info.isRestored() && Info.getReg() == Reg)
+ return LQR_Live;
+ }
+ }
----------------
- Thinking about it, the CSRs are only considered live-out of the return block after prolog epilog insertion, so the whole code here needs to be guarded with `MFI.isCalleeSavedInfoValid()`.
- CalleeeSavedInfo() must be a subset of MRI.getCalleeSavedRegs() so we shouldn't need the 2nd loop.
https://reviews.llvm.org/D51474
More information about the llvm-commits
mailing list