[llvm] [DebugInfo][RemoveDIs] Implement redundant elimination for DPValues (PR #72284)
Orlando Cazalet-Hyams via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 15 06:57:56 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());
----------------
OCHyams wrote:
If you want to keep the code as similar as possible to the dbg.value version then ignore this, but we could use `DebugVariableAggregate ` here now instead of `DebugVariable`.
https://github.com/llvm/llvm-project/pull/72284
More information about the llvm-commits
mailing list