summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Transforms/Utils/FoldUtils.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [mlir] NFC: Remove Value::operator* and Value::operator-> now that Value is ↵River Riddle2020-01-111-3/+3
| | | | | | | | | | properly value-typed. Summary: These were temporary methods used to simplify the transition. Reviewed By: antiagainst Differential Revision: https://reviews.llvm.org/D72548
* NFC: Replace ValuePtr with Value and remove it now that Value is value-typed.River Riddle2019-12-231-3/+3
| | | | | | ValuePtr was a temporary typedef during the transition to a value-typed Value. PiperOrigin-RevId: 286945714
* Adjust License.txt file to use the LLVM licenseMehdi Amini2019-12-231-13/+4
| | | | PiperOrigin-RevId: 286906740
* NFC: Introduce new ValuePtr/ValueRef typedefs to simplify the transition to ↵River Riddle2019-12-221-4/+4
| | | | | | | | | | Value being value-typed. This is an initial step to refactoring the representation of OpResult as proposed in: https://groups.google.com/a/tensorflow.org/g/mlir/c/XXzzKhqqF_0/m/v6bKb08WCgAJ This change will make it much simpler to incrementally transition all of the existing code to use value-typed semantics. PiperOrigin-RevId: 286844725
* NFC: Remove unnecessary 'llvm::' prefix from uses of llvm symbols declared ↵River Riddle2019-12-181-4/+3
| | | | | | | | in `mlir` namespace. Aside from being cleaner, this also makes the codebase more consistent. PiperOrigin-RevId: 286206974
* Add a new dialect interface for the OperationFolder `OpFolderDialectInterface`.River Riddle2019-09-011-5/+13
| | | | | | This interface will allow for providing hooks to interrop with operation folding. The first hook, 'shouldMaterializeInto', will allow for controlling which region to insert materialized constants into. The folder will generally materialize constants into the top-level isolated region, this allows for materializing into a lower level ancestor region if it is more profitable/correct. PiperOrigin-RevId: 266702972
* NFC: Move LLVMIR, SDBM, and StandardOps to the Dialect/ directory.River Riddle2019-08-191-1/+1
| | | | PiperOrigin-RevId: 264193915
* NFC: Standardize the terminology used for parent ops/regions/etc.River Riddle2019-08-091-2/+2
| | | | | | There are currently several different terms used to refer to a parent IR unit in 'get' methods: getParent/getEnclosing/getContaining. This cl standardizes all of these methods to use 'getParent*'. PiperOrigin-RevId: 262680287
* NFC: Remove Region::getContainingFunction as Functions are now Operations.River Riddle2019-07-041-3/+2
| | | | PiperOrigin-RevId: 256579717
* Update the OperationFolder to find a valid insertion point when ↵River Riddle2019-06-251-41/+58
| | | | | | | | materializing constants. The OperationFolder currently just inserts into the entry block of a Function, but regions may be isolated above, i.e. explicit capture only, and blindly inserting constants may break the invariants of these regions. PiperOrigin-RevId: 254987796
* Add a new dialect hook 'materializeConstant' to create a constant operation ↵River Riddle2019-06-221-78/+119
| | | | | | that materializes an attribute value with the given type. This effectively adds support for dialect specific constant values that have different invariants than std.constant. 'OperationFolder' is updated to use this new hook, or attempt to default to std.constant when legal. PiperOrigin-RevId: 254570153
* Add utility 'create' methods to OperationFolder that will create an ↵River Riddle2019-06-091-1/+1
| | | | | | operation with a given OpBuilder and automatically try to fold it, similarly to OpBuilder::createOrFold. The difference here is that these methods enable folding to constants in addition to existing values. This functionality is then used to replace linalg::FunctionConstants. PiperOrigin-RevId: 251716247
* NFC: Rename FuncBuilder to OpBuilder and refactor to take a top level region ↵River Riddle2019-06-091-1/+1
| | | | | | instead of a function. PiperOrigin-RevId: 251563898
* NFC: Rename FoldHelper to OperationFolder and split a large function in two.River Riddle2019-06-091-27/+48
| | | | PiperOrigin-RevId: 251485843
* Unify the 'constantFold' and 'fold' hooks on an operation into just ↵River Riddle2019-05-201-0/+170
'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
OpenPOWER on IntegriCloud