summaryrefslogtreecommitdiffstats
path: root/mlir/lib/IR/Region.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [mlir] NFC: Remove Value::operator* and Value::operator-> now that Value is ↵River Riddle2020-01-111-2/+2
| | | | | | | | | | 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-1/+1
| | | | | | 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-3/+3
| | | | | | | | | | 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-2/+2
| | | | | | | | in `mlir` namespace. Aside from being cleaner, this also makes the codebase more consistent. PiperOrigin-RevId: 286206974
* Add new indexed_accessor_range_base and indexed_accessor_range classes that ↵River Riddle2019-12-091-10/+16
| | | | | | | | simplify defining index-able ranges. Many ranges want similar functionality from a range type(e.g. slice/drop_front/operator[]/etc.), so these classes provide a generic implementation that may be used by many different types of ranges. This removes some code duplication, and also empowers many of the existing range types in MLIR(e.g. result type ranges, operand ranges, ElementsAttr ranges, etc.). This change only updates RegionRange and ValueRange, more ranges will be updated in followup commits. PiperOrigin-RevId: 284615679
* Add RegionRange for when need to abstract over different region iterationJacques Pienaar2019-12-091-0/+18
| | | | | | | | | | | | Follows ValueRange in representing a generic abstraction over the different ways to represent a range of Regions. This wrapper is not as ValueRange and only considers the current cases of interest: MutableArrayRef<Region> and ArrayRef<std::unique_ptr<Region>> as occurs during op construction vs op region querying. Note: ArrayRef<std::unique_ptr<Region>> allows for unset regions, so this range returns a pointer to a Region instead of a Region. PiperOrigin-RevId: 284563229
* Replace some remnant uses of "inst" with "op".Sean Silva2019-11-061-3/+3
| | | | PiperOrigin-RevId: 278961676
* Assert that region is not cloned into itself.Christian Sigg2019-10-091-0/+1
| | | | PiperOrigin-RevId: 273707291
* Make isIsolatedAbove robuster to invalid IRJacques Pienaar2019-09-041-0/+9
| | | | | | This function is only called from the verifier. PiperOrigin-RevId: 267145495
* Refactor the 'walk' methods for operations.River Riddle2019-08-291-7/+0
| | | | | | | | | | | | This change refactors and cleans up the implementation of the operation walk methods. After this refactoring is that the explicit template parameter for the operation type is no longer needed for the explicit op walks. For example: op->walk<AffineForOp>([](AffineForOp op) { ... }); is now accomplished via: op->walk([](AffineForOp op) { ... }); PiperOrigin-RevId: 266209552
* NFC: Standardize the terminology used for parent ops/regions/etc.River Riddle2019-08-091-10/+10
| | | | | | 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
* Refactor the conversion of block argument types in DialectConversion.River Riddle2019-07-191-0/+7
| | | | | | | | This cl begins a large refactoring over how signature types are converted in the DialectConversion infrastructure. The signatures of blocks are now converted on-demand when an operation held by that block is being converted. This allows for handling the case where a region is created as part of a pattern, something that wasn't possible previously. This cl also generalizes the region signature conversion used by FuncOp to work on any region of any operation. This generalization allows for removing the 'apply*Conversion' functions that were specific to FuncOp/ModuleOp. The implementation currently uses a new hook on TypeConverter, 'convertRegionSignature', but this should ideally be removed in favor of using Patterns. That depends on adding support to the PatternRewriter used by ConversionPattern to allow applying signature conversions to regions, which should be coming in a followup. PiperOrigin-RevId: 258645733
* FuncOp::eraseBody: drop all references before erasing blocksAlex Zinenko2019-07-121-2/+6
| | | | | | | | | | Operations in a block can use a value defined in a dominating block. When a block, and therefore all its operations, is deleted, the operations are not allowed to have any remaining uses. Drop all uses of values in all blocks before deleting them in FuncOp::eraseBody to avoid deleting an operation before deleting the users of its results. PiperOrigin-RevId: 257628002
* NFC: Rename Function to FuncOp.River Riddle2019-07-101-1/+0
| | | | PiperOrigin-RevId: 257293379
* NFC: Remove Region::getContainingFunction as Functions are now Operations.River Riddle2019-07-041-11/+1
| | | | PiperOrigin-RevId: 256579717
* Replace the implementation of Function and Module with FuncOp and ModuleOp.River Riddle2019-07-031-15/+12
| | | | | | This is an important step in allowing for the top-level of the IR to be extensible. FuncOp and ModuleOp contain all of the necessary functionality, while using the existing operation infrastructure. As an interim step, many of the usages of Function and Module, including the name, will remain the same. In the future, many of these will be relaxed to allow for many different types of top-level operations to co-exist. PiperOrigin-RevId: 256427100
* NFC: Update the Operation 'walk' methods to use llvm::function_ref instead ↵River Riddle2019-07-021-1/+1
| | | | | | of std::function. PiperOrigin-RevId: 256099638
* NFC: Refactor Function to be value typed.River Riddle2019-07-011-5/+5
| | | | | | Move the data members out of Function and into a new impl storage class 'FunctionStorage'. This allows for Function to become value typed, which will greatly simplify the transition of Function to FuncOp(given that FuncOp is also value typed). PiperOrigin-RevId: 255983022
* Cleanup the 'clone' methods and remove the need to explicitly pass in the ↵River Riddle2019-06-271-6/+11
| | | | | | | | context. This also adds a new 'Region::cloneInto' method that accepts an insertion position. PiperOrigin-RevId: 255504640
* Factor Region::getUsedValuesDefinedAbove into Transforms/RegionUtilsAlex Zinenko2019-06-191-23/+9
| | | | | | | | Arguably, this function is only useful for transformations and should not pollute the main IR. Also make sure it accepts a the resulting container by-reference instead of returning it. PiperOrigin-RevId: 253622981
* Move the Region type out to its own .h/.cpp file instead of putting it intoChris Lattner2019-06-191-0/+224
Block.h/cpp. This doesn't change much but makes it easier to find. PiperOrigin-RevId: 253423041
OpenPOWER on IntegriCloud