public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "luoxhu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug testsuite/103270] [12 regression] gcc.dg/vect/pr96698.c inner loop turned from hot to cold after r12-4526 Date: Tue, 23 Nov 2021 05:13:06 +0000 [thread overview] Message-ID: <bug-103270-4-KT9QzONhie@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-103270-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103270 --- Comment #3 from luoxhu at gcc dot gnu.org --- The profile count is correct but something wrong with edge probability, and it turns out that r12-4526 exposes a long-existing issue in profile_estimate:predict_extra_loop_exits, when searching extra exit edges for inner loop, it goes out and find a edge belongs to *outer loop*, setting that edge with predict value 33%, then predict_loops won't reset that edge for outer loop. I drafted a patch to ignore EDGE_DFS_BACK edges when iterating in predict_extra_loop_exits, then inner loop becomes hot again. diff base/pr103270.c.047t.profile_estimate patched/pr103270.c.047t.profile_estimate -U15 Predictions for bb 5 1 edges in bb 5 predicted to even probabilities Predictions for bb 6 - first match heuristics: 33.00% - combined heuristics: 33.00% + first match heuristics: 91.67% + combined heuristics: 91.67% opcode values nonequal (on trees) heuristics of edge 6->11 (ignored): 66.00% - extra loop exit heuristics of edge 6->11: 33.00% + loop iterations heuristics of edge 6->7: 8.33% Predictions for bb 11 1 edges in bb 11 predicted to even probabilities Predictions for bb 7 1 edges in bb 7 predicted to even probabilitie … - <bb 2> [local count: 88915474]: + <bb 2> [local count: 6029625]: goto <bb 8>; [100.00%] - <bb 3> [local count: 354334800]: + <bb 3> [local count: 536870913]: _1 = *i_19(D); _2 = a_4 & c_6; _3 = _1 + _2; *i_19(D) = _3; - <bb 4> [local count: 708669601]: + <bb 4> [local count: 1073741824]: # c_6 = PHI <c_7(11), b_5(3)> # d_8 = PHI <0(11), 1(3)> if (d_8 == 0) goto <bb 3>; [50.00%] else goto <bb 5>; [50.00%] - <bb 5> [local count: 354334800]: + <bb 5> [local count: 536870913]: # c_21 = PHI <c_6(4)> b_18 = b_5 + -1; - <bb 6> [local count: 1073741824]: + <bb 6> [local count: 585656064]: # b_5 = PHI <0(10), b_18(5)> # c_7 = PHI <0(10), c_21(5)> if (b_5 != -11) - goto <bb 11>; [33.00%] + goto <bb 11>; [91.67%] else - goto <bb 7>; [67.00%] + goto <bb 7>; [8.33%] - <bb 11> [local count: 354334800]: + <bb 11> [local count: 536870913]: goto <bb 4>; [100.00%] - <bb 7> [local count: 719407024]: + <bb 7> [local count: 48785151]: a_16 = a_4 + 1; - <bb 8> [local count: 808322498]: + <bb 8> [local count: 54814777]: # a_4 = PHI <a_12(D)(2), a_16(7)> if (a_4 <= 4) goto <bb 10>; [89.00%] else goto <bb 9>; [11.00%] - <bb 10> [local count: 719407024]: + <bb 10> [local count: 48785151]: goto <bb 6>; [100.00%] - <bb 9> [local count: 88915474]: + <bb 9> [local count: 6029625]: return;
next prev parent reply other threads:[~2021-11-23 5:13 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-11-16 7:41 [Bug testsuite/103270] New: " luoxhu at gcc dot gnu.org 2021-11-16 8:19 ` [Bug testsuite/103270] " rguenth at gcc dot gnu.org 2021-11-17 1:54 ` luoxhu at gcc dot gnu.org 2021-11-23 5:13 ` luoxhu at gcc dot gnu.org [this message] 2021-11-23 5:13 ` luoxhu at gcc dot gnu.org 2021-11-23 5:31 ` luoxhu at gcc dot gnu.org 2021-12-21 3:50 ` cvs-commit at gcc dot gnu.org 2021-12-22 2:49 ` luoxhu at gcc dot gnu.org
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-103270-4-KT9QzONhie@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).