[Mlir-commits] [mlir] cd4ae91 - [mlir] Specify namespace in td file pred (#152258)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Aug 6 07:37:22 PDT 2025
Author: Shay Kleiman
Date: 2025-08-06T16:37:18+02:00
New Revision: cd4ae911eb4fa3050ada5d0016ec822345fab2ee
URL: https://github.com/llvm/llvm-project/commit/cd4ae911eb4fa3050ada5d0016ec822345fab2ee
DIFF: https://github.com/llvm/llvm-project/commit/cd4ae911eb4fa3050ada5d0016ec822345fab2ee.diff
LOG: [mlir] Specify namespace in td file pred (#152258)
Lack of llvm namespace here caused an "'ArrayRef' was not declared in
this scope" error when using the ShapedTypeWithNthDimOfSize pred in a td
file. Explicitly specifying it fixes it.
Co-authored-by: Shay Kleiman <shay.kleiman at mobileye.com>
Added:
Modified:
mlir/include/mlir/IR/CommonTypeConstraints.td
Removed:
################################################################################
diff --git a/mlir/include/mlir/IR/CommonTypeConstraints.td b/mlir/include/mlir/IR/CommonTypeConstraints.td
index 45ec1846580f2..b682f4c025a46 100644
--- a/mlir/include/mlir/IR/CommonTypeConstraints.td
+++ b/mlir/include/mlir/IR/CommonTypeConstraints.td
@@ -576,7 +576,7 @@ class NormalizeIndex<int value> {
class IsNthDimSizeIsOneOfPred<int n, list<int> allowedSizes>
: And<[
CPred<"::llvm::cast<::mlir::ShapedType>($_self).getRank() >= " # NormalizeIndex<n>.ret>,
- CPred<"::llvm::is_contained(ArrayRef<int64_t>({" # !interleave(allowedSizes, ", ") # "}), "
+ CPred<"::llvm::is_contained(::llvm::ArrayRef<int64_t>({" # !interleave(allowedSizes, ", ") # "}), "
# "::llvm::cast<::mlir::ShapedType>($_self).getDimSize("
# !if(!lt(n, 0),
"::llvm::cast<::mlir::ShapedType>($_self).getRank() + " # n,
@@ -585,7 +585,7 @@ class IsNthDimSizeIsOneOfPred<int n, list<int> allowedSizes>
// Whether the shape of a vector matches the given `shape` list.
class IsVectorOfShape<list<int> shape>
- : CPred<"::llvm::cast<::mlir::VectorType>($_self).getShape() == ArrayRef<int64_t>({" # !interleave(shape, ", ") # "})">;
+ : CPred<"::llvm::cast<::mlir::VectorType>($_self).getShape() == ::llvm::ArrayRef<int64_t>({" # !interleave(shape, ", ") # "})">;
// Any vector where the number of elements is from the given
// `allowedLengths` list
More information about the Mlir-commits
mailing list