[Mlir-commits] [mlir] 06011fe - [mlir] Fix -Wsign-compare in ComplexToStandard.cpp (NFC)

Jie Fu llvmlistbot at llvm.org
Sun Nov 17 18:35:13 PST 2024


Author: Jie Fu
Date: 2024-11-18T10:34:16+08:00
New Revision: 06011fee3ae0e9683aa8dbad50bf6ae35ee27e19

URL: https://github.com/llvm/llvm-project/commit/06011fee3ae0e9683aa8dbad50bf6ae35ee27e19
DIFF: https://github.com/llvm/llvm-project/commit/06011fee3ae0e9683aa8dbad50bf6ae35ee27e19.diff

LOG: [mlir] Fix -Wsign-compare in ComplexToStandard.cpp (NFC)

/llvm-project/mlir/lib/Conversion/ComplexToStandard/ComplexToStandard.cpp:529:21:
 error: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare]
  529 |   for (int i = 1; i < coefficients.size(); ++i) {
      |                   ~ ^ ~~~~~~~~~~~~~~~~~~~
1 error generated.

Added: 
    

Modified: 
    mlir/lib/Conversion/ComplexToStandard/ComplexToStandard.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Conversion/ComplexToStandard/ComplexToStandard.cpp b/mlir/lib/Conversion/ComplexToStandard/ComplexToStandard.cpp
index 9282518191274f..807beebe4fb22a 100644
--- a/mlir/lib/Conversion/ComplexToStandard/ComplexToStandard.cpp
+++ b/mlir/lib/Conversion/ComplexToStandard/ComplexToStandard.cpp
@@ -526,7 +526,7 @@ Value evaluatePolynomial(ImplicitLocOpBuilder &b, Value arg,
   auto argType = mlir::cast<FloatType>(arg.getType());
   Value poly =
       b.create<arith::ConstantOp>(b.getFloatAttr(argType, coefficients[0]));
-  for (int i = 1; i < coefficients.size(); ++i) {
+  for (unsigned i = 1; i < coefficients.size(); ++i) {
     poly = b.create<math::FmaOp>(
         poly, arg,
         b.create<arith::ConstantOp>(b.getFloatAttr(argType, coefficients[i])),


        


More information about the Mlir-commits mailing list