HomePhabricator

[MLIR] Add a switch operation to the standard dialect

Authored by GMNGeoffrey on Apr 12 2021, 5:01 PM.

Description

[MLIR] Add a switch operation to the standard dialect

This is similar to the definition of llvm.switch, providing
unstructured branch-based control flow. It differs from the LLVM
operation in that it accepts any signless integer (not only an i32),
takes no branch weights (the same as the Branch and CondBranch ops),
and has a slightly different syntax for the default case that includes
it in the list of cases with an explicit default keyword.

Also included are several canonicalizers.

See https://llvm.discourse.group/t/rfc-add-std-switch-and-scf-switch/3090

Reviewed By: rriddle, bondhugula

Differential Revision: https://reviews.llvm.org/D99925

Details

Committed
GMNGeoffreyMon, Apr 12, 6:46 PM
Reviewer
rriddle
Differential Revision
D99925: [MLIR] Add a switch operation to the standard dialect
Parents
rGd926498d9feb: [gn build] Port e96df3e531f5
Branches
Unknown
Tags
Unknown