Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle algebraic identities in PeepholeFoldConstants
In particular: x*1 -> x x-0 -> x 0-x -> -x x/1 -> x x+0 -> x An upcoming change to the Soy compiler will generate some of these trivial expressions, and while it would be easy to work around on our end it seemed like a reasonable feature for the jscompiler to handle. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=179462284
- Loading branch information
1 parent
d6a9fd1
commit f3dff41
Showing
2 changed files
with
103 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters