Stream: cranelift

Topic: regalloc3 debugging


view this post on Zulip Amanieu (Jun 27 2025 at 16:08):

It works for me?

view this post on Zulip Leaves (Jun 27 2025 at 16:09):

Yeah just tried the tool myself, works there as well.

view this post on Zulip Amanieu (Jun 27 2025 at 16:10):

Hmm, maybe GenericFunction/GenericRegInfo isn't fully capturing the behavior of your trait implementation.

view this post on Zulip Amanieu (Jun 27 2025 at 16:10):

In theory it should be perfectly captured.

view this post on Zulip Amanieu (Jun 27 2025 at 16:10):

If you convert your trait to the generic one, does it work then?

view this post on Zulip Leaves (Jun 27 2025 at 16:10):

I noticed it isn't explicitly capturing the idoms, I'll verify that mine are correct.

view this post on Zulip Leaves (Jun 27 2025 at 16:12):

No even when converting to generic, still errors trying to rematerialize that %17.

view this post on Zulip Amanieu (Jun 27 2025 at 16:13):

So the round-trip via display/parse is hiding the issue?

view this post on Zulip Amanieu (Jun 27 2025 at 16:13):

Did you convert both function and reginfo?

view this post on Zulip Leaves (Jun 27 2025 at 16:13):

I did not, let me do reginfo real fast too.

view this post on Zulip Leaves (Jun 27 2025 at 16:15):

Nope that didn't help.

view this post on Zulip Amanieu (Jun 27 2025 at 16:16):

Very strange since regalloc3-tool is literally just parsing into GenericFunction/GenericRegInfo and then running with that.

view this post on Zulip Amanieu (Jun 27 2025 at 16:16):

I assume you're using the default options?

view this post on Zulip Leaves (Jun 27 2025 at 16:16):

Yeah. My invocation looks like this:

let mut register_allocator = regalloc3::RegisterAllocator::new();

        let ra_output = register_allocator.allocate_registers(
            &gen_func,
            &gen_reginfo,
            &regalloc3::Options::default(),
        );

view this post on Zulip Leaves (Jun 27 2025 at 16:17):

I'll try going to/from text as well as the generic function to see if that changes anything.

view this post on Zulip Notification Bot (Jun 27 2025 at 16:18):

42 messages were moved here from #cranelift > regalloc3 benchmarks by Amanieu.

view this post on Zulip Leaves (Jun 27 2025 at 16:22):

Ok that worked.

view this post on Zulip Amanieu (Jun 27 2025 at 16:22):

Is it the reginfo or the function that isn't round-tripping properly?

view this post on Zulip Leaves (Jun 27 2025 at 16:23):

Trying that now.

view this post on Zulip Leaves (Jun 27 2025 at 16:23):

It's the function. Left the reginfo alone and it worked fine.

view this post on Zulip Leaves (Jun 27 2025 at 16:24):

My guess is dominators, since it is recomputed during parsing. Going to verify my dominator info is correct real fast.

view this post on Zulip Amanieu (Jun 27 2025 at 16:26):

I'm a bit concerned that validation isn't catching that...

view this post on Zulip Chris Fallin (Jun 27 2025 at 16:26):

I suppose this is really getting away from cranelift/regalloc2 talk now

Indeed -- happy to see compilers discussion in general, but perhaps this would best be moved to an issue thread on the regalloc3 repo?

It will become Cranelift-relevant if/when someone does the work to move Cranelift over, show the benefit, and land it; right now it's not a Bytecode Alliance project though and it may be best to move the discussion to a more local place. (I am in particular wanting to make sure there's no confusion for folks hanging around our chat platforms -- the BA stack still runs on RA2 and RA3 is not set as a definite plan, despite its name, until the above work makes it so)


Last updated: Dec 06 2025 at 07:03 UTC