[PATCH] D77849: [calcspillweights] mark LiveIntervals from INLINEASM_BR defs as not spillable

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 14 14:39:22 PDT 2020


nickdesaulniers added inline comments.


================
Comment at: llvm/test/CodeGen/X86/callbr-asm-regalloc.mir:5
+#                 -simplify-mir llvm/test/CodeGen/X86/callbr-asm-regalloc.ll \
+#                 2> callbr-asm-regalloc.mir
+#
----------------
nickdesaulniers wrote:
> nickdesaulniers wrote:
> > arsenm wrote:
> > > nickdesaulniers wrote:
> > > > huh, that's not yaml...
> > > The debug printing format that -print-after gives you is not the same MIR output as -stop-after
> > Ok, I think I have it updated.  Seems that regalloc is actually a grouping of passes that run, so there's no explicit "Greedy" in `-print-after-all` and you have to dump the MIR before any of the related regalloc passes (ie. after `twoaddressinstruction` for x86).  MIR/llc is different from LLVM IR/opt in that passes generally are order dependent, so you must dump MIR in the precise form that a given pass expects.  Someone please correct me if I'm wrong in my understanding of this point.
> > 
> > I suppose I can first clean up this test by removing the LLVM IR embedded within.
> > 
> > We need a test case for which there are more live registers in use than there are physical GPRs to allocate, and where the register allocator chooses to spill the liveouts from the `INLINEASM_BR`.  @arsenm , I'm not sure how much more I can simplify the test, at least in an automated manner.
> huh, seems I can't eliminate the LLVM IR from the MIR, as otherwise the MIR becomes invalid due to references of missing globals defined in the LLVM IR.  That's uh, kind of a mess, and feels like LLVM IR is not discarded or even discardable when lowered to MIR.
sigh, and this test passes with or without my change to `CalcSpillWeights`, though `llc -O2 -verify-machineinstrs` on the .ll fails...I'm missing something that's preventing me from restarting the failure in llc.  Will keep digging.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77849





More information about the llvm-commits mailing list