Skip to content

MachInst::gen_constant should no longer be needed #4426

@uweigand

Description

@uweigand

In implementing SIMD support for s390x, I ran into an issue with the MachInst::gen_constant routine that all platforms currently have to define. In a platform that otherwise fully uses ISLE for code generation, having to implement that gen_constant routine is annoying, since to achive full performance, we'd really have to duplicate all the various ways to optimally generate each particular constant. Specifically vector constants, which I've now added, would have required significantly extending the gen_constant routine.

Looking at the sources, it appears gen_constant is now solely used by the common put_value_in_regs routine. I'm wondering if it wouldn't be better to handle constant rematerialization instead on the ISLE side, e.g. in the ISLE put_in_regs constructor? That should hopefully allow backends to re-use the ISLE rules for constant emission they already have ...

FYI @cfallin

Metadata

Metadata

Assignees

No one assigned

    Labels

    craneliftIssues related to the Cranelift code generatorcranelift:area:machinstIssues related to instruction selection and the new MachInst backend.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions