Skip to content

scf.lookup

← scf dialect

Total table lookup over already-computed SSA values. The selector is an index value. The table gives sorted unique explicit case rows. default(...) gives the total fallback row. The result count is the row width, and every payload value in a column must match that column's result type.

Operation contract

Property Value
Semantic phase source structure
Traits Pure, SafeToSpeculate

Signature

Kind Name Type Cardinality Description
Operand selector index required —
Operand values any variadic —
Result results any variadic —
Attribute case_keys i64_array required Sorted unique selector values for explicit lookup cases.

Examples

%ordinal, %wgx = scf.lookup %variant {
  0 = (%gemm0, %x0),
  1 = (%gemm1, %x1)
} default(%fallback, %xf) : index, index