Skip to content

[mlir] Fix integer comparison warning #144794

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 18, 2025
Merged

Conversation

dcaballe
Copy link
Contributor

Introduced by #141457

@llvmbot llvmbot added mlir:core MLIR Core Infrastructure mlir mlir:ods labels Jun 18, 2025
@llvmbot
Copy link
Member

llvmbot commented Jun 18, 2025

@llvm/pr-subscribers-mlir-ods

@llvm/pr-subscribers-mlir

Author: Diego Caballero (dcaballe)

Changes

Introduced by #141457


Full diff: https://github.com/llvm/llvm-project/pull/144794.diff

1 Files Affected:

  • (modified) mlir/include/mlir/IR/OpBase.td (+1-1)
diff --git a/mlir/include/mlir/IR/OpBase.td b/mlir/include/mlir/IR/OpBase.td
index b3fabe409806f..43ef28624fb19 100644
--- a/mlir/include/mlir/IR/OpBase.td
+++ b/mlir/include/mlir/IR/OpBase.td
@@ -566,7 +566,7 @@ class ShapedTypeMatchesElementCountAndTypes<string shapedArg,
     PredOpTrait<"shaped type '" # shapedArg # "' matches '" # elementsArg # "' "
                 "element count and types",
         And<[CPred<ElementCount<shapedArg>.result # " == "
-                     "$" # elementsArg # ".getTypes().size()">,
+                     "static_cast<int64_t>($" # elementsArg # ".getTypes().size())">,
              CPred<"::llvm::all_of($" # elementsArg # ".getTypes(), "
                      "[&](::mlir::Type t) { return t == "
                        # ElementType<shapedArg>.result # "; })">]>> {

@llvmbot
Copy link
Member

llvmbot commented Jun 18, 2025

@llvm/pr-subscribers-mlir-core

Author: Diego Caballero (dcaballe)

Changes

Introduced by #141457


Full diff: https://github.com/llvm/llvm-project/pull/144794.diff

1 Files Affected:

  • (modified) mlir/include/mlir/IR/OpBase.td (+1-1)
diff --git a/mlir/include/mlir/IR/OpBase.td b/mlir/include/mlir/IR/OpBase.td
index b3fabe409806f..43ef28624fb19 100644
--- a/mlir/include/mlir/IR/OpBase.td
+++ b/mlir/include/mlir/IR/OpBase.td
@@ -566,7 +566,7 @@ class ShapedTypeMatchesElementCountAndTypes<string shapedArg,
     PredOpTrait<"shaped type '" # shapedArg # "' matches '" # elementsArg # "' "
                 "element count and types",
         And<[CPred<ElementCount<shapedArg>.result # " == "
-                     "$" # elementsArg # ".getTypes().size()">,
+                     "static_cast<int64_t>($" # elementsArg # ".getTypes().size())">,
              CPred<"::llvm::all_of($" # elementsArg # ".getTypes(), "
                      "[&](::mlir::Type t) { return t == "
                        # ElementType<shapedArg>.result # "; })">]>> {

@dcaballe dcaballe requested a review from kazutakahirata June 18, 2025 21:09
@dcaballe dcaballe merged commit ac37a0d into llvm:main Jun 18, 2025
9 of 11 checks passed
@kazutakahirata
Copy link
Contributor

@dcaballe Thank you for fixing this quickly! I've verified the warning-free build myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mlir:core MLIR Core Infrastructure mlir:ods mlir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants