<div dir="ltr">Hi Andy,<div><br>That was just a think-o. Thanks for catching it. Fixed in r196640.</div><div><br></div><div>- Lang.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Dec 6, 2013 at 4:41 PM, Andrew Trick <span dir="ltr"><<a href="mailto:atrick@apple.com" target="_blank">atrick@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
On Nov 28, 2013, at 7:07 PM, Lang Hames <<a href="mailto:lhames@gmail.com">lhames@gmail.com</a>> wrote:<br>
<br>
> Author: lhames<br>
> Date: Thu Nov 28 21:07:54 2013<br>
> New Revision: 195944<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=195944&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=195944&view=rev</a><br>
> Log:<br>
> Refactor a lot of patchpoint/stackmap related code to simplify and make it<br>
> target independent.<br>
><br>
> Most of the x86 specific stackmap/patchpoint handling was necessitated by the<br>
> use of the native address-mode format for frame index operands. PEI has now<br>
> been modified to treat stackmap/patchpoint similarly to DEBUG_INFO, allowing<br>
> us to use a simple, platform independent register/offset pair for frame<br>
> indexes on stackmap/patchpoints.<br>
><br>
> Notes:<br>
>  - Folding is now platform independent and automatically supported.<br>
>  - Emiting patchpoints with direct memory references now just involves calling<br>
>    the TargetLoweringBase::emitPatchPoint utility method from the target's<br>
>    XXXTargetLowering::EmitInstrWithCustomInserter method. (See<br>
>    X86TargetLowering for an example).<br>
>  - No more ugly platform-specific operand parsers.<br>
><br>
> This patch shouldn't change the generated output for X86.<br>
<br>
</div>This is really great. I don't understand why in foldPatchpoint we lost the SpillOffset.<br>
<div class="im"><br>
> +static MachineInstr* foldPatchpoint(MachineFunction &MF,<br>
> +                                    MachineInstr *MI,<br>
> +                                    const SmallVectorImpl<unsigned> &Ops,<br>
> +                                    int FrameIndex,<br>
> +                                    const TargetInstrInfo &TII) {<br>
</div>...<br>
<div class="im">> +      unsigned SpillSize;<br>
> +      unsigned SpillOffset;<br>
> +      // Compute the spill slot size and offset.<br>
> +      const TargetRegisterClass *RC =<br>
> +        MF.getRegInfo().getRegClass(MO.getReg());<br>
> +      bool Valid = TII.getStackSlotRange(RC, MO.getSubReg(), SpillSize,<br>
> +                                         SpillOffset, &MF.getTarget());<br>
> +      if (!Valid)<br>
> +        report_fatal_error("cannot spill patchpoint subregister operand");<br>
> +      MIB.addImm(StackMaps::IndirectMemRefOp);<br>
> +      MIB.addImm(SpillSize);<br>
> +      MIB.addFrameIndex(FrameIndex);<br>
> +      MIB.addImm(0);<br>
<br>
</div>MIB.addImm(SpillOffset)?<br>
<br>
-Andy<br>
<br>
</blockquote></div><br></div>