Skip to content

Commit 81f91f1

Browse files
MrSidimsagainull
authored andcommitted
Fix Composite type translation for NonSemantic spec (intel#1975)
Tag should be OpConstant, not Literal. Signed-off-by: Sidorov, Dmitry <[email protected]> Original commit: KhronosGroup/SPIRV-LLVM-Translator@408713f
1 parent 8586347 commit 81f91f1

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

llvm-spirv/lib/SPIRV/LLVMToSPIRVDbgTran.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,7 @@ LLVMToSPIRVDbgTran::transDbgCompositeType(const DICompositeType *CT) {
931931
}
932932

933933
if (isNonSemanticDebugInfo())
934-
transformToConstant(Ops, {LineIdx, ColumnIdx, FlagsIdx});
934+
transformToConstant(Ops, {TagIdx, LineIdx, ColumnIdx, FlagsIdx});
935935
SPIRVEntry *Res =
936936
BM->addDebugInfo(SPIRVDebug::TypeComposite, getVoidTy(), Ops);
937937

llvm-spirv/test/DebugInfo/TransTypeCompositeCaseClass_.ll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o %t.rev.bc
1414
; RUN: llvm-dis < %t.rev.bc | FileCheck %s --check-prefix=CHECK-LLVM
1515

16+
; RUN: llvm-spirv --spirv-debug-info-version=nonsemantic-shader-100 %t.bc -o %t.spv
17+
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o %t.rev.bc
18+
; RUN: llvm-dis < %t.rev.bc | FileCheck %s --check-prefix=CHECK-LLVM
19+
1620
; ModuleID = 'main.cpp'
1721
source_filename = "main.cpp"
1822
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"

0 commit comments

Comments
 (0)