alexcrichton commented on issue #3679:
I think this path in lowering was never actually hit due to roughly this block of code. My hope was to eventually reimplement the
gen_constant
method with an ISLE-based lowering eventually but I figured it may also be pretty tricky to do so.
FreddieLiardet commented on issue #3679:
I have added some more tests for simple f32/64const cases.
I think this path in lowering was never actually hit due to roughly this block of code.
Yes I think this is the case.
cfallin commented on issue #3679:
I think this path in lowering was never actually hit due to roughly this block of code
Ah, yes, this is the bit I had forgotten... we should never see an F32const/F64const value at the top-level lowering entry point, because either it is used somewhere and rematerialized at every use, or never used and hence dropped by the implicit DCE (use-counting). The existing top-level handlers for F32const/F64const were written before the rematerialize-at-uses change was made, I think.
@FreddieLiardet given this, the change I think doesn't have to touch ISLE at all, since we haven't yet moved constant generation over. Could you:
- Remove the addition to
inst.isle
(we don't need to define variants ofMachInst
in the ISLE prelude that we don't use)- Change the F32const/F64const lowering entry points from
implemented_in_isle!()
to a panic saying something like "Should never see constant ops at top-level lowering entry point, as constants are rematerialized at use-sites"Then I think this should be good to merge -- thanks!
FreddieLiardet commented on issue #3679:
@cfallin I am unsure about the first point. Is there another place where
FpuMoveFPImm
instruction should be declared? This instruction is used throughout this change.
cfallin commented on issue #3679:
@FreddieLiardet ah, my apologies, I was out-of-sync with our transition: we had previously defined the
Inst
enum in plain Rust and declared the enum arms we needed separately in ISLE, but I had forgotten that we now generate the enum itself from ISLE. So your diff to add the instruction here is good (modulo the generated-code merge conflict, which you should be able to resolve by rebasing).
Last updated: Dec 23 2024 at 13:07 UTC