[Bug rtl-optimization/52203] ICE: in reset_sched_cycles_in_current_ebb, at sel-sched.c:7136 with -fsel-sched-pipelining -fselective-scheduling2 and other custom flags
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52203 Andrey Belevantsev changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|--- |FIXED --- Comment #13 from Andrey Belevantsev --- Works since 4.8, 4.7 is not maintained.
[Bug rtl-optimization/52203] ICE: in reset_sched_cycles_in_current_ebb, at sel-sched.c:7136 with -fsel-sched-pipelining -fselective-scheduling2 and other custom flags
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52203 --- Comment #12 from Zdenek Sojka --- 4.7 is not maintained anymore, can this be closed?
[Bug rtl-optimization/52203] ICE: in reset_sched_cycles_in_current_ebb, at sel-sched.c:7136 with -fsel-sched-pipelining -fselective-scheduling2 and other custom flags
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52203 --- Comment #11 from Andrey Belevantsev abel at gcc dot gnu.org 2012-04-13 09:36:46 UTC --- Author: abel Date: Fri Apr 13 09:36:42 2012 New Revision: 186410 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=186410 Log: PR rtl-optimization/52203 PR rtl-optimization/52715 Revert the 2012-03-07 fix for PR 52203. * sel-sched.c (reset_sched_cycles_in_current_ebb): Check that the insn does not modify DFA right before issuing, adjust issue_rate accordingly. Modified: trunk/gcc/ChangeLog trunk/gcc/sel-sched.c
[Bug rtl-optimization/52203] ICE: in reset_sched_cycles_in_current_ebb, at sel-sched.c:7136 with -fsel-sched-pipelining -fselective-scheduling2 and other custom flags
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52203 --- Comment #9 from Andrey Belevantsev abel at gcc dot gnu.org 2012-03-07 12:00:42 UTC --- Author: abel Date: Wed Mar 7 12:00:37 2012 New Revision: 185036 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=185036 Log: PR rtl-optimization/52203 * sel-sched.c (estimate_insn_cost): New parameter pempty. Adjust all callers to pass NULL except ... (reset_sched_cycles_in_current_ebb): ... here, save the value in new variable 'empty'. Increase issue_rate only for non-empty insns. Modified: trunk/gcc/ChangeLog trunk/gcc/sel-sched.c
[Bug rtl-optimization/52203] ICE: in reset_sched_cycles_in_current_ebb, at sel-sched.c:7136 with -fsel-sched-pipelining -fselective-scheduling2 and other custom flags
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52203 Andrey Belevantsev abel at gcc dot gnu.org changed: What|Removed |Added Known to work||4.8.0 --- Comment #10 from Andrey Belevantsev abel at gcc dot gnu.org 2012-03-07 12:02:28 UTC --- Fixed on trunk, will be ported for 4.7.1.
[Bug rtl-optimization/52203] ICE: in reset_sched_cycles_in_current_ebb, at sel-sched.c:7136 with -fsel-sched-pipelining -fselective-scheduling2 and other custom flags
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52203 --- Comment #2 from Andrey Belevantsev abel at gcc dot gnu.org 2012-02-13 08:48:35 UTC --- Well, in this case the insn is vcvtps2pd (from avx_cvtps2pd256 and *avx_cvtps2pd256_2 patterns) but not having a reservation looks correct as the manual says decode type -- microcode. Uros, is that right? In this case, the below fixes the test for me (and I was stupid enough not to do this in the first place when this bug stream just started... However, we did fix some real bugs.) iff --git a/gcc/sel-sched.c b/gcc/sel-sched.c index 2af01ae..2829f60 100644 --- a/gcc/sel-sched.c +++ b/gcc/sel-sched.c @@ -4265,9 +4265,10 @@ invoke_aftermath_hooks (fence_t fence, rtx best_insn, int issue_more) return issue_more; } -/* Estimate the cost of issuing INSN on DFA state STATE. */ +/* Estimate the cost of issuing INSN on DFA state STATE. Write to PEMPTY + true when INSN does not change the processor state. */ static int -estimate_insn_cost (rtx insn, state_t state) +estimate_insn_cost (rtx insn, state_t state, bool *pempty) { static state_t temp = NULL; int cost; @@ -4277,6 +4278,8 @@ estimate_insn_cost (rtx insn, state_t state) memcpy (temp, state, dfa_state_size); cost = state_transition (temp, insn); + if (pempty) +*pempty = (memcmp (temp, state, dfa_state_size) == 0); if (cost 0) return 0; @@ -4307,7 +4310,7 @@ get_expr_cost (expr_t expr, fence_t fence) return 0; } else -return estimate_insn_cost (insn, FENCE_STATE (fence)); +return estimate_insn_cost (insn, FENCE_STATE (fence), NULL); } /* Find the best insn for scheduling, either via max_issue or just take @@ -7020,7 +7023,7 @@ reset_sched_cycles_in_current_ebb (void) { int cost, haifa_cost; int sort_p; - bool asm_p, real_insn, after_stall, all_issued; + bool asm_p, real_insn, after_stall, all_issued, empty; int clock; if (!INSN_P (insn)) @@ -7047,7 +7050,7 @@ reset_sched_cycles_in_current_ebb (void) haifa_cost = 0; } else -haifa_cost = estimate_insn_cost (insn, curr_state); +haifa_cost = estimate_insn_cost (insn, curr_state, empty); /* Stall for whatever cycles we've stalled before. */ after_stall = 0; @@ -7081,7 +7084,7 @@ reset_sched_cycles_in_current_ebb (void) if (!after_stall real_insn haifa_cost 0 - estimate_insn_cost (insn, curr_state) == 0) + estimate_insn_cost (insn, curr_state, NULL) == 0) break; /* When the data dependency stall is longer than the DFA stall, @@ -7093,7 +7096,7 @@ reset_sched_cycles_in_current_ebb (void) if ((after_stall || all_issued) real_insn haifa_cost == 0) -haifa_cost = estimate_insn_cost (insn, curr_state); +haifa_cost = estimate_insn_cost (insn, curr_state, NULL); } haifa_clock += i; @@ -7125,7 +7128,8 @@ reset_sched_cycles_in_current_ebb (void) if (real_insn) { cost = state_transition (curr_state, insn); - issued_insns++; + if (!empty) + issued_insns++; if (sched_verbose = 2) {
[Bug rtl-optimization/52203] ICE: in reset_sched_cycles_in_current_ebb, at sel-sched.c:7136 with -fsel-sched-pipelining -fselective-scheduling2 and other custom flags
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52203 Andrey Belevantsev abel at gcc dot gnu.org changed: What|Removed |Added CC||ubizjak at gmail dot com --- Comment #3 from Andrey Belevantsev abel at gcc dot gnu.org 2012-02-13 08:49:38 UTC --- Even better with Uros in CC.
[Bug rtl-optimization/52203] ICE: in reset_sched_cycles_in_current_ebb, at sel-sched.c:7136 with -fsel-sched-pipelining -fselective-scheduling2 and other custom flags
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52203 --- Comment #4 from Uros Bizjak ubizjak at gmail dot com 2012-02-13 15:54:28 UTC --- (In reply to comment #2) Well, in this case the insn is vcvtps2pd (from avx_cvtps2pd256 and *avx_cvtps2pd256_2 patterns) but not having a reservation looks correct as the manual says decode type -- microcode. Uros, is that right? In this case, the below fixes the test for me (and I was stupid enough not to do this in the first place when this bug stream just started... However, we did fix some real bugs.) There is nothing wrong with insn definition, the problem is only that attributes are missing. Attributes are considered a tool to fine-tune the scheduler and in any case, gcc should not ICE on an insn without reservation. The insn doesn't reserve anything in this case and scheduler should live with this. The bugs you are referring to were real bugs, where wrong or missing operand was accessed from attribute calculation machinery.
[Bug rtl-optimization/52203] ICE: in reset_sched_cycles_in_current_ebb, at sel-sched.c:7136 with -fsel-sched-pipelining -fselective-scheduling2 and other custom flags
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52203 --- Comment #5 from Uros Bizjak ubizjak at gmail dot com 2012-02-13 16:00:27 UTC --- (In reply to comment #4) The bugs you are referring to were real bugs, where wrong or missing operand was accessed from attribute calculation machinery. ... and PR 49014, where indeed insn without reservation crashed scheduler in the same way. But there was a clear inconsistency in the model, so we got away with the adjustment.
[Bug rtl-optimization/52203] ICE: in reset_sched_cycles_in_current_ebb, at sel-sched.c:7136 with -fsel-sched-pipelining -fselective-scheduling2 and other custom flags
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52203 --- Comment #6 from Uros Bizjak ubizjak at gmail dot com 2012-02-13 16:01:40 UTC --- (In reply to comment #5) (In reply to comment #4) The bugs you are referring to were real bugs, where wrong or missing operand was accessed from attribute calculation machinery. ... and PR 49014, where indeed insn without reservation crashed scheduler in the same way. But there was a clear inconsistency in the model, so we got away with the adjustment. Maybe a warning in the logs could be emitted for insns without reservations?
[Bug rtl-optimization/52203] ICE: in reset_sched_cycles_in_current_ebb, at sel-sched.c:7136 with -fsel-sched-pipelining -fselective-scheduling2 and other custom flags
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52203 Steven Bosscher steven at gcc dot gnu.org changed: What|Removed |Added CC||steven at gcc dot gnu.org --- Comment #7 from Steven Bosscher steven at gcc dot gnu.org 2012-02-13 21:14:35 UTC --- A warning in the scheduler log for insns without a reservation would be nice. Doing it from genautomata would be quite difficult, but the scheduler can detect the situation easily and issue a diagnostic. How does the Haifa scheduler handle such insns?
[Bug rtl-optimization/52203] ICE: in reset_sched_cycles_in_current_ebb, at sel-sched.c:7136 with -fsel-sched-pipelining -fselective-scheduling2 and other custom flags
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52203 --- Comment #8 from Andrey Belevantsev abel at gcc dot gnu.org 2012-02-14 06:56:10 UTC --- Sorry, I didn't explain clearly from the start. Regarding the backend, I just wanted to double check that for the given insn not having a reservation is correct. Now that Uros confirmed this, I can proceed with the scheduler patch. Uros and Steven, regarding the big picture, you can read the thread on PR 49014, starting from http://gcc.gnu.org/ml/gcc-patches/2011-05/msg01801.html (our first discussions with Bernd) and initial patch with the remainder of the thread at http://gcc.gnu.org/ml/gcc-patches/2011-07/msg00045.html. Basically, we allow insns that recog as =0 but do not change the DFA state, such insns do not get counted against issue rate. I was wondering whether we could mark such insns specially in the MD files and then assert that any other real insn should affect the DFA. The reason for this was that at least three real backend bugs (missing DFA attributes) were fixed due to the more strict checking the selective scheduler makes wrt the Haifa scheduler. Suprisingly, I could bootstrap x86-64 with just some hours of work with the patch from http://gcc.gnu.org/ml/gcc-patches/2011-07/msg00045.html (the patch marks the offending insns with the new attribute and adds an assert; Uros, if you can spot any insns there that indeed should have a reservation, I can make a patch fixing those). However, at the time I gave in pursuing this work further, as nobody was very fascinated with the idea and I didn't have much free time.
[Bug rtl-optimization/52203] ICE: in reset_sched_cycles_in_current_ebb, at sel-sched.c:7136 with -fsel-sched-pipelining -fselective-scheduling2 and other custom flags
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52203 Andrey Belevantsev abel at gcc dot gnu.org changed: What|Removed |Added Status|NEW |ASSIGNED AssignedTo|unassigned at gcc dot |abel at gcc dot gnu.org |gnu.org | --- Comment #1 from Andrey Belevantsev abel at gcc dot gnu.org 2012-02-11 12:52:38 UTC --- Thanks, Zdenek and Steven, I'll look at this on Monday. I bet this is caused by yet another insn without a reservation.
[Bug rtl-optimization/52203] ICE: in reset_sched_cycles_in_current_ebb, at sel-sched.c:7136 with -fsel-sched-pipelining -fselective-scheduling2 and other custom flags
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52203 Steven Bosscher steven at gcc dot gnu.org changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed||2012-02-10 CC||abel at gcc dot gnu.org Ever Confirmed|0 |1