[PATCH] D29896: [BypassSlowDivision] Refactor fast division insertion logic (NFC)

Justin Lebar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 20 10:54:03 PST 2017


jlebar accepted this revision.
jlebar added a comment.
This revision is now accepted and ready to land.

lgtm with comments updated.  \o/



================
Comment at: lib/Transforms/Utils/BypassSlowDivision.cpp:40
+  /// A resulting pair of div/rem operations after bypassing. Typically, they
+  /// are PHINodes in the successor basic block.
+  struct QuotRemPair {
----------------
Please update comment.  This is now just a pair, it's not the result of bypassing.


================
Comment at: lib/Transforms/Utils/BypassSlowDivision.cpp:51
+  /// data, a pair of PHINodes for Div and Rem results are created in the
+  /// successor basic block.
+  struct QuotRemWithBB {
----------------
Please update comment.  This is now just two values plus a BB.  If you want, you can say what the BB is supposed to represent.  We should also say how this should be used, rather than describing how it is currently used in the algorithm.  Perhaps:

> A quotient and remainder, plus a BB from which they logically "originate".  If you use Quotient or Remainder in a Phi node, you should use BB as its corresponding predecessor.


https://reviews.llvm.org/D29896





More information about the llvm-commits mailing list