pub fn lower_vector_inst(
inst: Inst,
func: &Function,
value_map: &HashMap<Value, LoweredValueId>,
next_value_id: &mut LoweredValueId,
) -> Option<LoweredOp>Expand description
Lower a single vector-family Cranelift instruction to a
LoweredOp.
Returns None if inst is not one of the opcodes handled by this
family (see the module-level table) or if
it is one of those opcodes but applied to a scalar type (e.g. scalar
fmin). In both cases the caller is expected to route the
instruction to the appropriate sibling family.
The function:
- Inspects
func.dfg.insts[inst]to read the opcode and operands. - Maps each Cranelift
Valueoperand throughvalue_mapto its pre-assignedLoweredValueId. - Allocates a fresh result id from
next_value_idand constructs the matchingLoweredOpvariant.
value_map is not mutated here — the caller is responsible for
inserting the new instruction’s result after the returned op is
pushed into a block (the caller has the Cranelift Value for the
result; we only see the id we allocated).