[llvm-branch-commits] [AArch64][GlobalISel] Legalize vector boolean bitcasts to scalars by lowering via stack. (PR #121171)
Matt Arsenault via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Dec 27 01:05:43 PST 2024
================
@@ -4663,6 +4664,20 @@ LegalizerHelper::createStackTemporary(TypeSize Bytes, Align Alignment,
return MIRBuilder.buildFrameIndex(FramePtrTy, FrameIdx);
}
+MachineInstrBuilder LegalizerHelper::createStackStoreLoad(Register Val,
+ LLT DstTy) {
+ LLT SrcTy = MRI.getType(Val);
+ Align StackTypeAlign = getStackTemporaryAlignment(SrcTy);
+ MachinePointerInfo PtrInfo;
+ auto StackTemp =
+ createStackTemporary(SrcTy.getSizeInBytes(), StackTypeAlign, PtrInfo);
+
+ MIRBuilder.buildStore(Val, StackTemp, PtrInfo, StackTypeAlign);
+ return MIRBuilder.buildLoad(
+ DstTy, StackTemp, PtrInfo,
+ std::min(StackTypeAlign, getStackTemporaryAlignment(DstTy)));
----------------
arsenm wrote:
Can just directly use the maximum alignment you should have computed above
https://github.com/llvm/llvm-project/pull/121171
More information about the llvm-branch-commits
mailing list