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

Shilei Tian via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 17 08:48:17 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());
----------------
shiltian wrote:

Why do we we only want to preserve it when it is not a target constant?

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


More information about the llvm-commits mailing list