uweigand opened issue #4426:
In implementing SIMD support for s390x, I ran into an issue with the
MachInst::gen_constantroutine that all platforms currently have to define. In a platform that otherwise fully uses ISLE for code generation, having to implement thatgen_constantroutine 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 thegen_constantroutine.Looking at the sources, it appears
gen_constantis now solely used by the commonput_value_in_regsroutine. I'm wondering if it wouldn't be better to handle constant rematerialization instead on the ISLE side, e.g. in the ISLEput_in_regsconstructor? That should hopefully allow backends to re-use the ISLE rules for constant emission they already have ...FYI @cfallin
akirilov-arm labeled issue #4426:
In implementing SIMD support for s390x, I ran into an issue with the
MachInst::gen_constantroutine that all platforms currently have to define. In a platform that otherwise fully uses ISLE for code generation, having to implement thatgen_constantroutine 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 thegen_constantroutine.Looking at the sources, it appears
gen_constantis now solely used by the commonput_value_in_regsroutine. I'm wondering if it wouldn't be better to handle constant rematerialization instead on the ISLE side, e.g. in the ISLEput_in_regsconstructor? That should hopefully allow backends to re-use the ISLE rules for constant emission they already have ...FYI @cfallin
akirilov-arm labeled issue #4426:
In implementing SIMD support for s390x, I ran into an issue with the
MachInst::gen_constantroutine that all platforms currently have to define. In a platform that otherwise fully uses ISLE for code generation, having to implement thatgen_constantroutine 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 thegen_constantroutine.Looking at the sources, it appears
gen_constantis now solely used by the commonput_value_in_regsroutine. I'm wondering if it wouldn't be better to handle constant rematerialization instead on the ISLE side, e.g. in the ISLEput_in_regsconstructor? That should hopefully allow backends to re-use the ISLE rules for constant emission they already have ...FYI @cfallin
fitzgen commented on issue #4426:
This makes sense to me; the current architecture is basically a left over of incremental migration to ISLE.
uweigand closed issue #4426:
In implementing SIMD support for s390x, I ran into an issue with the
MachInst::gen_constantroutine that all platforms currently have to define. In a platform that otherwise fully uses ISLE for code generation, having to implement thatgen_constantroutine 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 thegen_constantroutine.Looking at the sources, it appears
gen_constantis now solely used by the commonput_value_in_regsroutine. I'm wondering if it wouldn't be better to handle constant rematerialization instead on the ISLE side, e.g. in the ISLEput_in_regsconstructor? That should hopefully allow backends to re-use the ISLE rules for constant emission they already have ...FYI @cfallin
Last updated: Dec 13 2025 at 19:03 UTC