[mlir] Minor fixes after removing types from attributes

D130092 removed types from attributes. This patch fixes a minor
issues what was exposed when integrating that change in IREE. An
explicit cast is needed so that the template type of `makeArrayRef`
is automatically deduced.

Co-authored-by: Lei Zhang <antiagainst@google.com>

Reviewed By: Mogball

Differential Revision: https://reviews.llvm.org/D131604
This commit is contained in:
Diego Caballero 2022-08-15 18:59:42 +00:00
parent f55a6fde1d
commit e86119b4ff
1 changed files with 5 additions and 1 deletions

View File

@ -2288,7 +2288,11 @@ class ElementCount<string name> :
class ElementType<string name> : StrFunc<"getElementTypeOrSelf($" # name # ")">;
class AllMatchPred<list<string> values> :
CPred<"::llvm::is_splat({" # !interleave(values, ", ") # "})">;
CPred<!if(!lt(!size(values), 2),
"true",
!foldl("(" # !head(values) # ")", !tail(values), acc, v,
acc # " == (" # v # ") && (" # v # ")")
# " == (" # !head(values) # ")")>;
class AllMatch<list<string> values, string summary> :
PredOpTrait<summary, AllMatchPred<values>>;