This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
2011/11/3 Uros Bizjak <ubizjak@gmail.com>: > Hello! > >> Here is a fix for PR 50962. Fix improves AGU stall avoidance >> optimization by adding opportunity to emit lea instead of mov when it >> is profitable. >> >> 2011-11-03 ?Enkovich Ilya ?<ilya.enkovich@intel.com> >> >> ? ? ? PR target/50962 >> ? ? ? * config/i386/i386-protos.h (ix86_use_lea_for_mov): New. >> ? ? ? * config/i386/i386.c (ix86_use_lea_for_mov): Likewise. >> ? ? ? * config/i386/i386.md (movsi_internal): Emit lea if profitable. >> ? ? ? (movdi_internal_rex64): Likewise. > > OK for mainline SVN with a small change, see below. > > +/* Return true if we should emit lea instruction instead of mov > + ? instruction. ?*/ > + > +bool > +ix86_use_lea_for_mov (rtx insn, rtx operands[]) > +{ > + ?unsigned int regno0; > + ?unsigned int regno1; > + > + ?/* Check we can transform mov to lea. ?*/ > + ?if (!REG_P (operands[0]) || !REG_P (operands[1])) > + ? ?return false; > > Please fix the comment and ... > > + ?/* Check if we need to optimize. ?*/ > + ?if (!TARGET_OPT_AGU || optimize_function_for_size_p (cfun)) > + ? ?return false; > > ... switch this check with the one above, it is faster to exit early this way. > > + ?regno0 = true_regnum (operands[0]); > + ?regno1 = true_regnum (operands[1]); > + > + ?return ix86_lea_outperforms (insn, regno0, regno1, -1, 0); > +} > > Thanks, > Uros. > Hello! Thanks for review! Here is a patch with requested fixes. Could please someone commit it? Thanks, Ilya --- gcc/ 2011-11-04 Enkovich Ilya <ilya.enkovich@intel.com> PR target/50962 * config/i386/i386-protos.h (ix86_use_lea_for_mov): New. * config/i386/i386.c (ix86_use_lea_for_mov): Likewise. * config/i386/i386.md (movsi_internal): Emit lea if profitable. (movdi_internal_rex64): Likewise.
Attachment:
PR50962.diff
Description: Binary data
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |