[PATCH] D26154: [Reassociate] Skip analysis of dead code to avoid infinite loop.

Daniel Berlin via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 31 09:56:42 PDT 2016


dberlin added inline comments.


================
Comment at: lib/Transforms/Scalar/Reassociate.cpp:2182-2185
+    // Skip dead basic blocks.
+    if (RankMap.count(&*BI) == 0)
+      continue;
+
----------------
davide wrote:
> You may want to expand this comment a bit.
There is also a much simpler and more consistent fix:

Iterate in the same order rankmap was built.

You can share the ReversePostOrder ordering, and use it here, and then both are doing the same thing, so there can't be any mismatches.



https://reviews.llvm.org/D26154





More information about the llvm-commits mailing list