[PATCH] D13363: [DeadStoreElimination] Add support for non-local DSE

Ivan Baev via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 4 18:53:15 PST 2015


ivanbaev marked 3 inline comments as done.
ivanbaev added a comment.

Hi Bruno, the patch has been rebased, and should apply cleanly on ToT.

Mitch, thanks for your comments and suggestions.
Non-local DSE extension follows the structure of HandleFree(). The underlying analysis for DSE is MD, and for across-BB both - HandleFree and HandleNonLocalDependency - use MD->getPointerDependencyFrom(). Note that MD is not loop-aware and its clients should handle CFG and alias issues by relying on AA or DT. HandleFree only allows unconditional predecessors - see FundUnconditonalPreds(). Based on reviewers' feedback HandleNonLocalDependency also handles if-then-else predecessors and single-block-loops (actually one of our benchmarks has a redundant store across a single-block-loop).

Regading cycle.ll test, using DT->dominates(BB, Pred) check is sufficient to exclude for.inc BB from the set of safe predecessors of for.body BB. What alternative do you propose for determining that stores in for.body and for.inc may alias?


================
Comment at: lib/Transforms/Scalar/DeadStoreElimination.cpp:887
@@ +886,3 @@
+          (AA->getModRefInfo(Dependency, Loc) & MRI_Ref))
+        break;
+
----------------
Added AA->getModRefInfo(Dependency, Loc) & MRI_Ref) test.


http://reviews.llvm.org/D13363





More information about the llvm-commits mailing list