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

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 25 03:25:31 PDT 2019


xbolva00 added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/TargetLowering.cpp:4400-4401
+/// Ref: "Hacker's Delight" 10-17.
+SDValue TargetLowering::buildUREMEqFold(EVT VT, SDValue REMNode,
+                                        SDValue CompNode, ISD::CondCode Cond,
+                                        DAGCombinerInfo &DCI,
----------------
spatel wrote:
> Could shorten: 
> REMNode -> Rem
> CompNode -> check that this operand is zero before we call this, rather than pass it as a param?
> 
> 
In terms of possible future general case of this REM == C fold... I think it is okay it to pass it.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63391/new/

https://reviews.llvm.org/D63391





More information about the llvm-commits mailing list