http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56965
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #32105|0 |1 is obsolete| | --- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> --- Created attachment 32106 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32106&action=edit /suse/rguenther/p Somewhat micro-optimized patch as otherwise it slows down the common cases too much it seems (testing on insn-recog). It's still slower than the non-sorting version (but if we make it stronger by collecting more relevant FIELD_DECLs we'll hit the trade-off limit faster ...). Some statistics on insn-recog, fieldsx vs. fieldsy length: 184 rtl pre "ncr-1-1 == 1" 6192389 185 hoist "ncr-1-1 == 1" 252507 201 dse1 "ncr-1-1 == 1" 6743 227 dse2 "ncr-1-1 == 1" 6743 239 sched2 "ncr-1-1 == 1" 6743 which is interesting ;) The most common case is just one. Very easy to very micro-optimize but still shows non-noise regression of about 1% for the pathological case above. We can also optimize the length 1 vs. arbitrary length case and avoid sorting the 2nd vector (not done yet).