Skip to content

Commit c77404a

Browse files
committed
Explicitly cast int64_t to size_t.
1 parent c672ff6 commit c77404a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stablehlo/transforms/optimization/StablehloAggressiveFolder.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ struct FoldConcatenateOpPattern final
432432
if (!type.hasStaticShape()) return failure();
433433

434434
size_t numElems = type.getNumElements();
435-
if (numElems > foldOpElementLimit) return failure();
435+
if (numElems > static_cast<size_t>(foldOpElementLimit)) return failure();
436436

437437
// Fold concatenate when all inputs are constants.
438438
OperandRange inputs = op.getInputs();
@@ -829,7 +829,7 @@ struct EvalIotaOpPattern : public OpRewritePattern<IotaOp> {
829829
LLVM_DEBUG(llvm::dbgs() << "EvalIotaOpPattern folding: " << op << '\n');
830830
auto resultType = cast<RankedTensorType>(op.getType());
831831
size_t numElems = resultType.getNumElements();
832-
if (numElems > foldOpElementLimit)
832+
if (numElems > static_cast<size_t>(foldOpElementLimit))
833833
return rewriter.notifyMatchFailure(op, "too many elements to fold");
834834

835835
auto elementType = resultType.getElementType();

0 commit comments

Comments
 (0)