commit | 1982afb145bcd2a4252b6bd32edd42c52effd9aa | [log] [tgz] |
---|---|---|
author | River Riddle <riverriddle@google.com> | Thu May 16 12:51:45 2019 -0700 |
committer | Mehdi Amini <joker.eph@gmail.com> | Mon May 20 13:44:24 2019 -0700 |
tree | e07d5cf9e4fe43a339f832ae30268a4c6266c52b | |
parent | 13dbad87f6890ca278dfec9c4c90668d1c01e8ef [diff] |
Unify the 'constantFold' and 'fold' hooks on an operation into just 'fold'. This new unified fold hook will take constant attributes as operands, and may return an existing 'Value *' or a constant 'Attribute' when folding. This removes the awkward situation where a simple canonicalization like "sub(x,x)->0" had to be written as a canonicalization pattern as opposed to a fold. -- PiperOrigin-RevId: 248582024