From: Dmitry Sidorov Date: Fri, 19 May 2023 20:06:06 +0000 (+0200) Subject: [PATCH 55/79] [DebugInfo] Fix DebugTypeVector Component Count (#2006) X-Git-Tag: archive/raspbian/15.0.1-1+rpi1^2^2~30 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a3f1a1d4a84688a00573d4828232cace490a8138;p=spirv-llvm-translator-15.git [PATCH 55/79] [DebugInfo] Fix DebugTypeVector Component Count (#2006) It should be OpConstant Signed-off-by: Sidorov, Dmitry Gbp-Pq: Name 0055-DebugInfo-Fix-DebugTypeVector-Component-Count-2006.patch --- diff --git a/lib/SPIRV/LLVMToSPIRVDbgTran.cpp b/lib/SPIRV/LLVMToSPIRVDbgTran.cpp index 527d692..08e5749 100644 --- a/lib/SPIRV/LLVMToSPIRVDbgTran.cpp +++ b/lib/SPIRV/LLVMToSPIRVDbgTran.cpp @@ -696,6 +696,8 @@ LLVMToSPIRVDbgTran::transDbgArrayTypeNonSemantic(const DICompositeType *AT) { if (AT->isVector()) { assert(N == 1 && "Multidimensional vector is not expected!"); Ops[ComponentCountIdx] = static_cast(Count->getZExtValue()); + if (isNonSemanticDebugInfo()) + transformToConstant(Ops, {ComponentCountIdx}); return BM->addDebugInfo(SPIRVDebug::TypeVector, getVoidTy(), Ops); } Ops[SubrangesIdx + I] = transDbgEntry(SR)->getId(); diff --git a/test/DebugInfo/X86/rematerialize.ll b/test/DebugInfo/X86/rematerialize.ll index 762d8e9..76e1ca8 100644 --- a/test/DebugInfo/X86/rematerialize.ll +++ b/test/DebugInfo/X86/rematerialize.ll @@ -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 ; diff --git a/test/DebugInfo/X86/sycl-vec-3.ll b/test/DebugInfo/X86/sycl-vec-3.ll index dcfacc4..d0fa9c2 100644 --- a/test/DebugInfo/X86/sycl-vec-3.ll +++ b/test/DebugInfo/X86/sycl-vec-3.ll @@ -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" diff --git a/test/DebugInfo/X86/vector.ll b/test/DebugInfo/X86/vector.ll index 1389494..3cf2c3a 100644 --- a/test/DebugInfo/X86/vector.ll +++ b/test/DebugInfo/X86/vector.ll @@ -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"