Skip to content

Commit

Permalink
fix warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxlonelyeagle committed Feb 6, 2024
1 parent d1b68d7 commit 8490fcf
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions stablehlo/transforms/StablehloAggressiveSimplification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,7 @@ constexpr int64_t kFoldOpEltLimit = 65536;

static bool isIotaRange(ArrayRef<int64_t> dims) {
for (auto [idx, value] : llvm::enumerate(dims)) {
if (idx != value) {
return false;
}
}

return true;
}

static bool isIotaRange(ElementsAttr attr) {
auto elems = attr.tryGetValues<APInt>();
if (!elems) return false;

for (auto [idx, value] : llvm::enumerate(*elems)) {
if (idx != value) {
if (static_cast<int64_t>(idx) != value) {
return false;
}
}
Expand Down Expand Up @@ -689,7 +676,8 @@ struct DynamicBroadcastInDimAllDimsNonExpanding final
}

if (!op.getKnownNonexpandingDimensions() ||
op.getKnownNonexpandingDimensions()->size() != resultType.getRank()) {
static_cast<int64_t>(op.getKnownNonexpandingDimensions()->size()) !=
resultType.getRank()) {
return rewriter.notifyMatchFailure(
op, "known_nonexpanding_dimensions don't cover all output dims");
}
Expand Down

0 comments on commit 8490fcf

Please sign in to comment.