Get the input as one of two options other than a direct register: - An instruction, given that it is effect-free or able to sink its effect to the current instruction being lowered, and given it has only one output, and if effect-ful, given that this is the only use; - A constant, if the value is a constant. The instruction input may be available in either of these forms. It may be available in
(&self, ir_inst: Inst, idx: usize)
| 1497 | /// instruction's result(s) must have *no* uses remaining, because it will |
| 1498 | /// not be codegen'd (it has been integrated into the current instruction). |
| 1499 | pub fn input_as_value(&self, ir_inst: Inst, idx: usize) -> Value { |
| 1500 | let val = self.f.dfg.inst_args(ir_inst)[idx]; |
| 1501 | debug_assert!(self.f.dfg.value_is_real(val)); |
| 1502 | val |
| 1503 | } |
| 1504 | |
| 1505 | /// Resolves a particular input of an instruction to the `Value` that it is |
| 1506 | /// represented with. |
no test coverage detected