This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/68664] [6/7 Regression] Speculative sqrt in c-ray main loop causes large slow down
- From: "segher at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 06 Feb 2017 19:20:21 +0000
- Subject: [Bug rtl-optimization/68664] [6/7 Regression] Speculative sqrt in c-ray main loop causes large slow down
- Auto-submitted: auto-generated
- References: <bug-68664-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68664
--- Comment #18 from Segher Boessenkool <segher at gcc dot gnu.org> ---
Author: segher
Date: Mon Feb 6 19:19:49 2017
New Revision: 245215
URL: https://gcc.gnu.org/viewcvs?rev=245215&root=gcc&view=rev
Log:
sched: Do not move expensive insns speculatively (PR68664)
Scheduling should never move very expensive instructions to places they
are executed more frequently. This patch fixes that, reducing the
execution time of c-ray by over 40% (I tested on a BE Power7 system).
This introduces a new target hook sched.can_speculate_insn which returns
whether the scheduler is allowed to speculate a given instruction. The
rs6000 implementation disallows all divide and square root instructions.
PR rtl-optimization/68664
* target.def (can_speculate_insn): New hook.
* doc/tm.texi.in (TARGET_SCHED_CAN_SPECULATE_INSN): New hook.
* doc/tm.texi: Regenerate.
* sched-rgn.c (can_schedule_ready_p): Use the new hook.
* config/rs6000/rs6000.c (TARGET_SCHED_CAN_SPECULATE_INSN): New macro.
(rs6000_sched_can_speculate_insn): New function.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/rs6000/rs6000.c
trunk/gcc/doc/tm.texi
trunk/gcc/doc/tm.texi.in
trunk/gcc/sched-rgn.c
trunk/gcc/target.def