[PATCH] D50222: [CodeGen] [SelectionDAG] More efficient code for X % C == 0 (UREM case)

Dmytro Shynkevych via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 13 21:25:24 PDT 2018


hermord marked 2 inline comments as done.
hermord added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/TargetLowering.cpp:3606
+                                       SelectionDAG &DAG,
+                                       std::vector<SDNode *> &Created) const {
+  // fold (seteq/ne (urem N, D), 0) -> (setule/gte (rotr (mul N, P), K), Q)
----------------
RKSimon wrote:
> lebedev.ri wrote:
> > This should be `SmallVectorImpl<SDNode *> &Created` like in all the other cases.
> Isn't this still missing?
The approach is different now: `BuildUREMEqFold` is now called from `TargetLowering::SimplifySetCC` and not from `DAGCombiners::visitREM`, and l tried to match the style of the other helpers called from there (like `simplifySetCCWithAnd`).


Repository:
  rL LLVM

https://reviews.llvm.org/D50222





More information about the llvm-commits mailing list