[llvm] [SPIR-V] Emit DebugTypeBasic for NonSemantic DI (PR #106980)

Michal Paszkowski via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 3 16:08:03 PDT 2024


================
@@ -104,6 +109,24 @@ bool SPIRVEmitNonSemanticDI::emitGlobalDI(MachineFunction &MF) {
                 cast<ConstantAsMetadata>(Op->getOperand(2))->getValue())
                 ->getSExtValue();
     }
+
+    // This traversal is the only supported way to access
+    // instruction related DI metadata like DIBasicType
+    for (auto &F : *M) {
+      for (auto &BB : F) {
----------------
michalpaszkowski wrote:

Could iteration over BBs be skipped? Please see this _[Iterating over the Instruction in a Function section in the LLVM Programmers Manual](https://llvm.org/docs/ProgrammersManual.html#iterating-over-the-instruction-in-a-function)_.

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


More information about the llvm-commits mailing list