[DAGCombine] (A+C1)-C2 -> A+(C1-C2) constant-fold
authorRoman Lebedev <lebedev.ri@gmail.com>
Thu, 30 May 2019 19:27:32 +0000 (19:27 +0000)
committerRoman Lebedev <lebedev.ri@gmail.com>
Thu, 30 May 2019 19:27:32 +0000 (19:27 +0000)
commit0a3dbbcdfb5482987125fdb8267820351d13a545
tree451eb90b2d342f21f8abdcb89ed20905c6ef5850
parent9ff3159b4aede9a53d65e67ada4a7e2ba1aaa301
[DAGCombine] (A+C1)-C2 -> A+(C1-C2) constant-fold

Summary:
Direct sibling of D62662, the root cause of the endless combine loop in D62257

https://rise4fun.com/Alive/d3W

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

Reviewed By: t.p.northover

Subscribers: t.p.northover, javed.absar, llvm-commits

Tags: #llvm

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

llvm-svn: 362133
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/AArch64/addsub-constant-folding.ll
llvm/test/CodeGen/X86/addsub-constant-folding.ll