[Mlir-commits] [mlir] 2f8b454 - [mlir] Fix assert on signed integer type in EDSC

Diego Caballero llvmlistbot at llvm.org
Tue Apr 14 16:05:11 PDT 2020


Author: Adam Straw
Date: 2020-04-15T02:04:49+03:00
New Revision: 2f8b4545f4960778e37114c024073d208751ca89

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

LOG: [mlir] Fix assert on signed integer type in EDSC

Integer type in Std dialect is signless so we should be checking
for signless integer type instead of signed integer type in EDSC.

Differential Revision: https://reviews.llvm.org/D78144

Added: 
    

Modified: 
    mlir/lib/Dialect/Affine/EDSC/Builders.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Affine/EDSC/Builders.cpp b/mlir/lib/Dialect/Affine/EDSC/Builders.cpp
index 06f88dcec1be..bc4dca225cbf 100644
--- a/mlir/lib/Dialect/Affine/EDSC/Builders.cpp
+++ b/mlir/lib/Dialect/Affine/EDSC/Builders.cpp
@@ -156,7 +156,7 @@ static ValueHandle createBinaryHandle(
     return createBinaryHandle<FOp>(lhs, rhs);
   } else if (thisType.isa<VectorType>() || thisType.isa<TensorType>()) {
     auto aggregateType = thisType.cast<ShapedType>();
-    if (aggregateType.getElementType().isSignedInteger())
+    if (aggregateType.getElementType().isSignlessInteger())
       return createBinaryHandle<IOp>(lhs, rhs);
     else if (aggregateType.getElementType().isa<FloatType>())
       return createBinaryHandle<FOp>(lhs, rhs);
@@ -225,7 +225,7 @@ static ValueHandle createIComparisonExpr(CmpIPredicate predicate,
   (void)lhsType;
   (void)rhsType;
   assert(lhsType == rhsType && "cannot mix types in operators");
-  assert((lhsType.isa<IndexType>() || lhsType.isSignedInteger()) &&
+  assert((lhsType.isa<IndexType>() || lhsType.isSignlessInteger()) &&
          "only integer comparisons are supported");
 
   auto op = ScopedContext::getBuilder().create<CmpIOp>(


        


More information about the Mlir-commits mailing list