Skip to content

Commit 949d9d8

Browse files
[mlir][Transforms] Dialect conversion: Remove workaround
This commit removes a `FIXME` in the code base that was in place because of patterns that used the dialect conversion API incorrectly. Those patterns have been fixed and the workaround is no longer needed.
1 parent d594d9f commit 949d9d8

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

mlir/lib/Transforms/Utils/DialectConversion.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -734,11 +734,6 @@ class UnresolvedMaterializationRewrite : public OperationRewrite {
734734
return converterAndKind.getInt();
735735
}
736736

737-
/// Set the kind of this materialization.
738-
void setMaterializationKind(MaterializationKind kind) {
739-
converterAndKind.setInt(kind);
740-
}
741-
742737
/// Return the original illegal output type of the input values.
743738
Type getOrigOutputType() const { return origOutputType; }
744739

@@ -2759,22 +2754,9 @@ static void computeNecessaryMaterializations(
27592754
// TODO: Avoid materializing other types of conversions here.
27602755
}
27612756

2762-
// Check to see if this is an argument materialization.
2763-
if (llvm::any_of(op->getOperands(), llvm::IsaPred<BlockArgument>) ||
2764-
llvm::any_of(inverseMapping[op->getResult(0)],
2765-
llvm::IsaPred<BlockArgument>)) {
2766-
mat->setMaterializationKind(MaterializationKind::Argument);
2767-
}
2768-
27692757
// If the materialization does not have any live users, we don't need to
27702758
// generate a user materialization for it.
2771-
// FIXME: For argument materializations, we currently need to check if any
2772-
// of the inverse mapped values are used because some patterns expect blind
2773-
// value replacement even if the types differ in some cases. When those
2774-
// patterns are fixed, we can drop the argument special case here.
27752759
bool isMaterializationLive = isLive(opResult);
2776-
if (mat->getMaterializationKind() == MaterializationKind::Argument)
2777-
isMaterializationLive |= llvm::any_of(inverseMapping[opResult], isLive);
27782760
if (!isMaterializationLive)
27792761
continue;
27802762
if (!necessaryMaterializations.insert(mat))

0 commit comments

Comments
 (0)