From ac6e177ce60efdd688e0823389cd167f931437bd Mon Sep 17 00:00:00 2001 From: OCHyams Date: Wed, 26 Apr 2023 11:15:37 +0100 Subject: [Assignment Tracking] Remove overly defensive AllocaInst assertion Remove assert from AssignmentTrackingAnalysis that fires if a local variable has non-alloca storage. The analysis can emit these locations but the assignment tracking code in SelectionDAG isn't ready to handle non-alloca storage for locals yet. The AssignmentTrackingPass (pass that adds assignment tracking metadata) ignores non-alloca dbg.declares, so the only variables affected are those who's backing storage is changed from an alloca during optimisation, and the result is the variables are dropped. Fixes: https://ci.chromium.org/ui/p/pigweed/builders/toolchain/ toolchain-ci-pigweed-linux/b8783274592206481489/overview Reviewed By: StephenTozer Differential Revision: https://reviews.llvm.org/D149135 --- llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp') diff --git a/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp b/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp index d5e133d..5ef850d 100644 --- a/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp +++ b/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp @@ -2194,8 +2194,7 @@ bool AssignmentTrackingLowering::run(FunctionVarLocsBuilder *FnVarLocsBuilder) { // // Unless we've already done so, create the single location def now. if (AlwaysStackHomed.insert(Aggr).second) { - assert(!VarLoc.Values.hasArgList() && - isa(VarLoc.Values.getVariableLocationOp(0))); + assert(!VarLoc.Values.hasArgList()); // TODO: When more complex cases are handled VarLoc.Expr should be // built appropriately rather than always using an empty DIExpression. // The assert below is a reminder. -- cgit v1.1