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:
Chris Fallin
2022-12-13 11:47:20 -08:00
committed by GitHub
parent a76e0e8aa5
commit 92ce79366c
4 changed files with 44 additions and 53 deletions

View File

@@ -1366,11 +1366,6 @@
(load_imm12 x)
(alu_rr_imm12 (AluOPRRI.Addi) (zero_reg) (imm12_const x)))
;; Let me always get low part of ValueRegs.
;; Sometimes I only need lowest bits, like `I8 << I128`.
(decl valueregs_2_reg (Reg) Value)
(extern extractor infallible valueregs_2_reg valueregs_2_reg)
(decl lower_cls_i128 (ValueRegs) ValueRegs)
(rule
(lower_cls_i128 x)