Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion mlir/lib/Conversion/PDLToPDLInterp/PDLToPDLInterp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -639,8 +639,13 @@ void PatternLowering::generate(SuccessNode *successNode, Block *&currentBlock) {
SymbolRefAttr PatternLowering::generateRewriter(
pdl::PatternOp pattern, SmallVectorImpl<Position *> &usedMatchValues) {
builder.setInsertionPointToEnd(rewriterModule.getBody());
// Get the pattern name if available, otherwise use default
StringRef rewriterName = "pdl_generated_rewriter";
if (auto symName = pattern.getSymName()) {
rewriterName = symName.value();
}
Comment on lines +644 to +646
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (auto symName = pattern.getSymName()) {
rewriterName = symName.value();
}
if (auto symName = pattern.getSymName())
rewriterName = symName.value();

auto rewriterFunc = pdl_interp::FuncOp::create(
builder, pattern.getLoc(), "pdl_generated_rewriter",
builder, pattern.getLoc(), rewriterName,
builder.getFunctionType({}, {}));
rewriterSymbolTable.insert(rewriterFunc);

Expand Down
Loading