[llvm] r195944 - Refactor a lot of patchpoint/stackmap related code to simplify and make it

Lang Hames lhames at gmail.com
Fri Dec 6 19:35:54 PST 2013


Hi Andy,

That was just a think-o. Thanks for catching it. Fixed in r196640.

- Lang.


On Fri, Dec 6, 2013 at 4:41 PM, Andrew Trick <atrick at apple.com> wrote:

>
> On Nov 28, 2013, at 7:07 PM, Lang Hames <lhames at gmail.com> wrote:
>
> > Author: lhames
> > Date: Thu Nov 28 21:07:54 2013
> > New Revision: 195944
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=195944&view=rev
> > Log:
> > Refactor a lot of patchpoint/stackmap related code to simplify and make
> it
> > target independent.
> >
> > Most of the x86 specific stackmap/patchpoint handling was necessitated
> by the
> > use of the native address-mode format for frame index operands. PEI has
> now
> > been modified to treat stackmap/patchpoint similarly to DEBUG_INFO,
> allowing
> > us to use a simple, platform independent register/offset pair for frame
> > indexes on stackmap/patchpoints.
> >
> > Notes:
> >  - Folding is now platform independent and automatically supported.
> >  - Emiting patchpoints with direct memory references now just involves
> calling
> >    the TargetLoweringBase::emitPatchPoint utility method from the
> target's
> >    XXXTargetLowering::EmitInstrWithCustomInserter method. (See
> >    X86TargetLowering for an example).
> >  - No more ugly platform-specific operand parsers.
> >
> > This patch shouldn't change the generated output for X86.
>
> This is really great. I don't understand why in foldPatchpoint we lost the
> SpillOffset.
>
> > +static MachineInstr* foldPatchpoint(MachineFunction &MF,
> > +                                    MachineInstr *MI,
> > +                                    const SmallVectorImpl<unsigned>
> &Ops,
> > +                                    int FrameIndex,
> > +                                    const TargetInstrInfo &TII) {
> ...
> > +      unsigned SpillSize;
> > +      unsigned SpillOffset;
> > +      // Compute the spill slot size and offset.
> > +      const TargetRegisterClass *RC =
> > +        MF.getRegInfo().getRegClass(MO.getReg());
> > +      bool Valid = TII.getStackSlotRange(RC, MO.getSubReg(), SpillSize,
> > +                                         SpillOffset, &MF.getTarget());
> > +      if (!Valid)
> > +        report_fatal_error("cannot spill patchpoint subregister
> operand");
> > +      MIB.addImm(StackMaps::IndirectMemRefOp);
> > +      MIB.addImm(SpillSize);
> > +      MIB.addFrameIndex(FrameIndex);
> > +      MIB.addImm(0);
>
> MIB.addImm(SpillOffset)?
>
> -Andy
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131206/d187a2aa/attachment.html>


More information about the llvm-commits mailing list