[PATCH] D78830: [DSE] Add stat for remaining stores after DSE.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 25 08:28:18 PDT 2020


fhahn marked an inline comment as done.
fhahn added a comment.

In D78830#2003168 <https://reviews.llvm.org/D78830#2003168>, @asbirlea wrote:

> I think generally, for accurate stats on how DSE is doing, it would be good to have tests that just run DSE, vs -O3. But this is a fair statistic to have for benchmarks where this is not possible.


I am not sure if I follow entirely.  Are you suggesting to run DSE and compare the total number of stores after compiling to -O3 for benchmarks from test-suite?



================
Comment at: llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1984
+  for (auto &I : instructions(F))
+    NumRemainingStores += isa<StoreInst>(&I);
+#endif
----------------
asbirlea wrote:
> Nit: for the MemorySSA case, this could walk def chains; but perhaps we don't care much about performance when getting stats?
I've additionally guarded the loop by `AreStatisticsEnabled()` and kept the loop as is for now. I think it is slightly more beneficial to ensure we comparing the same thing between both versions in a straight-forward way.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78830





More information about the llvm-commits mailing list