[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 04:02:22 PDT 2026


================
@@ -19717,14 +19709,19 @@ void SITargetLowering::computeKnownBitsForTargetNode(const SDValue Op,
       Op, Known, DemandedElts, DAG, Depth);
 }
 
+void SITargetLowering::computeKnownBitsForSRetPointer(
+    KnownBits &Known, const MachineFunction &) const {
+  Known.Zero.setHighBits(getSubtarget()->getKnownHighZeroBitsForFrameIndex());
----------------
arsenm wrote:

It's not strictly required, but yes. See what computeKnownBitsForFrameIndex does. This case won't have a frame index for getting the alignment, but you should know the alignment of the sret. computeKnownBitsForFrameIndex should be implemented with the new function 

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


More information about the llvm-commits mailing list