[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
Loading
Please sign in to comment