julian-seward1 commented on Issue #2483:
@cfallin regarding the coalescing problem, I'm aware of a shortcoming that is probably what you are seeing. This was as a result of a test case that @bnjbvr had a couple of months back.
The problem is that, although the coalescer propagates "we all want to ride together in the same real reg please!" constraints along arbitrarily long chains of virtualreg-to-virtualreg assignments, it doesn't do that for virtualreg-realreg or realreg-virtualreg assignments. In such cases it only does a one-step propagation, which is sufficient for most purposes. Consequently, in a case such as
vreg2 := vreg1 rreg := vreg2it will correctly conclude that
vreg2should be inrreg, but that constraint doesn't get propagated back tovreg1. This is by accident, not by design.This is no doubt fixable, but I'd have to page in a ton of stuff, so won't happen at least in the short term. The real concern is not that it isn't fixable or is hard to fix, but rather that fixing it might make the coalescer slower in some cases.
cfallin commented on Issue #2483:
@julian-seward1 thanks for the details -- this will be useful if/when I jump into regalloc to handle this case in the future :-) It doesn't seem to be a huge deal at the moment, at least informally while staring at code.
Last updated: Jan 09 2026 at 13:15 UTC