[PATCH] D18586: Allow DeadStoreElimination to track combinations of partial later wrties

Hal Finkel via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 31 12:47:09 PDT 2016


hfinkel added inline comments.

================
Comment at: lib/Transforms/Scalar/DeadStoreElimination.cpp:457
@@ +456,3 @@
+    auto ILI = IM.find(LaterIntStart);
+    if (ILI != IM.end() && ILI.start() < LaterIntEnd) {
+      // This existing interval ends in the middle of
----------------
eeckstein wrote:
> Shouldn't this be
>  if (ILI != IM.end() && ILI.stop() < LaterIntEnd) {
> 
> If yes, then what if the existing interval completely covers the Later-interval? I.e. if ILI.stop() >= LaterIntEnd
We want to know if we have an interval that overlaps with the current one. IM.find(LaterIntStart) will return the first interval that ends at or after the current one's start. Next we need to check if the interval starts before the current one's end (to see whether it overlaps the current one, or is purely after it). Checking whether it stops before the current one ends is insufficient because it will miss the case where the interval crosses the current one's end point. I'll improve the comments.


http://reviews.llvm.org/D18586





More information about the llvm-commits mailing list