[PATCH] D29528: [DAGCombiner] Push truncate through adde when the carry isn't used.

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 6 10:55:26 PST 2017


RKSimon added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:7876
+      !N0.getNode()->hasAnyUseOfValue(1) &&
+      TLI.isOperationLegalOrCustom(ISD::ADDE, VT)) {
+    SDLoc SL(N);
----------------
This should probably be (!LegalOperations || TLI.isOperationLegal(ISD::ADDE, VT)) - otherwise you might get into trouble if custom lowering results in the truncate being regenerated.


================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:7879
+    auto X = DAG.getNode(ISD::TRUNCATE, SL, VT, N0.getOperand(0));
+    auto Y = DAG.getNode(ISD::TRUNCATE, SL, VT, N0.getOperand(1));
+    return DAG.getNode(ISD::ADDE, SL, DAG.getVTList(VT, MVT::Glue),
----------------
Typically we don't use auto for these cases - just use SDvalue


https://reviews.llvm.org/D29528





More information about the llvm-commits mailing list