antiagainst's fix

This commit is contained in:
Diego Caballero 2022-08-13 04:41:24 +00:00
parent 465d9084ec
commit 42d48d0966
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>>;