[llvm] [GISEL][RISCV] Add G_VACOPY GISEL opcode and add lowering code for it. (PR #73066)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 27 17:28:45 PST 2023


topperc wrote:

> > Can we just handle Intrinsic::vacopy in RISCVLegalizerInfo::legalizeIntrinsic like AArch64 does?
> 
> It isn't clear to me why we have G_VASTART and G_VAARG, but would use legalizeIntrinsic for vacopy. It seems fitting that all three should get opcodes or all three should use legalizeIntrinsic. We have all three ISD nodes in SDAG. We have `SDValue SelectionDAG::expandVACopy(SDNode *Node)`. This patch provides the SDAG equivalent.
> 
> I've gone ahead and made the change and based on reviewer input we can decide which approach to take.

G_VAARG exists because va_arg is an instruction in IR so it is not an intrinsic. The commit that added G_VASTART said it need to be an instrction because it carries a memory operand.

https://github.com/llvm/llvm-project/pull/73066


More information about the llvm-commits mailing list