[PATCH] SelectionDAG: Don't do libcall on div/rem if divrem is custom

Ahmed Bougacha ahmed.bougacha at gmail.com
Fri May 22 16:20:34 PDT 2015


REPOSITORY
  rL LLVM

================
Comment at: lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp:2185
@@ -2184,1 +2184,3 @@
 
+  if (TLI.getOperationAction(ISD::SDIVREM, VT) == TargetLoweringBase::Custom) {
+    SDValue RES = DAG.getNode(ISD::SDIVREM, dl, DAG.getVTList(VT, VT),
----------------
TargetLoweringBase:: -> TargetLowering::

================
Comment at: lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp:2186
@@ +2185,3 @@
+  if (TLI.getOperationAction(ISD::SDIVREM, VT) == TargetLoweringBase::Custom) {
+    SDValue RES = DAG.getNode(ISD::SDIVREM, dl, DAG.getVTList(VT, VT),
+                              N->getOperand(0), N->getOperand(1));
----------------
RES -> Res

Also, what about 'SDNode *Res'?  Doing an explicit SDValue(Res, 0/1) is clearer, I think.

================
Comment at: lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp:2187
@@ +2186,3 @@
+    SDValue RES = DAG.getNode(ISD::SDIVREM, dl, DAG.getVTList(VT, VT),
+                              N->getOperand(0), N->getOperand(1));
+    SplitInteger(RES, Lo, Hi);
----------------
I see we have Ops[2] a few lines down, can you move that above and just pass it here?

http://reviews.llvm.org/D7803

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list