[llvm] [AMDGPU] Propagate debug info to constant materialization instr (PR #192669)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 17 09:25:31 PDT 2026


================
@@ -1839,6 +1839,8 @@ SDValue SelectionDAG::getConstant(const ConstantInt &Val, const SDLoc &DL,
 
   if (!N) {
     N = newSDNode<ConstantSDNode>(isT, isO, Elt, VTs);
+    if (!isT)
+      N->setDebugLoc(DL.getDebugLoc());
----------------
arsenm wrote:

TargetConstant is never materialized, and the debug info is meaningless for it (it's really broken that getTargetConstant has a debug loc argument) 

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


More information about the llvm-commits mailing list