]> granicus.if.org Git - llvm/commit
[DAGCombiner] sub X, 0/1 --> add X, 0/-1
authorSanjay Patel <spatel@rotateright.com>
Wed, 30 Jan 2019 22:41:35 +0000 (22:41 +0000)
committerSanjay Patel <spatel@rotateright.com>
Wed, 30 Jan 2019 22:41:35 +0000 (22:41 +0000)
commitb880916519c95ba5b9e4bb702cd315e51f8251b0
tree0cfb16973c52f8f1be0b8c0442c06ab05027b266
parent323b0c562d399a84f38c3f81e1b54dffef671b34
[DAGCombiner] sub X, 0/1 --> add X, 0/-1

This extends the existing transform for:
add X, 0/1 --> sub X, 0/-1
...to allow the sibling subtraction fold.

This pattern could regress with the proposed change in D57401.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352680 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/AArch64/bool-ext-inc.ll
test/CodeGen/X86/bool-ext-inc.ll
test/CodeGen/X86/select_const.ll