scf.select
← scf dialect
Select between two same-typed SSA values using a scalar i1 condition. This is whole-value selection: if the selected values are vectors or tiles, the entire aggregate is chosen as one value. Lanewise vector masking remains vector.select.
Operation contract
| Property |
Value |
| Semantic phase |
executable |
| Traits |
Pure, SafeToSpeculate, DistributionTransfer |
Signature
| Kind |
Name |
Type |
Cardinality |
Description |
| Operand |
condition |
i1 |
required |
— |
| Operand |
true_value |
any |
required |
— |
| Operand |
false_value |
any |
required |
— |
| Result |
result |
any |
required |
— |
Verification constraints
SameType(true_value, false_value, result)
Examples
%r = scf.select %cond, %a, %b : f32
%v = scf.select %cond, %then_vec, %else_vec : vector<16xf32>