[llvm] [DebugInfo][RemoveDIs] Implement redundant elimination for DPValues (PR #72284)
Jeremy Morse via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 21 02:27:37 PST 2023
================
@@ -440,7 +471,39 @@ static bool removeRedundantDbgInstrsUsingBackwardScan(BasicBlock *BB) {
///
/// Possible improvements:
/// - Keep track of non-overlapping fragments.
+static bool DPValuesRemoveRedundantDbgInstrsUsingForwardScan(BasicBlock *BB) {
+ SmallVector<DPValue *, 8> ToBeRemoved;
+ DenseMap<DebugVariable, std::pair<SmallVector<Value *, 4>, DIExpression *>>
+ VariableMap;
+ for (auto &I : *BB) {
+ for (DPValue &DPV : I.getDbgValueRange()) {
+ DebugVariable Key(DPV.getVariable(),
+ std::nullopt,
+ DPV.getDebugLoc()->getInlinedAt());
----------------
jmorse wrote:
As far as I can see, the "Aggregate" version only happens down dbg.assign code paths? (Which I'm ignoring for the now)
https://github.com/llvm/llvm-project/pull/72284
More information about the llvm-commits
mailing list