[DAGCombine] Use FoldConstantArithmetic() to perform C2-(A+C1) -> (C2-C1)-A fold
authorRoman Lebedev <lebedev.ri@gmail.com>
Thu, 30 May 2019 19:27:26 +0000 (19:27 +0000)
committerRoman Lebedev <lebedev.ri@gmail.com>
Thu, 30 May 2019 19:27:26 +0000 (19:27 +0000)
commit9ff3159b4aede9a53d65e67ada4a7e2ba1aaa301
treee7947465dc31942074d5b74bd4fbde695fb13698
parentcc9a9cf2378493ac3ba1f71a754561abbe0a766b
[DAGCombine] Use FoldConstantArithmetic() to perform C2-(A+C1) -> (C2-C1)-A fold

Summary:
No tests change, and i'm not sure how to test this, but it's better safe than sorry.

Reviewers: spatel, RKSimon, craig.topper, t.p.northover

Reviewed By: craig.topper

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 362132
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp