[PATCH] D29524: [DAGCombiner] Make DAGCombiner smarter about overflow

Amaury SECHET via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 5 07:33:26 PST 2017


deadalnix added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAG.cpp:2780
+      (~N1Zero & 0x01) == ~N1Zero)
+    return OverflowKind::Never;
+
----------------
RKSimon wrote:
> Does the test cases cover both of these patterns? Its not clear if it does.
I need some more improvement in the handling of adde/addc ( D29443 ) to expose the second one. then it kicks in in muladd in test/CodeGen/X86/adde-carry.ll


================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAG.cpp:2782
+
+  return OverflowKind::Sometime;
+}
----------------
RKSimon wrote:
> Are you intending to add OverflowKind::Always cases soon? If not you should possibly drop it from the enum and just put in a TODO.
Yes I want to add some there to transform adde(X, C, Carry) => addc(X, C+1) when the carry is always there.


https://reviews.llvm.org/D29524





More information about the llvm-commits mailing list