diff options
-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. |