[Mlir-commits] [mlir] 451dcfa - [mlir] [VectorOps] Cleanup mask 1-d test on constants

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue Aug 18 19:40:01 PDT 2020


Author: aartbik
Date: 2020-08-18T19:39:17-07:00
New Revision: 451dcfae31ee09f4a4a40476d3f36b784273fadc

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

LOG: [mlir] [VectorOps] Cleanup mask 1-d test on constants

I forgot to address this in previous CL. Sorry about that.

Reviewed By: rriddle

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

Added: 
    

Modified: 
    mlir/lib/Dialect/Vector/VectorOps.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Vector/VectorOps.cpp b/mlir/lib/Dialect/Vector/VectorOps.cpp
index d69fe96f6a2a..a0fd7a187f13 100644
--- a/mlir/lib/Dialect/Vector/VectorOps.cpp
+++ b/mlir/lib/Dialect/Vector/VectorOps.cpp
@@ -48,10 +48,10 @@ static MaskFormat get1DMaskFormat(Value mask) {
     // when a mix is detected.
     if (auto denseElts = c.value().dyn_cast<DenseIntElementsAttr>()) {
       int64_t val = 0;
-      for (llvm::APInt b : denseElts)
-        if (b.getBoolValue() && val >= 0)
+      for (bool b : denseElts.getValues<bool>())
+        if (b && val >= 0)
           val++;
-        else if (!b.getBoolValue() && val <= 0)
+        else if (!b && val <= 0)
           val--;
         else
           return MaskFormat::Unknown;


        


More information about the Mlir-commits mailing list