[PATCH] D33121: [SCEV] Fix sorting order for AddRecExprs

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 15 23:46:46 PDT 2017


mkazantsev added inline comments.


================
Comment at: lib/Analysis/ScalarEvolution.cpp:638
+      assert(LHead != RHead && "Two loops share the same header?");
+      if (DT.dominates(LHead, RHead))
+        return 1;
----------------
mkazantsev wrote:
> sanjoy wrote:
> > Can we assert `DT.dominates(LHead, RHead) || DT.dominates(RHead, LHead)` here?
> Yes, I thought of that. It should be true as long as we only use this method to compare operands of one instruction. I propose to land this as is, and then I'll make a follow-up patch with this change. This will allow us to separate the potential problems (if any of these changes can bring them).
Done as https://reviews.llvm.org/D33228


https://reviews.llvm.org/D33121





More information about the llvm-commits mailing list