riscv64: remove valueregs_2_reg extractor. (#5426)
This extractor had a side-effect of invoking `put_in_regs`, which is not supposed to be invoked until the pattern-matching commits to evaluating a rule right-hand side (i.e., cannot backtrack). In this case the side-effect was mostly benign (in theory it could have caused additional values to be computed needlessly), but in general we should be careful to keep side-effects out of the left-hand side to enable further optimizations and work on islec. The implicit conversion from `Value` to `Reg` turns out to be enough to make the rules in question work, so we can simply remove the use of the extractor in this case.
This commit is contained in:
@@ -315,10 +315,6 @@ impl generated_code::Context for IsleContext<'_, '_, MInst, Flags, IsaFlags, 6>
|
||||
self.isa_flags.has_zbkb()
|
||||
}
|
||||
|
||||
fn valueregs_2_reg(&mut self, val: Value) -> Reg {
|
||||
self.put_in_regs(val).regs()[0]
|
||||
}
|
||||
|
||||
fn inst_output_get(&mut self, x: InstOutput, index: u8) -> ValueRegs {
|
||||
x[index as usize]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user