HomePhabricator

[DAGCombiner][X86][AArch64] (x - C) + y -> (x + y) - C fold

Authored by lebedev.ri on May 28 2019, 10:54 AM.

Description

[DAGCombiner][X86][AArch64] (x - C) + y -> (x + y) - C fold

Summary:
Only vector tests are being affected here,
since subtraction by scalar constant is rewritten
as addition by negated constant.

No surprising test changes.

https://rise4fun.com/Alive/pbT

Reviewers: RKSimon, craig.topper, spatel

Reviewed By: RKSimon

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

Tags: #llvm

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

llvm-svn: 361854