Skip to content

Commit 37f7ea5

Browse files
authored
Restore poisoning of invalid debug expressions, fix debug info tests
1 parent 5837420 commit 37f7ea5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+14
-57
lines changed

lib/SPIRV/SPIRVToLLVMDbgTran.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1691,19 +1691,23 @@ SPIRVToLLVMDbgTran::transDebugIntrinsic(const SPIRVExtInst *DebugInst,
16911691
if (getDbgInst<SPIRVDebug::DebugInfoNone>(Ops[VariableIdx])) {
16921692
auto *Null =
16931693
ConstantPointerNull::get(PointerType::get(M->getContext(), 0));
1694-
DbgInstPtr DbgDeclare = DIB.insertDeclare(
1695-
Null, LocalVar.first, GetExpression(Ops[ExpressionIdx]), Loc, BB);
1694+
auto *Expr = PoisonInvalidExpr(GetExpression(Ops[ExpressionIdx]),
1695+
LocalVar.first, Null);
1696+
DbgInstPtr DbgDeclare =
1697+
DIB.insertDeclare(Null, LocalVar.first, Expr, Loc, BB);
16961698
return DbgDeclare;
16971699
}
1698-
return DIB.insertDeclare(GetValue(Ops[VariableIdx]), LocalVar.first,
1699-
GetExpression(Ops[ExpressionIdx]), Loc,
1700-
BB);
1700+
Value *Val = GetValue(Ops[VariableIdx]);
1701+
auto *Expr = PoisonInvalidExpr(GetExpression(Ops[ExpressionIdx]),
1702+
LocalVar.first, Val);
1703+
return DIB.insertDeclare(Val, LocalVar.first, Expr, Loc, BB);
17011704
}
17021705
case SPIRVDebug::Value: {
17031706
using namespace SPIRVDebug::Operand::DebugValue;
17041707
auto LocalVar = GetLocalVar(Ops[DebugLocalVarIdx]);
17051708
Value *Val = GetValue(Ops[ValueIdx]);
17061709
DIExpression *Expr = GetExpression(Ops[ExpressionIdx]);
1710+
Expr = PoisonInvalidExpr(Expr, LocalVar.first, Val);
17071711
DebugLoc Loc = transDebugScope(DebugInst);
17081712
DbgInstPtr DbgValIntr = getDIBuilder(DebugInst).insertDbgValueIntrinsic(
17091713
Val, LocalVar.first, Expr, Loc, BB);

test/DebugInfo/DebugDeclareUnused.cl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// XFAIL: *
21
// Check that we can translate llvm.dbg.declare for a local variable which was
32
// deleted by mem2reg pass(disabled by default in amd-llvm-spirv)
43
// RUN: %clang_cc1 %s -triple spir -disable-llvm-passes -debug-info-kind=standalone -emit-llvm-bc -o - | amd-llvm-spirv -spirv-mem2reg -o %t.spv

test/DebugInfo/DebugInfoLLVMArg.ll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
; XFAIL: *
21
; This test checks that DW_OP_LLVM_arg operation goes through round trip translation correctly.
32
; DW_OP_LLVM_arg is mapped on 165 in SPIR-V
43

test/DebugInfo/DebugInfoSubrangeWithOnlyCount.spt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
; XFAIL: *
21
; RUN: amd-llvm-spirv -to-binary %s -o %t.spv
32
; RUN: amd-llvm-spirv -r %t.spv -o %t.rev.bc
43
; RUN: llvm-dis %t.rev.bc -o %t.rev.ll

test/DebugInfo/DebugInfoWithUnknownIntrinsics.ll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
; XFAIL: *
21
; RUN: llvm-as %s -o %t.bc
32
; RUN: amd-llvm-spirv %t.bc -o %t.spv --spirv-ext=+all --spirv-allow-unknown-intrinsics
43
; RUN: amd-llvm-spirv -r %t.spv -o %t.bc

test/DebugInfo/Generic/PR20038.ll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
; XFAIL: *
21
; REQUIRES: object-emission
32

43
; For some reason, the output when targetting sparc is not quite as expected.

test/DebugInfo/Generic/c-and-cpp-mixed.ll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
; XFAIL: *
21
;; This test checks that two DICompileUnits resulted in a link of C and C++
32
;; object files are being translated correctly
43

test/DebugInfo/Generic/dead-argument-order.ll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
; XFAIL: *
21
; REQUIRES: object-emission
32

43
; RUN: llvm-as < %s -o %t.bc

test/DebugInfo/Generic/debug-info-eis-option.ll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
; XFAIL: *
21
; RUN: llvm-as < %s -o %t.bc
32
; RUN: amd-llvm-spirv %t.bc -o %t.spv --spirv-debug-info-version=legacy
43
; RUN: amd-llvm-spirv -r %t.spv -o - | llvm-dis -o %t.ll

test/DebugInfo/Generic/incorrect-variable-debugloc1.ll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
; XFAIL: *
21
; REQUIRES: object-emission
32
; This test is failing for powerpc64, because a location list for the
43
; variable 'c' is not generated at all. Temporary marking this test as XFAIL

0 commit comments

Comments
 (0)