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
8 changes: 4 additions & 4 deletions mlir/lib/Conversion/PDLToPDLInterp/PredicateTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,14 +279,14 @@ static void getConstraintPredicates(pdl::ApplyNativeConstraintOp op,
// For each result register a position so it can be used later
for (auto [i, result] : llvm::enumerate(results)) {
ConstraintQuestion *q = cast<ConstraintQuestion>(pred.first);
ConstraintPosition *pos = builder.getConstraintPosition(q, i);
auto [it, inserted] = inputs.try_emplace(result, pos);
ConstraintPosition *constraintPos = builder.getConstraintPosition(q, i);
auto [it, inserted] = inputs.try_emplace(result, constraintPos);
// If this is an input value that has been visited in the tree, add a
// constraint to ensure that both instances refer to the same value.
if (!inserted) {
Position *first = pos;
Position *first = constraintPos;
Position *second = it->second;
if (comparePosDepth(second, first))
if (comparePosDepth(second, pos))
std::tie(second, first) = std::make_pair(first, second);

predList.emplace_back(second, builder.getEqualTo(first));
Expand Down