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
21 files changed
tree: e07d5cf9e4fe43a339f832ae30268a4c6266c52b
  1. mlir/