[DAGCombine] ((A-c1)+c2) -> (A+(c2-c1)) constant-fold
authorRoman Lebedev <lebedev.ri@gmail.com>
Thu, 30 May 2019 19:27:19 +0000 (19:27 +0000)
committerRoman Lebedev <lebedev.ri@gmail.com>
Thu, 30 May 2019 19:27:19 +0000 (19:27 +0000)
commitcc9a9cf2378493ac3ba1f71a754561abbe0a766b
treed42167e758ecacf6d436bd6b30ea00dfe84296b1
parentef95679741e01235c32547e5ae7f8259f703847a
[DAGCombine] ((A-c1)+c2) -> (A+(c2-c1))  constant-fold

Summary:
This was the root cause of the endless combine loop in D62257

https://rise4fun.com/Alive/d3W

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

Reviewed By: t.p.northover

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

Tags: #llvm

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

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