From fc87817ab79455c92579f00cd0d32f72b1aafea5 Mon Sep 17 00:00:00 2001 From: Dmitry Sidorov Date: Tue, 25 Apr 2023 22:17:50 +0200 Subject: [PATCH] [PATCH 38/79] [DebugInfo] Fix Composite type translation for NonSemantic spec (#1975) Tag should be OpConstant, not Literal. Signed-off-by: Sidorov, Dmitry Gbp-Pq: Name 0038-DebugInfo-Fix-Composite-type-translation-for-NonSema.patch --- lib/SPIRV/LLVMToSPIRVDbgTran.cpp | 2 +- test/DebugInfo/TransTypeCompositeCaseClass_.ll | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/SPIRV/LLVMToSPIRVDbgTran.cpp b/lib/SPIRV/LLVMToSPIRVDbgTran.cpp index 49f1cfb..ee6b668 100644 --- a/lib/SPIRV/LLVMToSPIRVDbgTran.cpp +++ b/lib/SPIRV/LLVMToSPIRVDbgTran.cpp @@ -931,7 +931,7 @@ LLVMToSPIRVDbgTran::transDbgCompositeType(const DICompositeType *CT) { } if (isNonSemanticDebugInfo()) - transformToConstant(Ops, {LineIdx, ColumnIdx, FlagsIdx}); + transformToConstant(Ops, {TagIdx, LineIdx, ColumnIdx, FlagsIdx}); SPIRVEntry *Res = BM->addDebugInfo(SPIRVDebug::TypeComposite, getVoidTy(), Ops); diff --git a/test/DebugInfo/TransTypeCompositeCaseClass_.ll b/test/DebugInfo/TransTypeCompositeCaseClass_.ll index 1b06cef..3dcea44 100644 --- a/test/DebugInfo/TransTypeCompositeCaseClass_.ll +++ b/test/DebugInfo/TransTypeCompositeCaseClass_.ll @@ -13,6 +13,10 @@ ; RUN: llvm-spirv -r %t.spv -o %t.rev.bc ; RUN: llvm-dis < %t.rev.bc | FileCheck %s --check-prefix=CHECK-LLVM +; RUN: llvm-spirv --spirv-debug-info-version=nonsemantic-shader-100 %t.bc -o %t.spv +; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o %t.rev.bc +; RUN: llvm-dis < %t.rev.bc | FileCheck %s --check-prefix=CHECK-LLVM + ; ModuleID = 'main.cpp' source_filename = "main.cpp" 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" -- 2.30.2