Skip to content

Commit cd4ae91

Browse files
shay-klShay Kleiman
andauthored
[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 <[email protected]>
1 parent 66d1c37 commit cd4ae91

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mlir/include/mlir/IR/CommonTypeConstraints.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ class NormalizeIndex<int value> {
576576
class IsNthDimSizeIsOneOfPred<int n, list<int> allowedSizes>
577577
: And<[
578578
CPred<"::llvm::cast<::mlir::ShapedType>($_self).getRank() >= " # NormalizeIndex<n>.ret>,
579-
CPred<"::llvm::is_contained(ArrayRef<int64_t>({" # !interleave(allowedSizes, ", ") # "}), "
579+
CPred<"::llvm::is_contained(::llvm::ArrayRef<int64_t>({" # !interleave(allowedSizes, ", ") # "}), "
580580
# "::llvm::cast<::mlir::ShapedType>($_self).getDimSize("
581581
# !if(!lt(n, 0),
582582
"::llvm::cast<::mlir::ShapedType>($_self).getRank() + " # n,
@@ -585,7 +585,7 @@ class IsNthDimSizeIsOneOfPred<int n, list<int> allowedSizes>
585585

586586
// Whether the shape of a vector matches the given `shape` list.
587587
class IsVectorOfShape<list<int> shape>
588-
: CPred<"::llvm::cast<::mlir::VectorType>($_self).getShape() == ArrayRef<int64_t>({" # !interleave(shape, ", ") # "})">;
588+
: CPred<"::llvm::cast<::mlir::VectorType>($_self).getShape() == ::llvm::ArrayRef<int64_t>({" # !interleave(shape, ", ") # "})">;
589589

590590
// Any vector where the number of elements is from the given
591591
// `allowedLengths` list

0 commit comments

Comments
 (0)