[Mlir-commits] [mlir] faa30be - [mlir][Transforms] Fix build after #116524 (#121578)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri Jan 3 07:35:05 PST 2025


Author: Matthias Springer
Date: 2025-01-03T16:35:02+01:00
New Revision: faa30be101e9ae2bdb58d2acb250341f1b13031c

URL: https://github.com/llvm/llvm-project/commit/faa30be101e9ae2bdb58d2acb250341f1b13031c
DIFF: https://github.com/llvm/llvm-project/commit/faa30be101e9ae2bdb58d2acb250341f1b13031c.diff

LOG: [mlir][Transforms] Fix build after #116524 (#121578)

Fix build errors after #116524.

```
error: call of overloaded ‘TypeRange(ValueVector&)’ is ambiguous
```

Added: 
    

Modified: 
    mlir/lib/Transforms/Utils/DialectConversion.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Transforms/Utils/DialectConversion.cpp b/mlir/lib/Transforms/Utils/DialectConversion.cpp
index 0c5520988eff38..6c3863e4c7f666 100644
--- a/mlir/lib/Transforms/Utils/DialectConversion.cpp
+++ b/mlir/lib/Transforms/Utils/DialectConversion.cpp
@@ -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.
@@ -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;
 }
@@ -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.


        


More information about the Mlir-commits mailing list