[PATCH] D74030: [DebugInfo] Avoid generating duplicate llvm.dbg.value

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 12 09:10:39 PST 2020


aprantl added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/Local.cpp:1259
     if (DbgValueInst *DVI = dyn_cast<DbgValueInst>(PrevI))
-      if (DVI->getValue() == I->getOperand(0) &&
-          DVI->getVariable() == DIVar &&
-          DVI->getExpression() == DIExpr)
+      if (isDbgValueMatching(DVI, I->getOperand(0), DIVar, DIExpr, DbgLoc))
+        return true;
----------------
Orlando wrote:
> @aprantl said:
> >Is checking the first instruction after going to be good enough in the general case?
> 
> In this case shouldn't the 'already exists before I' check also be a backwards scan (through consecutive dbg.values)?
Yeah, and doing a linear scan each time might be prohibitively expensive (i.e., quadratic). If we're implementing this we should take a look at the performance of compiling an optimized clang and an optimizes asanified clang to make sure this isn't a problem. 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74030/new/

https://reviews.llvm.org/D74030





More information about the llvm-commits mailing list