Skip to content

Conversation

@aleksandar-amd
Copy link
Contributor

Constant materialization instructions are assigned accurate debug locations.
Debug metadata propagation in SIWholeQuadMode pass.

Compiler-generated instructions were missing debug locations,
causing "Line 0" entries in DWARF
@llvmbot llvmbot added backend:AMDGPU llvm:SelectionDAG SelectionDAGISel as well labels Nov 18, 2025
@llvmbot
Copy link
Member

llvmbot commented Nov 18, 2025

@llvm/pr-subscribers-llvm-selectiondag

@llvm/pr-subscribers-backend-amdgpu

Author: Aleksandar Spasojevic (aleksandar-amd)

Changes

Constant materialization instructions are assigned accurate debug locations.
Debug metadata propagation in SIWholeQuadMode pass.


Full diff: https://github.com/llvm/llvm-project/pull/168573.diff

3 Files Affected:

  • (modified) llvm/include/llvm/CodeGen/SelectionDAGNodes.h (+2-2)
  • (modified) llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (+1-1)
  • (modified) llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp (+14-8)
diff --git a/llvm/include/llvm/CodeGen/SelectionDAGNodes.h b/llvm/include/llvm/CodeGen/SelectionDAGNodes.h
index cfc8a4243e894..05833f97bc035 100644
--- a/llvm/include/llvm/CodeGen/SelectionDAGNodes.h
+++ b/llvm/include/llvm/CodeGen/SelectionDAGNodes.h
@@ -1754,8 +1754,8 @@ class ConstantSDNode : public SDNode {
   const ConstantInt *Value;
 
   ConstantSDNode(bool isTarget, bool isOpaque, const ConstantInt *val,
-                 SDVTList VTs)
-      : SDNode(isTarget ? ISD::TargetConstant : ISD::Constant, 0, DebugLoc(),
+                 SDVTList VTs, const DebugLoc &DL)
+      : SDNode(isTarget ? ISD::TargetConstant : ISD::Constant, 0, DL,
                VTs),
         Value(val) {
     assert(!isa<VectorType>(val->getType()) && "Unexpected vector type!");
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 16fdef06d6679..5502bddbc3ba7 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -1773,7 +1773,7 @@ SDValue SelectionDAG::getConstant(const ConstantInt &Val, const SDLoc &DL,
       return SDValue(N, 0);
 
   if (!N) {
-    N = newSDNode<ConstantSDNode>(isT, isO, Elt, VTs);
+    N = newSDNode<ConstantSDNode>(isT, isO, Elt, VTs, DL.getDebugLoc());
     CSEMap.InsertNode(N, IP);
     InsertNode(N);
     NewSDValueDbgMsg(SDValue(N, 0), "Creating constant: ", this);
diff --git a/llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp b/llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp
index 10762edc16264..355b97cdb9ee8 100644
--- a/llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp
+++ b/llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp
@@ -1179,16 +1179,17 @@ void SIWholeQuadMode::toExact(MachineBasicBlock &MBB,
     }
   }
 
+  const DebugLoc &DL = MBB.findDebugLoc(Before);
   MachineInstr *MI;
 
   if (SaveWQM) {
     unsigned Opcode =
         IsTerminator ? LMC.AndSaveExecTermOpc : LMC.AndSaveExecOpc;
-    MI = BuildMI(MBB, Before, DebugLoc(), TII->get(Opcode), SaveWQM)
+    MI = BuildMI(MBB, Before, DL, TII->get(Opcode), SaveWQM)
              .addReg(LiveMaskReg);
   } else {
     unsigned Opcode = IsTerminator ? LMC.AndTermOpc : LMC.AndOpc;
-    MI = BuildMI(MBB, Before, DebugLoc(), TII->get(Opcode), LMC.ExecReg)
+    MI = BuildMI(MBB, Before, DL, TII->get(Opcode), LMC.ExecReg)
              .addReg(LMC.ExecReg)
              .addReg(LiveMaskReg);
   }
@@ -1200,13 +1201,14 @@ void SIWholeQuadMode::toExact(MachineBasicBlock &MBB,
 void SIWholeQuadMode::toWQM(MachineBasicBlock &MBB,
                             MachineBasicBlock::iterator Before,
                             Register SavedWQM) {
+  const DebugLoc &DL = MBB.findDebugLoc(Before);
   MachineInstr *MI;
 
   if (SavedWQM) {
-    MI = BuildMI(MBB, Before, DebugLoc(), TII->get(AMDGPU::COPY), LMC.ExecReg)
+    MI = BuildMI(MBB, Before, DL, TII->get(AMDGPU::COPY), LMC.ExecReg)
              .addReg(SavedWQM);
   } else {
-    MI = BuildMI(MBB, Before, DebugLoc(), TII->get(LMC.WQMOpc), LMC.ExecReg)
+    MI = BuildMI(MBB, Before, DL, TII->get(LMC.WQMOpc), LMC.ExecReg)
              .addReg(LMC.ExecReg);
   }
 
@@ -1222,12 +1224,14 @@ void SIWholeQuadMode::toStrictMode(MachineBasicBlock &MBB,
   assert(StrictStateNeeded == StateStrictWWM ||
          StrictStateNeeded == StateStrictWQM);
 
+  const DebugLoc &DL = MBB.findDebugLoc(Before);
+
   if (StrictStateNeeded == StateStrictWWM) {
-    MI = BuildMI(MBB, Before, DebugLoc(), TII->get(AMDGPU::ENTER_STRICT_WWM),
+    MI = BuildMI(MBB, Before, DL, TII->get(AMDGPU::ENTER_STRICT_WWM),
                  SaveOrig)
              .addImm(-1);
   } else {
-    MI = BuildMI(MBB, Before, DebugLoc(), TII->get(AMDGPU::ENTER_STRICT_WQM),
+    MI = BuildMI(MBB, Before, DL, TII->get(AMDGPU::ENTER_STRICT_WQM),
                  SaveOrig)
              .addImm(-1);
   }
@@ -1245,12 +1249,14 @@ void SIWholeQuadMode::fromStrictMode(MachineBasicBlock &MBB,
   assert(CurrentStrictState == StateStrictWWM ||
          CurrentStrictState == StateStrictWQM);
 
+  const DebugLoc &DL = MBB.findDebugLoc(Before);
+
   if (CurrentStrictState == StateStrictWWM) {
-    MI = BuildMI(MBB, Before, DebugLoc(), TII->get(AMDGPU::EXIT_STRICT_WWM),
+    MI = BuildMI(MBB, Before, DL, TII->get(AMDGPU::EXIT_STRICT_WWM),
                  LMC.ExecReg)
              .addReg(SavedOrig);
   } else {
-    MI = BuildMI(MBB, Before, DebugLoc(), TII->get(AMDGPU::EXIT_STRICT_WQM),
+    MI = BuildMI(MBB, Before, DL, TII->get(AMDGPU::EXIT_STRICT_WQM),
                  LMC.ExecReg)
              .addReg(SavedOrig);
   }

@github-actions
Copy link

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff origin/main HEAD --extensions cpp,h -- llvm/include/llvm/CodeGen/SelectionDAGNodes.h llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp --diff_from_common_commit

⚠️
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing origin/main to the base branch/commit you want to compare against.
⚠️

View the diff from clang-format here.
diff --git a/llvm/include/llvm/CodeGen/SelectionDAGNodes.h b/llvm/include/llvm/CodeGen/SelectionDAGNodes.h
index 05833f97b..a791563be 100644
--- a/llvm/include/llvm/CodeGen/SelectionDAGNodes.h
+++ b/llvm/include/llvm/CodeGen/SelectionDAGNodes.h
@@ -1755,8 +1755,7 @@ class ConstantSDNode : public SDNode {
 
   ConstantSDNode(bool isTarget, bool isOpaque, const ConstantInt *val,
                  SDVTList VTs, const DebugLoc &DL)
-      : SDNode(isTarget ? ISD::TargetConstant : ISD::Constant, 0, DL,
-               VTs),
+      : SDNode(isTarget ? ISD::TargetConstant : ISD::Constant, 0, DL, VTs),
         Value(val) {
     assert(!isa<VectorType>(val->getType()) && "Unexpected vector type!");
     ConstantSDNodeBits.IsOpaque = isOpaque;
diff --git a/llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp b/llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp
index 355b97cdb..9a05f1880 100644
--- a/llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp
+++ b/llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp
@@ -1185,8 +1185,8 @@ void SIWholeQuadMode::toExact(MachineBasicBlock &MBB,
   if (SaveWQM) {
     unsigned Opcode =
         IsTerminator ? LMC.AndSaveExecTermOpc : LMC.AndSaveExecOpc;
-    MI = BuildMI(MBB, Before, DL, TII->get(Opcode), SaveWQM)
-             .addReg(LiveMaskReg);
+    MI =
+        BuildMI(MBB, Before, DL, TII->get(Opcode), SaveWQM).addReg(LiveMaskReg);
   } else {
     unsigned Opcode = IsTerminator ? LMC.AndTermOpc : LMC.AndOpc;
     MI = BuildMI(MBB, Before, DL, TII->get(Opcode), LMC.ExecReg)
@@ -1227,12 +1227,10 @@ void SIWholeQuadMode::toStrictMode(MachineBasicBlock &MBB,
   const DebugLoc &DL = MBB.findDebugLoc(Before);
 
   if (StrictStateNeeded == StateStrictWWM) {
-    MI = BuildMI(MBB, Before, DL, TII->get(AMDGPU::ENTER_STRICT_WWM),
-                 SaveOrig)
+    MI = BuildMI(MBB, Before, DL, TII->get(AMDGPU::ENTER_STRICT_WWM), SaveOrig)
              .addImm(-1);
   } else {
-    MI = BuildMI(MBB, Before, DL, TII->get(AMDGPU::ENTER_STRICT_WQM),
-                 SaveOrig)
+    MI = BuildMI(MBB, Before, DL, TII->get(AMDGPU::ENTER_STRICT_WQM), SaveOrig)
              .addImm(-1);
   }
   LIS->InsertMachineInstrInMaps(*MI);
@@ -1252,13 +1250,13 @@ void SIWholeQuadMode::fromStrictMode(MachineBasicBlock &MBB,
   const DebugLoc &DL = MBB.findDebugLoc(Before);
 
   if (CurrentStrictState == StateStrictWWM) {
-    MI = BuildMI(MBB, Before, DL, TII->get(AMDGPU::EXIT_STRICT_WWM),
-                 LMC.ExecReg)
-             .addReg(SavedOrig);
+    MI =
+        BuildMI(MBB, Before, DL, TII->get(AMDGPU::EXIT_STRICT_WWM), LMC.ExecReg)
+            .addReg(SavedOrig);
   } else {
-    MI = BuildMI(MBB, Before, DL, TII->get(AMDGPU::EXIT_STRICT_WQM),
-                 LMC.ExecReg)
-             .addReg(SavedOrig);
+    MI =
+        BuildMI(MBB, Before, DL, TII->get(AMDGPU::EXIT_STRICT_WQM), LMC.ExecReg)
+            .addReg(SavedOrig);
   }
   LIS->InsertMachineInstrInMaps(*MI);
   StateTransition[MI] = NonStrictState;

@shiltian
Copy link
Contributor

test?

@github-actions
Copy link

🐧 Linux x64 Test Results

  • 166123 tests passed
  • 2840 tests skipped
  • 6 tests failed

Failed Tests

(click on a test name to see its output)

LLVM

LLVM.CodeGen/AMDGPU/ptr-arg-dbg-value.ll
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx908 < /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/AMDGPU/ptr-arg-dbg-value.ll | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/AMDGPU/ptr-arg-dbg-value.ll
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx908
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/AMDGPU/ptr-arg-dbg-value.ll
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/AMDGPU/ptr-arg-dbg-value.ll:20:15: error: CHECK-NEXT: is not on the line after the previous match
# | ; CHECK-NEXT: v_mov_b32_e32 v2, 1
# |               ^
# | <stdin>:20:2: note: 'next' match was here
# |  v_mov_b32_e32 v2, 1
# |  ^
# | <stdin>:17:41: note: previous match ended here
# |  s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
# |                                         ^
# | <stdin>:18:1: note: non-matching line after previous match is here
# | .Ltmp0:
# | ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/AMDGPU/ptr-arg-dbg-value.ll:49:15: error: CHECK-NEXT: is not on the line after the previous match
# | ; CHECK-NEXT: v_mov_b32_e32 v0, 1
# |               ^
# | <stdin>:64:2: note: 'next' match was here
# |  v_mov_b32_e32 v0, 1
# |  ^
# | <stdin>:61:41: note: previous match ended here
# |  buffer_load_dword v31, off, s[0:3], s32
# |                                         ^
# | <stdin>:62:1: note: non-matching line after previous match is here
# | .Ltmp2:
# | ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/AMDGPU/ptr-arg-dbg-value.ll:75:15: error: CHECK-NEXT: is not on the line after the previous match
# | ; CHECK-NEXT: v_mov_b32_e32 v2, 1
# |               ^
# | <stdin>:109:2: note: 'next' match was here
# |  v_mov_b32_e32 v2, 1
# |  ^
# | <stdin>:106:49: note: previous match ended here
# |  buffer_load_dword v0, off, s[0:3], s32 offset:4
# |                                                 ^
# | <stdin>:107:1: note: non-matching line after previous match is here
# | .Ltmp4:
# | ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/AMDGPU/ptr-arg-dbg-value.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |          .
# |          .
# |          .
# |         15:  ;DEBUG_VALUE: ptr_arg_split_subregs:a <- [DW_OP_LLVM_fragment 32 32] [$vgpr1+0] 
# |         16:  ;DEBUG_VALUE: ptr_arg_split_subregs:a <- [DW_OP_LLVM_fragment 0 32] [$vgpr0+0] 
# |         17:  s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) 
# |         18: .Ltmp0: 
# |         19:  .loc 1 7 13 prologue_end ; example.cpp:7:13 
# |         20:  v_mov_b32_e32 v2, 1 
# | next:20      !~~~~~~~~~~~~~~~~~~  error: match on wrong line
# |         21:  flat_store_dword v[0:1], v2 offset:396 
# |         22:  .loc 1 8 5 ; example.cpp:8:5 
# |         23:  s_waitcnt vmcnt(0) lgkmcnt(0) 
# |         24:  s_setpc_b64 s[30:31] 
# |         25: .Ltmp1: 
# |          .
# |          .
# |          .
# |         59:  ;DEBUG_VALUE: ptr_arg_split_reg_mem:b <- [$vgpr30+0] 
# |         60:  s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) 
# |         61:  buffer_load_dword v31, off, s[0:3], s32 
# |         62: .Ltmp2: 
# |         63:  .loc 1 12 13 prologue_end ; example.cpp:12:13 
# |         64:  v_mov_b32_e32 v0, 1 
# | next:49      !~~~~~~~~~~~~~~~~~~  error: match on wrong line
# |         65:  s_waitcnt vmcnt(0) 
# |         66:  flat_store_dword v[30:31], v0 offset:396 
# |         67:  .loc 1 13 5 ; example.cpp:13:5 
# |         68:  s_waitcnt vmcnt(0) lgkmcnt(0) 
# |         69:  s_setpc_b64 s[30:31] 
# |          .
# |          .
# |          .
# |        104:  s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) 
# |        105:  buffer_load_dword v1, off, s[0:3], s32 offset:8 
# |        106:  buffer_load_dword v0, off, s[0:3], s32 offset:4 
# |        107: .Ltmp4: 
# |        108:  .loc 1 17 13 prologue_end ; example.cpp:17:13 
# |        109:  v_mov_b32_e32 v2, 1 
# | next:75      !~~~~~~~~~~~~~~~~~~  error: match on wrong line
# |        110:  s_waitcnt vmcnt(0) 
# |        111:  flat_store_dword v[0:1], v2 offset:396 
# |        112:  .loc 1 18 5 ; example.cpp:18:5 
# |        113:  s_waitcnt vmcnt(0) lgkmcnt(0) 
# |        114:  s_setpc_b64 s[30:31] 
# |          .
# |          .
# |          .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

LLVM.CodeGen/BPF/CORE/offset-reloc-basic.ll
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/opt -O2 /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/BPF/CORE/offset-reloc-basic.ll | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llvm-dis > /home/gha/actions-runner/_work/llvm-project/llvm-project/build/test/CodeGen/BPF/CORE/Output/offset-reloc-basic.ll.tmp1
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/opt -O2 /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/BPF/CORE/offset-reloc-basic.ll
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llvm-dis
# note: command had no output on stdout or stderr
# RUN: at line 2
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -filetype=asm -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/build/test/CodeGen/BPF/CORE/Output/offset-reloc-basic.ll.tmp1 | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefixes=CHECK /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/BPF/CORE/offset-reloc-basic.ll
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -filetype=asm -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/build/test/CodeGen/BPF/CORE/Output/offset-reloc-basic.ll.tmp1
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefixes=CHECK /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/BPF/CORE/offset-reloc-basic.ll
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/BPF/CORE/offset-reloc-basic.ll:111:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: .long 108
# |               ^
# | <stdin>:435:10: note: scanning from here
# |  .long 20
# |          ^
# | <stdin>:454:2: note: possible intended match here
# |  .long 10262 # Line 10 Col 22
# |  ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/BPF/CORE/offset-reloc-basic.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |           430:  .byte 1 
# |           431:  .byte 0 
# |           432:  .long 32 
# |           433:  .long 0 
# |           434:  .long 20 
# |           435:  .long 20 
# | next:111'0              X error: no match found
# |           436:  .long 124 
# | next:111'0     ~~~~~~~~~~~
# |           437:  .long 144 
# | next:111'0     ~~~~~~~~~~~
# |           438:  .long 28 
# | next:111'0     ~~~~~~~~~~
# |           439:  .long 8 # FuncInfo 
# | next:111'0     ~~~~~~~~~~~~~~~~~~~~
# |           440:  .long 43 # FuncInfo section string offset=43 
# | next:111'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             .
# |             .
# |             .
# |           449:  .long 0 
# | next:111'0     ~~~~~~~~~
# |           450:  .long 9216 # Line 9 Col 0 
# | next:111'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           451:  .long .Ltmp4 
# | next:111'0     ~~~~~~~~~~~~~~
# |           452:  .long 49 
# | next:111'0     ~~~~~~~~~~
# |           453:  .long 0 
# | next:111'0     ~~~~~~~~~
# |           454:  .long 10262 # Line 10 Col 22 
# | next:111'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | next:111'1      ?                             possible intended match
# |           455:  .long .Ltmp8 
# | next:111'0     ~~~~~~~~~~~~~~
# |           456:  .long 49 
# | next:111'0     ~~~~~~~~~~
# |           457:  .long 0 
# | next:111'0     ~~~~~~~~~
# |           458:  .long 11267 # Line 11 Col 3 
# | next:111'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           459:  .long .Ltmp9 
# | next:111'0     ~~~~~~~~~~~~~~
# |             .
# |             .
# |             .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

LLVM.DebugInfo/AMDGPU/debug-loc-copy.ll
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1030 < /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/DebugInfo/AMDGPU/debug-loc-copy.ll | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=GCN /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/DebugInfo/AMDGPU/debug-loc-copy.ll
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1030
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -check-prefix=GCN /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/DebugInfo/AMDGPU/debug-loc-copy.ll
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/DebugInfo/AMDGPU/debug-loc-copy.ll:17:13: error: GCN-NEXT: is not on the line after the previous match
# | ; GCN-NEXT: s_mov_b64 s[4:5], 0
# |             ^
# | <stdin>:18:2: note: 'next' match was here
# |  s_mov_b64 s[4:5], 0
# |  ^
# | <stdin>:15:16: note: previous match ended here
# | ; %bb.1: ; %lab
# |                ^
# | <stdin>:16:1: note: non-matching line after previous match is here
# | .Ltmp0:
# | ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/DebugInfo/AMDGPU/debug-loc-copy.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |          .
# |          .
# |          .
# |         13: ; %bb.0: 
# |         14:  s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) 
# |         15: ; %bb.1: ; %lab 
# |         16: .Ltmp0: 
# |         17:  .loc 0 12 1 prologue_end ; t.cpp:12:1 
# |         18:  s_mov_b64 s[4:5], 0 
# | next:17      !~~~~~~~~~~~~~~~~~~  error: match on wrong line
# |         19:  s_mov_b64 s[6:7], src_private_base 
# |         20:  s_mov_b32 s6, -1 
# |         21:  s_lshr_b32 s8, s32, 5 
# |         22:  s_cmp_lg_u32 s8, s6 
# |         23:  s_cselect_b32 s5, s7, s5 
# |          .
# |          .
# |          .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

LLVM.DebugInfo/ARM/single-constant-use-preserves-dbgloc.ll
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -filetype=asm -asm-verbose=0 -arm-atomic-cfg-tidy=0 < /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/DebugInfo/ARM/single-constant-use-preserves-dbgloc.ll | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/DebugInfo/ARM/single-constant-use-preserves-dbgloc.ll
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -filetype=asm -asm-verbose=0 -arm-atomic-cfg-tidy=0
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/DebugInfo/ARM/single-constant-use-preserves-dbgloc.ll
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/DebugInfo/ARM/single-constant-use-preserves-dbgloc.ll:34:10: error: CHECK: expected string not found in input
# | ; CHECK: .loc 1 0
# |          ^
# | <stdin>:1:1: note: scanning from here
# |  .syntax unified
# | ^
# | <stdin>:27:2: note: possible intended match here
# |  .loc 1 2 0
# |  ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/DebugInfo/ARM/single-constant-use-preserves-dbgloc.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             1:  .syntax unified 
# | check:34'0     X~~~~~~~~~~~~~~~~ error: no match found
# |             2:  .eabi_attribute 67, "2.09" 
# | check:34'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             3:  .eabi_attribute 6, 10 
# | check:34'0     ~~~~~~~~~~~~~~~~~~~~~~~
# |             4:  .eabi_attribute 7, 65 
# | check:34'0     ~~~~~~~~~~~~~~~~~~~~~~~
# |             5:  .eabi_attribute 8, 1 
# | check:34'0     ~~~~~~~~~~~~~~~~~~~~~~
# |             6:  .eabi_attribute 9, 2 
# | check:34'0     ~~~~~~~~~~~~~~~~~~~~~~
# |             .
# |             .
# |             .
# |            22:  .type main,%function 
# | check:34'0     ~~~~~~~~~~~~~~~~~~~~~~
# |            23:  .code 32 
# | check:34'0     ~~~~~~~~~~
# |            24: main: 
# | check:34'0     ~~~~~~
# |            25: .Lfunc_begin0: 
# | check:34'0     ~~~~~~~~~~~~~~~
# |            26:  .file 1 "/home/user/clang/build" "test.c" 
# | check:34'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            27:  .loc 1 2 0 
# | check:34'0     ~~~~~~~~~~~~
# | check:34'1      ?           possible intended match
# |            28:  .fnstart 
# | check:34'0     ~~~~~~~~~~
# |            29:  .cfi_sections .debug_frame 
# | check:34'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            30:  .cfi_startproc 
# | check:34'0     ~~~~~~~~~~~~~~~~
# |            31:  .pad #8 
# | check:34'0     ~~~~~~~~~
# |            32:  sub sp, sp, #8 
# | check:34'0     ~~~~~~~~~~~~~~~~
# |             .
# |             .
# |             .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

LLVM.DebugInfo/COFF/jump-table-with-indirect-ptr-null.ll
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc < /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/DebugInfo/COFF/jump-table-with-indirect-ptr-null.ll | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/DebugInfo/COFF/jump-table-with-indirect-ptr-null.ll
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/DebugInfo/COFF/jump-table-with-indirect-ptr-null.ll
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/DebugInfo/COFF/jump-table-with-indirect-ptr-null.ll:9:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: jmpq *%{{.*}}
# |               ^
# | <stdin>:52:8: note: scanning from here
# | .Ltmp2:
# |        ^
# | <stdin>:53:18: note: possible intended match here
# |  .short .Ltmp5-.Ltmp4 # Record length
# |                  ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/DebugInfo/COFF/jump-table-with-indirect-ptr-null.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |           .
# |           .
# |           .
# |          47:  .section .debug$S,"dr" 
# |          48:  .p2align 2, 0x0 
# |          49:  .long 4 # Debug section magic 
# |          50:  .long 241 
# |          51:  .long .Ltmp3-.Ltmp2 # Subsection size 
# |          52: .Ltmp2: 
# | next:9'0            X error: no match found
# |          53:  .short .Ltmp5-.Ltmp4 # Record length 
# | next:9'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | next:9'1                      ?                     possible intended match
# |          54: .Ltmp4: 
# | next:9'0     ~~~~~~~~
# |          55:  .short 4353 # Record kind: S_OBJNAME 
# | next:9'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |          56:  .long 0 # Signature 
# | next:9'0     ~~~~~~~~~~~~~~~~~~~~~
# |          57:  .byte 0 # Object name 
# | next:9'0     ~~~~~~~~~~~~~~~~~~~~~~~
# |          58:  .p2align 2, 0x0 
# | next:9'0     ~~~~~~~~~~~~~~~~~
# |           .
# |           .
# |           .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

LLVM.tools/llvm-objdump/ELF/AMDGPU/source-lines.ll
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
sed -e "s,SRC_COMPDIR,/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/tools/llvm-objdump/ELF/AMDGPU/Inputs,g" /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/tools/llvm-objdump/ELF/AMDGPU/source-lines.ll > /home/gha/actions-runner/_work/llvm-project/llvm-project/build/test/tools/llvm-objdump/ELF/AMDGPU/Output/source-lines.ll.tmp.ll
# executed command: sed -e s,SRC_COMPDIR,/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/tools/llvm-objdump/ELF/AMDGPU/Inputs,g /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/tools/llvm-objdump/ELF/AMDGPU/source-lines.ll
# note: command had no output on stdout or stderr
# RUN: at line 2
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx802 -filetype=obj -O0 -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/test/tools/llvm-objdump/ELF/AMDGPU/Output/source-lines.ll.tmp.o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/test/tools/llvm-objdump/ELF/AMDGPU/Output/source-lines.ll.tmp.ll
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx802 -filetype=obj -O0 -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/test/tools/llvm-objdump/ELF/AMDGPU/Output/source-lines.ll.tmp.o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/test/tools/llvm-objdump/ELF/AMDGPU/Output/source-lines.ll.tmp.ll
# note: command had no output on stdout or stderr
# RUN: at line 3
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llvm-objdump --triple=amdgcn-amd-amdhsa --mcpu=gfx802 -d -l /home/gha/actions-runner/_work/llvm-project/llvm-project/build/test/tools/llvm-objdump/ELF/AMDGPU/Output/source-lines.ll.tmp.o | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --check-prefix=LINE /home/gha/actions-runner/_work/llvm-project/llvm-project/build/test/tools/llvm-objdump/ELF/AMDGPU/Output/source-lines.ll.tmp.ll
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llvm-objdump --triple=amdgcn-amd-amdhsa --mcpu=gfx802 -d -l /home/gha/actions-runner/_work/llvm-project/llvm-project/build/test/tools/llvm-objdump/ELF/AMDGPU/Output/source-lines.ll.tmp.o
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --check-prefix=LINE /home/gha/actions-runner/_work/llvm-project/llvm-project/build/test/tools/llvm-objdump/ELF/AMDGPU/Output/source-lines.ll.tmp.ll
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/test/tools/llvm-objdump/ELF/AMDGPU/Output/source-lines.ll.tmp.ll:12:9: error: LINE: expected string not found in input
# | ; LINE: ; {{.*}}source-lines.cl:2
# |         ^
# | <stdin>:23:25: note: scanning from here
# |  v_mov_b32_e32 v0, 0x777 // 000000000040: 7E0002FF 00000777
# |                         ^
# | <stdin>:25:103: note: possible intended match here
# | ; /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/tools/llvm-objdump/ELF/AMDGPU/Inputs/source-lines.cl:3
# |                                                                                                       ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/test/tools/llvm-objdump/ELF/AMDGPU/Output/source-lines.ll.tmp.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |            18:  v_mov_b32_e32 v0, s6 // 000000000028: 7E000206 
# |            19:  buffer_store_dword v0, off, s[0:3], s33 offset:4 // 00000000002C: E0700004 21000000 
# |            20:  v_mov_b32_e32 v0, s4 // 000000000034: 7E000204 
# |            21:  buffer_store_dword v0, off, s[0:3], s33 // 000000000038: E0700000 21000000 
# |            22: ; /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/tools/llvm-objdump/ELF/AMDGPU/Inputs/source-lines.cl:2 
# |            23:  v_mov_b32_e32 v0, 0x777 // 000000000040: 7E0002FF 00000777 
# | check:12'0                             X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
# |            24:  buffer_store_dword v0, off, s[0:3], s33 offset:8 // 000000000048: E0700008 21000000 
# | check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            25: ; /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/tools/llvm-objdump/ELF/AMDGPU/Inputs/source-lines.cl:3 
# | check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:12'1                                                                                                           ?                      possible intended match
# |            26:  v_mov_b32_e32 v0, 0x888 // 000000000050: 7E0002FF 00000888 
# | check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            27:  buffer_store_dword v0, off, s[0:3], s33 offset:12 // 000000000058: E070000C 21000000 
# | check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            28: ; /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/tools/llvm-objdump/ELF/AMDGPU/Inputs/source-lines.cl:4 
# | check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            29:  buffer_load_dword v0, off, s[0:3], s33 offset:8 // 000000000060: E0500008 21000000 
# | check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            30:  buffer_load_dword v1, off, s[0:3], s33 offset:12 // 000000000068: E050000C 21000100 
# | check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             .
# |             .
# |             .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the infrastructure label.

Comment on lines +1757 to +1758
SDVTList VTs, const DebugLoc &DL)
: SDNode(isTarget ? ISD::TargetConstant : ISD::Constant, 0, DL,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't belong in this patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend:AMDGPU llvm:SelectionDAG SelectionDAGISel as well

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants