[PATCH] D10909: PrologEpilogInserter: Improve API to determine callee save regsiters.

Matthias Braun matze at braunis.de
Wed Jul 15 15:56:15 PDT 2015


> On Jul 14, 2015, at 10:59 PM, Andrew Trick <atrick at apple.com> wrote:
> 
> atrick added a comment.
> 
> Very nice cleanup + optimization.
> 
> Just to satisfy my own curiosity, what if the current function has a UWTable attribute, but the call site is noreturn+nounwind? I suppose we still need to spill the clobbered callee saves for debugging (as you have done)?
> 
> Only one correctness question, why don't you check for implicit defs here?
> 
> + for (const MachineOperand &MO : make_range(def_begin(*AI), def_end()))
MachineRegisterInfo::def_begin(PhysReg)/def_end(PhysReg) should include the implicit defs (not like MachineInstr::defs()).

MRI::isPhysRegModified() is replicating an exception of VirtRegRewriter here: In case of a noreturn call all def operands are ignored unless the function has a UWTable attribute. It's unfortunate that we have this exception IMO and not just remove these operands in the first place, but changing this mean touching several targets at this time.

- Matthias



More information about the llvm-commits mailing list