Skip to content

[mlir][Transforms] Fix build after #116524 #121578

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 3, 2025
Merged
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: 3 additions & 4 deletions mlir/lib/Transforms/Utils/DialectConversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ ConversionValueMapping::lookupOrDefault(Value from,
ValueVector current{from};
do {
// Store the current value if the types match.
if (TypeRange(current) == desiredTypes)
if (TypeRange(ValueRange(current)) == desiredTypes)
desiredValue = current;

// If possible, Replace each value with (one or multiple) mapped values.
Expand Down Expand Up @@ -271,9 +271,8 @@ ConversionValueMapping::lookupOrDefault(Value from,
ValueVector ConversionValueMapping::lookupOrNull(Value from,
TypeRange desiredTypes) const {
ValueVector result = lookupOrDefault(from, desiredTypes);
TypeRange resultTypes(result);
if (result == ValueVector{from} ||
(!desiredTypes.empty() && resultTypes != desiredTypes))
(!desiredTypes.empty() && TypeRange(ValueRange(result)) != desiredTypes))
return {};
return result;
}
Expand Down Expand Up @@ -1291,7 +1290,7 @@ LogicalResult ConversionPatternRewriterImpl::remapValues(
}

ValueVector repl = mapping.lookupOrDefault(operand, legalTypes);
if (!repl.empty() && TypeRange(repl) == legalTypes) {
if (!repl.empty() && TypeRange(ValueRange(repl)) == legalTypes) {
// Mapped values have the correct type or there is an existing
// materialization. Or the operand is not mapped at all and has the
// correct type.
Expand Down
Loading