[Mlir-commits] [mlir] [mlir][spirv] Add 6 Element Binary operators to TOSA Ext Inst Set (PR #179627)
Jakub Kuderski
llvmlistbot at llvm.org
Mon Feb 23 06:57:36 PST 2026
================
@@ -114,5 +116,21 @@ class TypeImpliesAccType<string input, Type type, list<string> allowedAccTypes>:
PredOpTrait<"acc_type must be one in [" # !interleave(allowedAccTypes, ",") # "] when type has value " # type.summary,
Implies<ElementTypeIsPred<input, type>, [AccTypeIn<allowedAccTypes>]>>;
+class MatchBroadcastableShapes<string input1, string input2, string output>:
+ PredOpTrait<"the shape of " # input1 # " and " # input2 # " are compatible for broadcasting and the broadcast shape is equal to the output shape",
+ Implies<And<[CPred<HasRank<input1>.result>, CPred<HasRank<input2>.result>, CPred<HasRank<output>.result>,
+ CPred<Rank<input1>.result # " == " # Rank<input2>.result # " && " # Rank<input1>.result # " == " # Rank<output>.result>]>,
+ [CPred<"llvm::all_of(llvm::zip_equal(" # Shape<input1>.result # ", " # Shape<input2>.result # ", " # Shape<output>.result # "), " #
----------------
kuhar wrote:
Have you tried using `all_of_zip`?
https://github.com/llvm/llvm-project/pull/179627
More information about the Mlir-commits
mailing list