[Mlir-commits] [mlir] 44bb5cd - [mlir] Fix a warning

Kazu Hirata llvmlistbot at llvm.org
Wed Jan 12 12:31:56 PST 2022


Author: Kazu Hirata
Date: 2022-01-12T12:31:43-08:00
New Revision: 44bb5cd80d08e92f1d4cf2d1447d9b16dfe8334d

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

LOG: [mlir] Fix a warning

This patch fixes:

  mlir/lib/Dialect/Arithmetic/Transforms/ExpandOps.cpp:161:52: error:
  'static_assert' with no message is a C++17 extension
  [-Werror,-Wc++17-extensions]

Added: 
    

Modified: 
    mlir/lib/Dialect/Arithmetic/Transforms/ExpandOps.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Arithmetic/Transforms/ExpandOps.cpp b/mlir/lib/Dialect/Arithmetic/Transforms/ExpandOps.cpp
index d836ae5c84f5a..7aa5ca555924d 100644
--- a/mlir/lib/Dialect/Arithmetic/Transforms/ExpandOps.cpp
+++ b/mlir/lib/Dialect/Arithmetic/Transforms/ExpandOps.cpp
@@ -158,7 +158,8 @@ struct MaxMinFOpConverter : public OpRewritePattern<OpTy> {
     Location loc = op.getLoc();
     // If any operand is NaN, 'cmp' will be true (and 'select' returns 'lhs').
     static_assert(pred == arith::CmpFPredicate::UGT ||
-                  pred == arith::CmpFPredicate::ULT);
+                  pred == arith::CmpFPredicate::ULT,
+                  "pred must be either UGT or ULT");
     Value cmp = rewriter.create<arith::CmpFOp>(loc, pred, lhs, rhs);
     Value select = rewriter.create<SelectOp>(loc, cmp, lhs, rhs);
 


        


More information about the Mlir-commits mailing list