[PATCH] D30703: [DSE] Merge stores when the later store only writes to memory locations the early store also wrote to.

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 25 08:00:34 PDT 2017


spatel added inline comments.


================
Comment at: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp:1219-1221
+            //// We erased DepWrite; start over.
+            InstDep = MD->getDependency(SI);
+            continue;
----------------
I think @filcab is unable to get back to this patch currently and D29866 is not progressing. 

I don't have a full understanding of DSE, but I'll propose a one-word fix to this patch (and an additional test case). It should avoid the bug that caused the patch to be reverted ( https://bugs.llvm.org/show_bug.cgi?id=34074 ).

This 'continue' should be a 'break'. We killed 'Inst' above, so 'InstDep' is no longer valid. Therefore, we can't carry on in the inner loop; we need to break back out to the outer loop and really 'start over' as the comment already says. :)


Repository:
  rL LLVM

https://reviews.llvm.org/D30703





More information about the llvm-commits mailing list