public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "xuemaosheng at huawei dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/94728] New: [haifa-sched][restore_pattern] recalculate INSN_TICK for the dependence type of REG_DEP_CONTROL Date: Thu, 23 Apr 2020 08:21:14 +0000 [thread overview] Message-ID: <bug-94728-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94728 Bug ID: 94728 Summary: [haifa-sched][restore_pattern] recalculate INSN_TICK for the dependence type of REG_DEP_CONTROL Product: gcc Version: 7.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: xuemaosheng at huawei dot com Target Milestone: --- If we add the flag DO_PREDICATION in scheduling ebb, the compiler will try to predicate the insn when the producer insn has been issued, and put the consumer insn into suitable queue. For example as shown in schedule verbose dump: ;; | insn | prio | ...................... ;; | 387 | 27 | t1=a5==0 AGS0|AGS1 ;; | 388 | 27 | pc={(t1!=0)?L184:pc} PCU ;; | 459 | 26 | ev10=[a0+0xbc0] AGL0|AGL1 ...................... ;; 1--> + 387 t1=a5==0 :AGS0|AGS1 deferring rescan insn with uid = 459. ;; dependencies resolved: insn + 459 predicated ;; Ready-->Q: insn + 459: queued for 2 cycles (change queue index) ;; tick updated: insn + 459 into queue with cost=2 insn 387 is a test insn, insn 388 is a jump insn, insn 459 is a load insn. After predicating, insn 459 convert into this form: [!t1] ev10 = [a0+0xbc0] and put insn 459 into queue[3]. INSN_TICK (459) = 3; After issuing jump insn 388, the compiler will try to resotre pattern in insn 459 as shown in the following dump files. ;; Ready list after ready_sort: + 388:94:prio=27 ;; Ready list (t = 1): + 388:94:prio=27 [1;1]:388 ;; 1--> + 388 pc={(t1!=0)?L184:pc} :PCU restoring pattern for insn 459 deferring rescan insn with uid = 459. However, the INSN_TICK of insn 459 doesn't calculate again. Actually, after restoring pattern, the insn can issue more earlier. If we recalculate the INSN_TICK of insn 459, we will get INSN_TICK (459) = 2, then the load insn 459 can issue at clock t = 2 instead of clock t = 3. So, can we add the following code to recalculate the INSN_TICK in function restore pattern? restore_pattern (dep_t dep, bool immediately) { rtx_insn *next = DEP_CON (dep); int tick = INSN_TICK (next); ......................... if (DEP_TYPE (dep) == REG_DEP_CONTROL) { if (sched_verbose >= 5) fprintf (sched_dump, "restoring pattern for insn %d\n", INSN_UID (next)); haifa_change_pattern (next, ORIG_PAT (next)); + update_insn_after_change (next); + if ((TODO_SPEC (next) & (HARD_DEP | DEP_POSTPONED)) == 0) + { + fix_tick_ready (next); + tick = INSN_TICK (next); + } } ........................... I found the similiar code in function apply_replacement (dep_t dep, bool immediately).
next reply other threads:[~2020-04-23 8:21 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-04-23 8:21 xuemaosheng at huawei dot com [this message] 2020-04-23 9:23 ` [Bug rtl-optimization/94728] " rguenth at gcc dot gnu.org 2020-04-23 9:26 ` xuemaosheng at huawei dot com 2020-04-23 10:55 ` amonakov at gcc dot gnu.org 2020-04-23 11:03 ` xuemaosheng at huawei dot com
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-94728-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).