[Mlir-commits] [mlir] 5f14aee - [mlir] Fix Visual Studio warnings

Stella Stamenova llvmlistbot at llvm.org
Tue May 3 14:13:39 PDT 2022


Author: Stella Stamenova
Date: 2022-05-03T14:12:15-07:00
New Revision: 5f14aee3bb53de238db8de0e7f82da49baf75dc0

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

LOG: [mlir] Fix Visual Studio warnings

There are only a couple of warnings when compiling with VS on Windows. This fixes the last remaining warnings so that we can enable LLVM_ENABLE_WERROR on the mlir windows bot.

Reviewed By: rriddle

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

Added: 
    

Modified: 
    mlir/include/mlir/Support/InterfaceSupport.h
    mlir/lib/Conversion/MathToSPIRV/MathToSPIRV.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Support/InterfaceSupport.h b/mlir/include/mlir/Support/InterfaceSupport.h
index f940241679994..7cbd18f268b65 100644
--- a/mlir/include/mlir/Support/InterfaceSupport.h
+++ b/mlir/include/mlir/Support/InterfaceSupport.h
@@ -193,6 +193,7 @@ class InterfaceMap {
 
     std::array<std::pair<TypeID, void *>, numInterfaces> elements;
     std::pair<TypeID, void *> *elementIt = elements.data();
+    (void)elementIt;
     (void)std::initializer_list<int>{
         0, (addModelAndUpdateIterator<Types>(elementIt), 0)...};
     return InterfaceMap(elements);

diff  --git a/mlir/lib/Conversion/MathToSPIRV/MathToSPIRV.cpp b/mlir/lib/Conversion/MathToSPIRV/MathToSPIRV.cpp
index 956118a5d9f77..b65042dd46c77 100644
--- a/mlir/lib/Conversion/MathToSPIRV/MathToSPIRV.cpp
+++ b/mlir/lib/Conversion/MathToSPIRV/MathToSPIRV.cpp
@@ -54,12 +54,12 @@ class CopySignPattern final : public OpConversionPattern<math::CopySignOp> {
     Location loc = copySignOp.getLoc();
     int bitwidth = floatType.getWidth();
     Type intType = rewriter.getIntegerType(bitwidth);
+    uint64_t intValue = uint64_t(1) << (bitwidth - 1);
 
     Value signMask = rewriter.create<spirv::ConstantOp>(
-        loc, intType, rewriter.getIntegerAttr(intType, (1u << (bitwidth - 1))));
+        loc, intType, rewriter.getIntegerAttr(intType, intValue));
     Value valueMask = rewriter.create<spirv::ConstantOp>(
-        loc, intType,
-        rewriter.getIntegerAttr(intType, (1u << (bitwidth - 1)) - 1u));
+        loc, intType, rewriter.getIntegerAttr(intType, intValue - 1u));
 
     if (auto vectorType = copySignOp.getType().dyn_cast<VectorType>()) {
       assert(vectorType.getRank() == 1);


        


More information about the Mlir-commits mailing list