Stream: cranelift

Topic: PRegSet over Vec<PReg>


view this post on Zulip Kirp (May 14 2024 at 21:38):

Thanks @Jamey Sharp @Chris Fallin and @L. Pereira for your feedback on using PRegSet over Vec<PReg>: I completely understand Chris’ point that this will be completely undesirable if it leads to slowdowns in the allocator or if it requires unclear bit hacking to avoid that.

However is was wondering if it also came (inadvertently) with extra guarantees on the allocator: namely that unlike passing Vec<PReg> , the same register cannot be passed twice into (un)preferred_regs_by_class and it causes the iteration order to always be from lowest numbered to highest numbered register as opposed to relying on the order they were passed in: unclear whether this is acc desirable or not tho?

view this post on Zulip Chris Fallin (May 14 2024 at 21:40):

No, I don't think those properties are terribly important, as compared to the high-order bit of allowing random access for the randomized probe order

view this post on Zulip Jamey Sharp (May 14 2024 at 21:40):

Good question! And I'm still working on understanding how RegTraversalIter is intended to work; I think we can get the current behavior efficiently while switching to PRegSet

view this post on Zulip Chris Fallin (May 14 2024 at 21:40):

IMHO, strong disagree

view this post on Zulip Chris Fallin (May 14 2024 at 21:41):

why so strong on moving to PRegSet?

view this post on Zulip Chris Fallin (May 14 2024 at 21:41):

(how traversal is intended to work: random probe to spread out the "load" between registers; big impact on allocation perf vs. same probe order at every inst)

view this post on Zulip Chris Fallin (May 14 2024 at 21:43):

(I don't want to burn a ton of time on this, I think moving to PRegSet is a bad idea, I guess I'm just curious why the arguments I've already given are not enough)

view this post on Zulip Jamey Sharp (May 14 2024 at 21:54):

Chris and I just talked about this a little bit separately. I don't understand this part of RA2 well enough and haven't been able to spend much time on it today, which is why I haven't been able to respond to these questions. I might have answers to Chris' concerns, but he wrote most of this code so I may just be confused. I'll get back to you all as soon as I can.

view this post on Zulip Kirp (May 14 2024 at 22:15):

Chris Fallin said:

(I don't want to burn a ton of time on this, I think moving to PRegSet is a bad idea, I guess I'm just curious why the arguments I've already given are not enough)

This wasn’t supposed to be strong in favour of, I was mostly wondering if it came along with extra restrictions that were meaningfully different to the original code that I didn’t realise initially : agree with points you made on the GitHub about why it is probably not ideal thing to do


Last updated: Oct 23 2024 at 20:03 UTC