[PATCH] D30437: [DAGCombiner] Do various combine on usubo.

Amaury SECHET via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 5 15:12:03 PST 2017


deadalnix added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:2115
+  SDLoc DL(N);
+
+  // If the flag result is dead, turn this into an SUB.
----------------
RKSimon wrote:
> Can vectors ever use this? In which case we need to be careful of generating constants after legalization (see tryFoldToZero).
I don't think so.


================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:2119
+    return CombineTo(N, DAG.getNode(ISD::SUB, DL, VT, N0, N1),
+                     DAG.getUNDEF(CarryVT));
+
----------------
RKSimon wrote:
> Is it possible to add an explicit test for this?
Both codegen result in a sub, the overflow flag goes into the flag register no matter what. I'm not sure what can be done. Add a usubo with a transform that work on a sub and nothing that use the flag and see the transform kicks in ?


https://reviews.llvm.org/D30437





More information about the llvm-commits mailing list