HomePhabricator

[DAGCombine][ARM][X86] (sub Carry, X) -> (addcarry (sub 0, X), 0, Carry) fold

Authored by lebedev.ri on Sep 18 2019, 1:48 PM.

Description

[DAGCombine][ARM][X86] (sub Carry, X) -> (addcarry (sub 0, X), 0, Carry) fold

Summary:
DAGCombiner::visitADDLikeCommutative() already has a sibling fold:
(add X, Carry) -> (addcarry X, 0, Carry)

This fold, as suggested by @efriedma, helps recover from some
of the regressions of D62266

Reviewers: efriedma, deadalnix

Subscribers: javed.absar, kristof.beyls, llvm-commits, efriedma

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D62392

llvm-svn: 372259