[llvm] [SelectionDAG][AMDGPU] Preserve known bits for demoted sret pointers (PR #203468)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 29 07:56:33 PDT 2026


================
@@ -2219,6 +2219,9 @@ void SelectionDAGBuilder::visitRet(const ReturnInst &I) {
     MVT PtrValueVT = TLI.getPointerTy(DL, DL.getAllocaAddrSpace());
     SDValue RetPtr =
         DAG.getCopyFromReg(Chain, getCurSDLoc(), DemoteReg, PtrValueVT);
+    Align BaseAlign = DL.getPrefTypeAlign(I.getOperand(0)->getType());
----------------
arsenm wrote:

This probably should be ABI type alignment. Though with the current implementation, the alignment isn't doing anything. We'd have to have an assert known bits, not rely on AssertZext 

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


More information about the llvm-commits mailing list