diff options
author | OCHyams <orlando.hyams@sony.com> | 2023-03-16 09:25:01 +0000 |
---|---|---|
committer | OCHyams <orlando.hyams@sony.com> | 2023-03-16 09:55:15 +0000 |
commit | 47b99b7fc095753104b17f51fe54e4adf07acd45 (patch) | |
tree | 1753b33e318d1ce95a0026a10921118a7f20acdc /llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp | |
parent | 7d894374551f6d5787db0aef2da8dd6aefa616fb (diff) | |
download | llvm-47b99b7fc095753104b17f51fe54e4adf07acd45.zip llvm-47b99b7fc095753104b17f51fe54e4adf07acd45.tar.gz llvm-47b99b7fc095753104b17f51fe54e4adf07acd45.tar.bz2 |
[Assignment Tracking] Do not convert variadic locations to kill locations [3/x]
Reviewed By: StephenTozer
Differential Revision: https://reviews.llvm.org/D145914
Diffstat (limited to 'llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp b/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp index d508486..bda6ec9 100644 --- a/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp +++ b/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp @@ -1297,10 +1297,7 @@ void AssignmentTrackingLowering::emitDbgValue( } if (Kind == LocKind::Val) { - /// Get the value component, converting to Undef if it is variadic. - Value *Val = - Source->hasArgList() ? nullptr : Source->getVariableLocationOp(0); - Emit(ValueAsMetadata::get(Val), Source->getExpression()); + Emit(Source->getRawLocation(), Source->getExpression()); return; } @@ -2126,23 +2123,11 @@ bool AssignmentTrackingLowering::emitPromotedVarLocs( // already. if (VarsWithStackSlot->contains(getAggregate(DVI))) continue; - // Wrapper to get a single value (or undef) from DVI. - auto GetValue = [DVI]() -> RawLocationWrapper { - // We can't handle variadic DIExpressions yet so treat those as - // kill locations. - Value *V; - if (DVI->isKillLocation() || DVI->getValue() == nullptr || - DVI->hasArgList()) - V = PoisonValue::get(Type::getInt32Ty(DVI->getContext())); - else - V = DVI->getVariableLocationOp(0); - return RawLocationWrapper(ValueAsMetadata::get(V)); - }; Instruction *InsertBefore = I.getNextNode(); assert(InsertBefore && "Unexpected: debug intrinsics after a terminator"); FnVarLocs->addVarLoc(InsertBefore, DebugVariable(DVI), DVI->getExpression(), DVI->getDebugLoc(), - GetValue()); + DVI->getWrappedLocation()); InsertedAnyIntrinsics = true; } } |