From 3427d87719f11ef147b616e197623ed87d9d798b Mon Sep 17 00:00:00 2001 From: Jacques Pienaar Date: Mon, 13 May 2019 14:04:17 -0700 Subject: [PATCH] Fix -Wsign-compare in Toy LateLowering. -- PiperOrigin-RevId: 248005642 --- mlir/examples/toy/Ch5/mlir/LateLowering.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mlir/examples/toy/Ch5/mlir/LateLowering.cpp b/mlir/examples/toy/Ch5/mlir/LateLowering.cpp index 862ea21..b54c7d85 100644 --- a/mlir/examples/toy/Ch5/mlir/LateLowering.cpp +++ b/mlir/examples/toy/Ch5/mlir/LateLowering.cpp @@ -249,7 +249,7 @@ public: ScopedContext scope(rewriter, loc); MemRefView vOp(result); IndexedValue iOp(result); - for (uint64_t i = 0; i < shape[0]; ++i) { + for (uint64_t i = 0, ie = shape[0]; i < ie; ++i) { if (shape.size() == 1) { auto value = cstValue.getValue(ArrayRef{i}) .cast() @@ -257,7 +257,7 @@ public: iOp(constant_index(i)) = constant_float(value, f64Ty); continue; } - for (uint64_t j = 0; j < shape[1]; ++j) { + for (uint64_t j = 0, je = shape[1]; j < je; ++j) { auto value = cstValue.getValue(ArrayRef{i, j}) .cast() .getValue(); -- 2.7.4