[PATCH] D74642: [CodeGenPrepare] Speed up placeDbgValues, NFC

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 14 14:39:26 PST 2020


vsk marked an inline comment as done.
vsk added inline comments.


================
Comment at: llvm/lib/CodeGen/CodeGenPrepare.cpp:7273
+    // from 10 minutes to 50 milliseconds. We can't just use OrderedBasicBlock
+    // because moving around dbg.values causes invalidation.
+    SmallPtrSet<const Instruction *, 32> VisitedInsts;
----------------
rnk wrote:
> I guess by the same reasoning this is still useful even if we had D51664. Although, if no reordering is required because all defs are before uses, D51664 would still help, and I think that is the common case. I assume the webkit case is a long BB of:
>   def A ; dbgval(A) ; def B ; dbgval(B)...
I believe D51664 makes this patch unnecessary. I grabbed the NumDbgValueMoved statistic from the WebKit test case: it was 0. This patch might still improve performance if CGP were to encounter lots of weird dbg.value use-before-def. But I think we want to fix those bugs earlier in the pipeline anyway.

Should we just hold off on landing this, or put it in as a stopgap until D51664 is merged (and file a PR for it to be reverted afterwards)?


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

https://reviews.llvm.org/D74642





More information about the llvm-commits mailing list