On Mon, 2026-03-09 at 14:45 -0400, Vladimir Makarov wrote: > On 2/23/26 12:26 AM, Oleg Endo wrote: > > Hi, > > > > In order to move the SH backend over to LRA there is one more missing piece. > > > > On SH we have two fp constant load insns "fldi0" and "fldi1". However, they > > are bound to single-precision fp mode. We were hitting some cases where LRA > > wants to substitute constant loads, which have been emitted differently > > originally, and picks up those "fldi0" / "fldi1" insns but doesn't check > > whether they are valid for the current fp mode. > > > > Eventually LRA should be taught to check that any substitution is valid for > > any mode, not just fp mode. But for now, the quick solution is to add a > > cannot_substitute_const_equiv_p target hook. > > > > Bootsrapped on x86_64. OK to apply? > > > Sorry for delay with the answer. > > I don't like this solution. As Jeff, I believe it is just a papering > over the issue. Also I think that introduction of > cannot_substitute_mem_equiv_p long time ago was probably a bad solution too. > > Saying that I'd like to be constructive. So I'll work on this issue and > hope to find another solution on this week. >
Thanks for chiming in, Vlad. I forgot to mention/link the PR in my original message. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117182 Let me know when you have something or if you need more input. Best regards, Oleg Endo
