[Mlir-commits] [mlir] 5b0863f - [mlir][tosa] Bitwidth mismatch should be long-long not long

Rob Suderman llvmlistbot at llvm.org
Wed Aug 31 16:05:14 PDT 2022


Author: Rob Suderman
Date: 2022-08-31T16:02:33-07:00
New Revision: 5b0863f3ef9ed967794a6a135e60ea72ef6304cf

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

LOG: [mlir][tosa] Bitwidth mismatch should be long-long not long

Reviewed By: scotttodd

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

Added: 
    

Modified: 
    mlir/lib/Dialect/Tosa/IR/TosaCanonicalizations.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Tosa/IR/TosaCanonicalizations.cpp b/mlir/lib/Dialect/Tosa/IR/TosaCanonicalizations.cpp
index 04fb3ca79a6f..385e4068011f 100644
--- a/mlir/lib/Dialect/Tosa/IR/TosaCanonicalizations.cpp
+++ b/mlir/lib/Dialect/Tosa/IR/TosaCanonicalizations.cpp
@@ -610,7 +610,7 @@ OpFoldResult MulOp::fold(ArrayRef<Attribute> operands) {
     if (val.isZero())
       return lhsAttr;
     const int64_t shift = getShift();
-    const int64_t shifted = 1L << shift;
+    const int64_t shifted = 1LL << shift;
     if (val.getSExtValue() == shifted)
       return rhs;
   }
@@ -618,7 +618,7 @@ OpFoldResult MulOp::fold(ArrayRef<Attribute> operands) {
   if (rhsAttr && rhsAttr.isSplat() && resultETy.isa<IntegerType>()) {
     auto val = rhsAttr.getSplatValue<APInt>();
     const int64_t shift = getShift();
-    const int64_t shifted = 1L << shift;
+    const int64_t shifted = 1LL << shift;
     if (val.isZero())
       return rhsAttr;
     if (val.getSExtValue() == shifted)


        


More information about the Mlir-commits mailing list