diff options
author | River Riddle <riddleriver@gmail.com> | 2021-07-27 23:58:28 +0000 |
---|---|---|
committer | River Riddle <riddleriver@gmail.com> | 2021-07-27 23:59:14 +0000 |
commit | 6b4ce5fd52e03dc2a5dcf0930353c021a48605bb (patch) | |
tree | 63aa8adbe49745dc7858ab88269a7371eff30de0 /mlir | |
parent | ec1a49170129ddb62f268ff0b3f12b3d09987a7e (diff) | |
download | llvm-6b4ce5fd52e03dc2a5dcf0930353c021a48605bb.tar.gz |
[PDL] Fix the builders for OperationOp and PatternOp
Diffstat (limited to 'mlir')
-rw-r--r-- | mlir/include/mlir/Dialect/PDL/IR/PDLOps.td | 2 | ||||
-rw-r--r-- | mlir/lib/Dialect/PDL/IR/PDL.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/mlir/include/mlir/Dialect/PDL/IR/PDLOps.td b/mlir/include/mlir/Dialect/PDL/IR/PDLOps.td index 5735e1467255..832cc461da2a 100644 --- a/mlir/include/mlir/Dialect/PDL/IR/PDLOps.td +++ b/mlir/include/mlir/Dialect/PDL/IR/PDLOps.td @@ -383,7 +383,7 @@ def PDL_OperationOp CArg<"ArrayRef<StringRef>", "llvm::None">:$attrNames, CArg<"ValueRange", "llvm::None">:$attrValues, CArg<"ValueRange", "llvm::None">:$resultTypes), [{ - auto nameAttr = name ? StringAttr() : $_builder.getStringAttr(*name); + auto nameAttr = name ? $_builder.getStringAttr(*name) : StringAttr(); build($_builder, $_state, $_builder.getType<OperationType>(), nameAttr, operandValues, attrValues, $_builder.getStrArrayAttr(attrNames), resultTypes); diff --git a/mlir/lib/Dialect/PDL/IR/PDL.cpp b/mlir/lib/Dialect/PDL/IR/PDL.cpp index 3cb5b1bd0d08..39c25c31f152 100644 --- a/mlir/lib/Dialect/PDL/IR/PDL.cpp +++ b/mlir/lib/Dialect/PDL/IR/PDL.cpp @@ -286,7 +286,7 @@ void PatternOp::build(OpBuilder &builder, OperationState &state, rootKind ? builder.getStringAttr(*rootKind) : StringAttr(), builder.getI16IntegerAttr(benefit ? *benefit : 0), name ? builder.getStringAttr(*name) : StringAttr()); - builder.createBlock(state.addRegion()); + state.regions[0]->emplaceBlock(); } /// Returns the rewrite operation of this pattern. |