Commit 1279bb10 authored by Justin Lebar's avatar Justin Lebar Committed by TensorFlower Gardener
Browse files

[XLA] Add reassociation rule for adds, and add canonicalization rules for add/sub of a constant.

This patch adds a new algebraic simplification:

* (A + C0) + C1 => A + (C0 + C1), where C0 and C1 are constants.  This
  allows us to constant-fold C0 + C1.

In service of this rule, this patch also adds two new canonicalizations:

* Const + A => A + Const
* A - Const => A + (-1 * Const)

PiperOrigin-RevId: 179731747
parent bd9f9d71
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment