[llvm] [RISCV][GISEL] Legalize G_VAARG through expansion. (PR #73065)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 30 21:05:37 PST 2023
================
@@ -7868,6 +7870,63 @@ LegalizerHelper::lowerVectorReduction(MachineInstr &MI) {
return UnableToLegalize;
}
+static Type *getTypeForLLT(LLT Ty, LLVMContext &C);
+
+LegalizerHelper::LegalizeResult LegalizerHelper::lowerVAArg(MachineInstr &MI) {
+ Observer.changingInstr(MI);
+ MachineFunction &MF = *MI.getMF();
+ const DataLayout &DL = MIRBuilder.getDataLayout();
+ LLVMContext &Ctx = MF.getFunction().getContext();
+ Register ListPtr = MI.getOperand(1).getReg();
+ LLT PtrTy = MRI.getType(ListPtr);
+
+ // LstPtr is a pointer to the head of the list. Get the address
+ // of the head of the list.
+ Align PtrAlignment = Align(DL.getABITypeAlign(getTypeForLLT(PtrTy, Ctx)));
----------------
arsenm wrote:
Don't need Align() constructor
https://github.com/llvm/llvm-project/pull/73065
More information about the llvm-commits
mailing list