[PATCH] D37121: [DivRemHoist] add a pass to move div/rem pairs into the same block (PR31028)

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 24 16:16:18 PDT 2017


spatel added inline comments.


================
Comment at: lib/Transforms/Scalar/DivRemHoist.cpp:86
+      assert(DT.dominates(RemInst, DivInst) &&
+             "Instructions with same operands, but one doesn't dominate?");
+      // Hoist the div into the rem block. No cost calculation needed here.
----------------
efriedma wrote:
> Why is this assertion true?  I don't see why two instructions with the same operands must have a dominance relation.
Yes, you're right. The examples I was looking at weren't very diverse. Will fix.


https://reviews.llvm.org/D37121





More information about the llvm-commits mailing list