[PATCH] D71013: [AIX] Allow vararg calls when all arguments reside in registers.

Hubert Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 13 21:27:20 PST 2019


hubert.reinterpretcast added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:7034
+      if (!GPR2.isRegLoc() || GPR2.getValNo() != GPR1.getValNo())
+        continue;
+      assert(GPR2.needsCustom() && "A second custom GPR is expected");
----------------
cebowleratibm wrote:
> hubert.reinterpretcast wrote:
> > cebowleratibm wrote:
> > > hubert.reinterpretcast wrote:
> > > > What sort of situation leads to this?
> > > The matching ValNo should be an assertion.  I should have written:
> > > 
> > >        // If no GPRs were left then there may be no more ArgLocs remaining.
> > >       if (I + 1 == e)
> > >         continue;
> > >       CCValAssign &GPR2 = ArgLocs[++I];
> > >       // If no GPRs were left then there may be non-reg ArgLocs remaining.
> > >       if (!GPR2.isRegLoc()))
> > >         continue;
> > >       assert(GPR2.getValNo() == GPR1.getValNo() && GPR2.needsCustom() &&
> > >              "A second custom GPR is expected!");
> > > 
> > If we observed one custom reg and we are dealing with the var arg case. My understanding is that, if we were unable to allocate a second GPR for the vararg case, the loop would have hit `report_fatal_error`.
> Yes we should have emitted an error.  So the final assertion checks that contract.  If we see a RegLoc that follows the "GPR1" RegLoc, then we expect that to be the second custom reg and have the same ValNo as the first.
I am trying to understand why we cannot assert that there is at least one ArgLoc remaining, that said ArgLoc is a RegLoc, //and// that said RegLoc is the second custom reg.


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

https://reviews.llvm.org/D71013





More information about the llvm-commits mailing list