[PATCH] D71013: [AIX] Allow vararg calls when all arguments reside in registers.
Chris Bowler via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 13 21:00:38 PST 2019
cebowleratibm marked 4 inline comments as done.
cebowleratibm 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");
----------------
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.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71013/new/
https://reviews.llvm.org/D71013
More information about the llvm-commits
mailing list