[PATCH] D100464: [DSE] Remove stores in the same loop iteration

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 14 07:56:55 PDT 2021


fhahn added a comment.

Thanks for the patch! Given that this only shifts the invocation of LI, there shouldn't be any problems in terms of compile time.

I'm not sure how well the loop cases are covered in `multiblock-loops.ll`, but I think it might be worth to add a few more interesting cases that we can and can't optimize, especially with stores to different indices.



================
Comment at: llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1298
                   unsigned &ScanLimit, unsigned &WalkerStepLimit,
-                  bool IsMemTerm, unsigned &PartialLimit) {
+                  bool IsMemTerm, unsigned &PartialLimit, LoopInfo &LI) {
     if (ScanLimit == 0 || WalkerStepLimit == 0) {
----------------
Can `LI` just be part of DSEState?


================
Comment at: llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:2032
   PreservedAnalyses PA;
   PA.preserveSet<CFGAnalyses>();
   PA.preserve<GlobalsAA>();
----------------
Should also preserve `LoopAnalysis`?


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

https://reviews.llvm.org/D100464



More information about the llvm-commits mailing list