[PATCH 55/79] [DebugInfo] Fix DebugTypeVector Component Count (#2006)
authorDmitry Sidorov <dmitry.sidorov@intel.com>
Fri, 19 May 2023 20:06:06 +0000 (22:06 +0200)
committerAndreas Beckmann <anbe@debian.org>
Thu, 14 Mar 2024 19:01:08 +0000 (20:01 +0100)
It should be OpConstant

Signed-off-by: Sidorov, Dmitry <dmitry.sidorov@intel.com>
Gbp-Pq: Name 0055-DebugInfo-Fix-DebugTypeVector-Component-Count-2006.patch

lib/SPIRV/LLVMToSPIRVDbgTran.cpp
test/DebugInfo/X86/rematerialize.ll
test/DebugInfo/X86/sycl-vec-3.ll
test/DebugInfo/X86/vector.ll

index 527d692f948703b214501e1854e93e32ee8031ca..08e5749713d214ca35fed555ea961cd50dffd199 100644 (file)
@@ -696,6 +696,8 @@ LLVMToSPIRVDbgTran::transDbgArrayTypeNonSemantic(const DICompositeType *AT) {
     if (AT->isVector()) {
       assert(N == 1 && "Multidimensional vector is not expected!");
       Ops[ComponentCountIdx] = static_cast<SPIRVWord>(Count->getZExtValue());
+      if (isNonSemanticDebugInfo())
+        transformToConstant(Ops, {ComponentCountIdx});
       return BM->addDebugInfo(SPIRVDebug::TypeVector, getVoidTy(), Ops);
     }
     Ops[SubrangesIdx + I] = transDbgEntry(SR)->getId();
index 762d8e923c3ce9614a21398ac674f1a0ff14dadf..76e1ca8c3ccb17c9c16d4e010c280bc4628676b8 100644 (file)
@@ -3,6 +3,16 @@
 ; RUN: llvm-spirv %t.bc -o %t.spv
 ; RUN: llvm-spirv -r %t.spv -o - | llvm-dis -o %t.ll
 
+; RUN: llc -O2 -filetype=obj -mtriple=x86_64-unknown-linux-gnu < %t.ll \
+; RUN: | llvm-dwarfdump -debug-line - | FileCheck %s
+
+; RUN: llvm-spirv %t.bc -o %t.spv --spirv-debug-info-version=nonsemantic-shader-100
+; RUN: llvm-spirv -r %t.spv -o - | llvm-dis -o %t.ll
+; RUN: llc -O2 -filetype=obj -mtriple=x86_64-unknown-linux-gnu < %t.ll \
+; RUN: | llvm-dwarfdump -debug-line - | FileCheck %s
+
+; RUN: llvm-spirv %t.bc -o %t.spv --spirv-debug-info-version=nonsemantic-shader-200
+; RUN: llvm-spirv -r %t.spv -o - | llvm-dis -o %t.ll
 ; RUN: llc -O2 -filetype=obj -mtriple=x86_64-unknown-linux-gnu < %t.ll \
 ; RUN: | llvm-dwarfdump -debug-line - | FileCheck %s
 ;
index dcfacc46f3584e018f969767dfb607e1148e4796..d0fa9c2c6437e25861770ae1fb78df523cf2d80e 100644 (file)
@@ -3,6 +3,14 @@
 ; RUN: llvm-spirv -r %t.spv -o %t.rev.bc
 ; RUN: llvm-dis %t.rev.bc -o - | FileCheck %s
 
+; RUN: llvm-spirv %t.bc -o %t.spv -spirv-debug-info-version=nonsemantic-shader-100
+; RUN: llvm-spirv -r %t.spv -o %t.rev.bc
+; RUN: llvm-dis %t.rev.bc -o - | FileCheck %s
+
+; RUN: llvm-spirv %t.bc -o %t.spv -spirv-debug-info-version=nonsemantic-shader-200
+; RUN: llvm-spirv -r %t.spv -o %t.rev.bc
+; RUN: llvm-dis %t.rev.bc -o - | FileCheck %s
+
 target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64"
 target triple = "spir64-unknown-unknown"
 
index 13894948128c30850f39c9b1a08a1bfa5b46d554..3cf2c3a8341d8adb3d677329ccc84639e84668a6 100644 (file)
@@ -5,6 +5,16 @@
 ; RUN: llc -mtriple=x86_64-linux-gnu -O0 -filetype=obj -o %t %t.ll
 ; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
 
+; RUN: llvm-spirv %t.bc -o %t.spv -spirv-debug-info-version=nonsemantic-shader-100
+; RUN: llvm-spirv -r %t.spv -o - | llvm-dis -o %t.ll
+; RUN: llc -mtriple=x86_64-linux-gnu -O0 -filetype=obj -o %t %t.ll
+; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
+
+; RUN: llvm-spirv %t.bc -o %t.spv -spirv-debug-info-version=nonsemantic-shader-200
+; RUN: llvm-spirv -r %t.spv -o - | llvm-dis -o %t.ll
+; RUN: llc -mtriple=x86_64-linux-gnu -O0 -filetype=obj -o %t %t.ll
+; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
+
 target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64"
 target triple = "spir64-unknown-unknown"