It works for me?
Yeah just tried the tool myself, works there as well.
Hmm, maybe GenericFunction/GenericRegInfo isn't fully capturing the behavior of your trait implementation.
In theory it should be perfectly captured.
If you convert your trait to the generic one, does it work then?
I noticed it isn't explicitly capturing the idoms, I'll verify that mine are correct.
No even when converting to generic, still errors trying to rematerialize that %17.
So the round-trip via display/parse is hiding the issue?
Did you convert both function and reginfo?
I did not, let me do reginfo real fast too.
Nope that didn't help.
Very strange since regalloc3-tool is literally just parsing into GenericFunction/GenericRegInfo and then running with that.
I assume you're using the default options?
Yeah. My invocation looks like this:
let mut register_allocator = regalloc3::RegisterAllocator::new();
let ra_output = register_allocator.allocate_registers(
&gen_func,
&gen_reginfo,
®alloc3::Options::default(),
);
I'll try going to/from text as well as the generic function to see if that changes anything.
42 messages were moved here from #cranelift > regalloc3 benchmarks by Amanieu.
Ok that worked.
Is it the reginfo or the function that isn't round-tripping properly?
Trying that now.
It's the function. Left the reginfo alone and it worked fine.
My guess is dominators, since it is recomputed during parsing. Going to verify my dominator info is correct real fast.
I'm a bit concerned that validation isn't catching that...
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