public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/65443] Don't peel last iteration from loop in transform_to_exit_first_loop Date: Mon, 16 Mar 2015 17:12:00 -0000 [thread overview] Message-ID: <bug-65443-4-zYYeUXxIMx@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-65443-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65443 --- Comment #2 from vries at gcc dot gnu.org --- AFAIU, this is meant with the todo: ... <bb x>: goto <bb y>; <bb 4>: i_17 = (int) ivtmp_6; _7 = (long unsigned int) i_17; _8 = _7 * 4; _9 = pretmp_24 + _8; _10 = *_9; sum_11 = _10 + sum_y; i_12 = i_17 + 1; i.1_3 = (unsigned int) i_12; <bb y>: # sum_y = PHI <1(x), sum_11(4)> # ivtmp_y = PHI <0(x), ivtmp_6(4)> if (ivtmp_y < _20 + 1) goto <bb 6>; else goto <bb 5>; <bb 5>: # sum_21 = PHI <sum_11(4), sum_26(8)> goto <bb 7>; <bb 6>: ivtmp_6 = ivtmp_y + 1; goto <bb 4>; ... So, sort of: - Split bb 4 before the loop condition, creating bb y. - Don't enter the loop at bb 4 as before, instead jump to before the loop condition, to bb y (creating bb x in the process) - For each phi in bb 4, add a corresponding phi to bb y: - For the values for entry from bb x, use the values in the phis in bb 4 for entry from bb 11. - For the values for entry from bb 4, use the reaching definitions. - increase loop bound with 1 (_20 + 1) - simplify the phis in bb 4 - use the new phis in bb y as defs for the reachable uses The problem with this transformation is that '_20 + 1' might overflow, that's what the comment 'This may need some additional preconditioning in case NIT = ~0' refers to.
next prev parent reply other threads:[~2015-03-16 17:12 UTC|newest] Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-03-16 15:45 [Bug tree-optimization/65443] New: " vries at gcc dot gnu.org 2015-03-16 17:12 ` vries at gcc dot gnu.org [this message] 2015-03-16 17:27 ` [Bug tree-optimization/65443] " vries at gcc dot gnu.org 2015-03-17 19:43 ` vries at gcc dot gnu.org 2015-03-18 11:34 ` rguenth at gcc dot gnu.org 2015-03-19 23:56 ` vries at gcc dot gnu.org 2015-03-20 20:08 ` vries at gcc dot gnu.org 2015-03-20 20:10 ` vries at gcc dot gnu.org 2015-03-20 20:14 ` vries at gcc dot gnu.org 2015-03-22 12:44 ` vries at gcc dot gnu.org 2015-03-23 9:02 ` vries at gcc dot gnu.org 2015-03-26 8:50 ` vries at gcc dot gnu.org 2015-03-26 12:28 ` vries at gcc dot gnu.org 2015-03-27 14:51 ` vries at gcc dot gnu.org 2015-04-03 12:45 ` vries at gcc dot gnu.org 2015-04-16 8:53 ` vries at gcc dot gnu.org 2015-05-28 21:24 ` vries at gcc dot gnu.org 2015-06-05 15:58 ` vries at gcc dot gnu.org 2015-06-05 16:01 ` vries at gcc dot gnu.org 2015-06-08 12:01 ` vries 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-65443-4-zYYeUXxIMx@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).