Skip to content

Revert "[AutoDiff][DebugInfo] Properly transfer location info from debug_value into alloc_stack in pullback cloner" #42561

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions lib/SIL/Verifier/SILVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1315,9 +1315,9 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
case SILInstructionKind::DebugValueInst:
DebugVarTy = inst->getOperand(0)->getType();
if (DebugVarTy.isAddress()) {
// FIXME: op_deref could be applied to address types only.
// FIXME: Add this check
if (varInfo->DIExpr.startsWithDeref())
auto Expr = varInfo->DIExpr.operands();
if (!Expr.empty() &&
Expr.begin()->getOperator() == SILDIExprOperator::Dereference)
DebugVarTy = DebugVarTy.getObjectType();
}
break;
Expand All @@ -1343,16 +1343,9 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
require(DebugVars[argNum].first == varInfo->Name,
"Scope contains conflicting debug variables for one function "
"argument");
// The source variable might change its location (e.g. due to
// optimizations). Check for most common transformations (e.g. loading
// to SSA value and vice versa) as well
require(DebugVars[argNum].second == DebugVarTy ||
(DebugVars[argNum].second.isAddress() &&
DebugVars[argNum].second.getObjectType() == DebugVarTy) ||
(DebugVarTy.isAddress() &&
DebugVars[argNum].second == DebugVarTy.getObjectType()),
// Check for type
require(DebugVars[argNum].second == DebugVarTy,
"conflicting debug variable type!");
DebugVars[argNum].second = DebugVarTy;
} else {
// Reserve enough space.
while (DebugVars.size() <= argNum) {
Expand Down
5 changes: 0 additions & 5 deletions lib/SILOptimizer/Differentiation/Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,6 @@ findDebugLocationAndVariable(SILValue originalValue) {
for (auto *use : originalValue->getUses()) {
if (auto *dvi = dyn_cast<DebugValueInst>(use->getUser()))
return dvi->getVarInfo().map([&](SILDebugVariable var) {
// We need to drop `op_deref` here as we're transferring debug info
// location from debug_value instruction (which describes how to get value)
// into alloc_stack (which describes the location)
if (var.DIExpr.startsWithDeref())
var.DIExpr.eraseElement(var.DIExpr.element_begin());
return std::make_pair(dvi->getDebugLocation(), var);
});
}
Expand Down
137 changes: 0 additions & 137 deletions test/AutoDiff/compiler_crashers_fixed/sr15849-invalid-debug-info.swift

This file was deleted.