File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -408,6 +408,29 @@ def heavy_MatchTailOp : HeavyOp<"match_tail", []> {
408408 ];
409409}
410410
411+ def heavy_MatchVectorOp : HeavyOp<"match_vector", []> {
412+ let description = [{
413+ Destructure a vector literal with a single, optional subpattern.
414+ The attributes $head and $tail are the number of elements before
415+ and after the subpattern P_e. If P_e does not exist then $tail is 0.
416+ The number of results are $head + $tail + 1 or $head if $tail is 0.
417+ The results are ordered (H... E_e T....) where H and T are the
418+ corresponding head and tail elements and E_e is a list of the
419+ elements to match against the subpattern.
420+ }];
421+
422+ let arguments = (ins UI32Attr:$head,
423+ UI32Attr:$tail,
424+ HeavyValue:$input);
425+ let results = (outs Variadic<HeavyValue>:$results);
426+
427+ let builders = [
428+ OpBuilder<(ins "uint32_t":$head,
429+ "uint32_t":$tail,
430+ "::mlir::Value":$input)>
431+ ];
432+ }
433+
411434def heavy_MatchArgsOp : HeavyOp<"match_args"> {
412435 let description = [{
413436 Destructure a dynamically lengthed array (ValueRefs) using the type
You can’t perform that action at this time.
0 commit comments