Hi, >> It's also said that chosen alternatives might be the reason that >> rematerialization >> is not choosen and alternatives are chosen based on reload heuristics, not >> based >> on actual costs. > > Thanks for the pointer. Yeah, it'd be interesting to know if this > is the same issue, although I fear the only way of knowing for sure > is to fix it first and see whether both targets benefit. ;-)
I don't believe this is the same issue - there are lots of register allocation problems indeed, many are caused by the complex design. All the alternatives and register classes create a huge crossproduct, making it almost impossible to make good allocation decisions even if they were accurately costed. I've found that the correct way to deal with this is to reduce all this choice as much as possible. That means splitting instructions into simpler ones with fewer alternatives and register classes. You also need to block it from treating all register classes as equivalent - on AArch64 we had to force floating point values to be allocated to floating point registers (which is obviously how any register allocator should work by default), but maybe x86 doesn't do that yet. Cheers, Wilco