llvm-project/mlir/lib/IR
Alex Zinenko 3ccf4a5bd1 [mlir] ensureRegionTerminator: take OpBuilder
The SingleBlockImplicitTerminator op trait provides a function
`ensureRegionTerminator` that injects an appropriate terminator into the block
if necessary, which is used during operation constructing and parsing.
Currently, this function directly modifies the IR using low-level APIs on
Operation and Block. If this function is called from a conversion pattern,
these manipulations are not reflected in the ConversionPatternRewriter and thus
cannot be undone or, worse, lead to tricky memory errors and malformed IR.
Change `ensureRegionTerminator` to take an instance of `OpBuilder` instead of
`Builder`, and use it to construct the block and the terminator when required.
Maintain overloads taking an instance of `Builder` and creating a simple
`OpBuilder` to use in parsers, which don't have an `OpBuilder` and cannot
interact with the dialect conversion mechanism. This change was one of the
reasons to make `<OpTy>::build` accept an `OpBuilder`.

Differential Revision: https://reviews.llvm.org/D80138
2020-05-20 16:14:46 +02:00
..
AffineExpr.cpp [mlir][NFC] Remove the STLExtras.h header file now that it has been merged into LLVM. 2020-04-14 15:14:41 -07:00
AffineExprDetail.h Mass update the MLIR license header to mention "Part of the LLVM project" 2020-01-26 03:58:30 +00:00
AffineMap.cpp Mark AffineMap::replaceDimsAndSymbols as const (NFC) 2020-05-20 03:11:41 +00:00
AffineMapDetail.h Mass update the MLIR license header to mention "Part of the LLVM project" 2020-01-26 03:58:30 +00:00
AsmPrinter.cpp [mlir][DenseElementsAttr] Add support for opaque APFloat/APInt complex values. 2020-05-05 12:42:37 -07:00
AttributeDetail.h [mlir][DenseElementsAttr] Add support for opaque APFloat/APInt complex values. 2020-05-05 12:42:37 -07:00
Attributes.cpp [mlir] Add NamedAttrList 2020-05-07 12:33:36 -07:00
Block.cpp [mlir][Standard] Add a canonicalization to simplify cond_br when the successors are identical 2020-04-23 04:42:02 -07:00
Builders.cpp [MLIR] Add helper functions for common integer types 2020-05-19 11:42:41 +00:00
CMakeLists.txt [MLIR] Fix linkage for libMLIR.so 2020-05-17 13:46:52 -07:00
Diagnostics.cpp [SourceMgr/MLIR diagnostics] Introduce a new method to speed things up 2020-04-25 14:06:44 -07:00
Dialect.cpp [mlir][NFC] Refactor ClassID into a TypeID class. 2020-04-10 23:52:33 -07:00
Dominance.cpp [MLIR] Allow unreachable blocks to violate dominance property. 2020-05-15 10:31:57 -07:00
Function.cpp [mlir] Add NamedAttrList 2020-05-07 12:33:36 -07:00
FunctionImplementation.cpp [mlir] Add NamedAttrList 2020-05-07 12:33:36 -07:00
IntegerSet.cpp [MLIR][NFC] drop some unnecessary includes 2020-03-27 09:17:27 +05:30
IntegerSetDetail.h Mass update the MLIR license header to mention "Part of the LLVM project" 2020-01-26 03:58:30 +00:00
Location.cpp [mlir][NFC] Refactor ClassID into a TypeID class. 2020-04-10 23:52:33 -07:00
LocationDetail.h [mlir][NFC] Refactor ClassID into a TypeID class. 2020-04-10 23:52:33 -07:00
MLIRContext.cpp [mlir] Add NamedAttrList 2020-05-07 12:33:36 -07:00
Module.cpp Rename NamedAttributeList to MutableDictionaryAttr 2020-04-29 14:58:02 -07:00
Operation.cpp [mlir] ensureRegionTerminator: take OpBuilder 2020-05-20 16:14:46 +02:00
OperationSupport.cpp [mlir] NFC - Fix OperationSupport.cpp::findNamedAttr 2020-05-18 09:36:00 -04:00
PatternMatch.cpp [MLIR] Add pattern rewriter util to erase block; remove dead else 2020-04-05 19:24:43 +05:30
Region.cpp [mlir][IR] Add a Region::getOps method that returns a range of immediately nested operations 2020-05-04 17:46:25 -07:00
StandardTypes.cpp [mlir][Linalg] Start a LinalgToStandard pass and move conversion to library calls. 2020-05-15 00:24:03 -04:00
SymbolTable.cpp [mlir] Add NamedAttrList 2020-05-07 12:33:36 -07:00
TypeDetail.h [mlir] Add a signedness semantics bit to IntegerType 2020-02-21 09:16:54 -05:00
TypeUtilities.cpp Eliminate all uses of Identifier::is() in the source tree, this doesn't remove the definition of it (yet). NFC. 2020-04-13 11:49:31 -07:00
Types.cpp [mlir] Refactor the structure of the 'verifyConstructionInvariants' methods. 2020-02-20 10:37:52 -08:00
Value.cpp [mlir] Add support for merging identical blocks during canonicalization 2020-05-04 19:56:46 -07:00
Verifier.cpp [MLIR] Allow unreachable blocks to violate dominance property. 2020-05-15 10:31:57 -07:00
Visitors.cpp Mass update the MLIR license header to mention "Part of the LLVM project" 2020-01-26 03:58:30 +00:00