Hi Richard, 在 2023/3/16 15:57, Richard Biener 写道: > I'm not sure if careful constraints massaging like adding magic letters to > alternatives with constants to pessimize them for LRA, making them > more expensive than spilling the constant to a register but avoid > secondary reloads with spilling a register to the stack to make room > for the constant, is possible - but in theory a special constraint modifier > for this purpose could be invented.
I have made some tests on constraint modifiers. They all seems not work. By checking the code, I found that the no reloading is always better than reloading in LRA. So there is no way to spill the constant to register in LRA. /* If this alternative can be made to work by reloading, and it needs less reloading than the others checked so far, record it as the chosen goal for reloading. */ if ((best_losers != 0 && losers == 0) || (((best_losers == 0 && losers == 0) || (best_losers != 0 && losers != 0)) && (best_overall > overall || (best_overall == overall ... // set goal_alt Looking forward to your advice. Thanks Gui Haochen