https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97071
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Jakub Jelinek from comment #2) > REG_EQUAL notes aren't really needed for that, we have functions to query > the values from the constant pool for loads from it. > So guess it is a matter of looking at the constant pool entry, if the > negation of it is already emitted and the current value is not, try if > instruction with the negation can be recognized. > If neither of the constant pool entries is emitted already, but both are > present, it should try to canonicalize to one of them... Note it's not mainly about optimizing the size of the constant pool but to reduce the number of loads from it and eventually shrink code size.