From: kugan <kugan.vivekanandarajah@linaro.org>
To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Cc: Richard Biener <richard.guenther@gmail.com>,
Jan Hubicka <hubicka@ucw.cz>, Martin Jambor <mjambor@suse.cz>
Subject: [RFC][IPA-VRP] IPA VRP Implementation
Date: Fri, 15 Jul 2016 04:41:00 -0000 [thread overview]
Message-ID: <57886949.8010300@linaro.org> (raw)
Hi,
This patch series implements IPA-VRP based on the previous discussions
in https://gcc.gnu.org/ml/gcc/2016-01/msg00063.html.
0001-Hack-Prevent-setting-__builtin_constant_p-of-param-t.patch -This is
to prevent EVRP setting result of __builtin_constant_p to null that will
inlined later.
0002-Inliner-Check-for-POINTER_TYPE.patch - This is to make sure that we
call SSA_NAME_PTR_INFO only for POINTER_TYPE_P. This is exposed with
IPA-VRP but not related to rest of the patch.
0003-Refactor-vrp.patch - Re-factors tree-vrp to expose some of the
common functionalities.
0004-Add-early-vrp.patch - Adds a simple Early VRP pass.
0005-Add-ipa-vrp.patch - Implements IPA VRP
0006-Teach-tree-vrp-to-use-ipa-vrp-results.patch - Teaches tree-vrp to
use the value ranges set for the PARMs.
More details about the patches are later with each patch.
Before I go into the details, here is a simple example and the relevant
dumps as of now:
static __attribute__((noinline, noclone))
int foo (int i)
{
if (i > 5)
printf ("OK\n");
else
printf ("NOK\n");
}
int bar (int j)
{
if (j > 8)
return foo (j + 2);
else if (j > 2)
return foo (j + 3);
return 0;
}
The Early VRP dump shows:
_1: [11, +INF(OVF)]
_2: [6, 11]
....
bar (int j)
{
....
_8 = foo (_1);
goto <bb 6>;
<bb 4>:
if (j_5(D) > 2)
goto <bb 5>;
else
goto <bb 6>;
<bb 5>:
_2 = j_5(D) + 3;
_10 = foo (_2);
....
The IPA-CP dump shows:
....
Modification phase of node foo/0
Setting value range of param 0 [6, 2147483647]
__attribute__((noclone, noinline))
foo (int i)
....
The VRP1 dump shows:
Value ranges after VRP:
.MEM_1: VARYING
i_2(D): [6, +INF]
Folding predicate i_2(D) > 5 to 1
Removing basic block 4
Merging blocks 2 and 3
Merging blocks 2 and 5
__attribute__((noclone, noinline))
foo (int i)
{
<bb 2>:
__builtin_puts (&"OK"[0]);
return;
}
I have bootstrapped and regression tested the patches in this series on
x86-64 and aarch64 (both normal bootstrap and LTO bootstrap).
There are couple of testcase failures which I am looking into.
Any thoughts?
Thanks,
Kugan
next reply other threads:[~2016-07-15 4:41 UTC|newest]
Thread overview: 67+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-15 4:41 kugan [this message]
2016-07-15 4:42 ` [RFC][IPA-VRP] Disable setting param of __builtin_constant_p to null kugan
2016-07-15 8:43 ` Jan Hubicka
2016-07-25 6:59 ` kugan
2016-07-25 10:02 ` Richard Biener
2016-07-15 4:43 ` [RFC][IPA-VRP] Check for POINTER_TYPE_P before accessing SSA_NAME_PTR_INFO in tree-inline kugan
2016-07-15 4:47 ` Andrew Pinski
2016-07-15 7:03 ` kugan
2016-07-15 7:03 ` Jakub Jelinek
2016-07-15 7:32 ` Richard Biener
2016-07-15 4:44 ` [RFC][IPA-VRP] Re-factor tree-vrp to factor out common code kugan
2016-07-15 4:47 ` [RFC][IPA-VRP] Add support for IPA VRP in ipa-cp/ipa-prop kugan
2016-07-15 12:23 ` Martin Jambor
2016-07-19 8:22 ` kugan
2016-07-19 21:27 ` kugan
2016-07-21 12:54 ` Jan Hubicka
2016-08-30 5:21 ` Kugan Vivekanandarajah
2016-08-30 18:12 ` Prathamesh Kulkarni
2016-08-30 21:10 ` kugan
2016-09-02 12:31 ` Jan Hubicka
2016-07-17 13:24 ` Prathamesh Kulkarni
2016-07-22 12:27 ` [RFC][IPA-VRP] Re-factor tree-vrp to factor out common code kugan
2016-07-22 12:49 ` Richard Biener
2016-07-22 14:34 ` kugan
2016-07-23 10:12 ` kugan
2016-08-16 8:09 ` kugan
2016-08-16 11:56 ` Richard Biener
2016-08-16 22:20 ` kugan
2016-08-17 2:50 ` kugan
2016-08-17 13:46 ` Richard Biener
2016-07-15 4:45 ` [RFC][IPA-VRP] Early VRP Implementation kugan
2016-07-15 4:52 ` Andrew Pinski
2016-07-15 7:08 ` kugan
2016-07-15 7:28 ` Andrew Pinski
2016-07-15 7:33 ` kugan
2016-07-18 11:51 ` Richard Biener
2016-07-22 12:10 ` kugan
2016-07-25 11:18 ` Richard Biener
2016-07-26 12:27 ` kugan
2016-07-26 13:37 ` Richard Biener
2016-07-28 7:36 ` kugan
2016-07-28 11:34 ` Richard Biener
2016-08-03 1:17 ` kugan
2016-08-12 10:43 ` Richard Biener
2016-08-16 7:39 ` [RFC][IPA-VRP] splits out the update_value_range calls from vrp_visit_stmt kugan
2016-08-16 10:58 ` Richard Biener
2016-08-17 2:27 ` kugan
2016-08-17 13:44 ` Richard Biener
2016-08-16 7:45 ` [RFC][IPA-VRP] Early VRP Implementation kugan
2016-08-19 11:41 ` Richard Biener
2016-08-23 2:12 ` Kugan Vivekanandarajah
2016-09-02 8:11 ` Kugan Vivekanandarajah
2016-09-14 12:11 ` Richard Biener
2016-09-14 21:47 ` Jan Hubicka
2016-09-15 7:23 ` Richard Biener
2016-09-15 14:57 ` Jeff Law
2016-09-16 8:59 ` Richard Biener
2016-09-16 6:37 ` kugan
2016-09-16 10:26 ` Richard Biener
2016-09-18 23:40 ` kugan
2016-09-19 13:30 ` Richard Biener
2016-09-20 5:48 ` kugan
2016-07-19 16:19 ` Jeff Law
2016-07-19 18:35 ` Richard Biener
2016-07-19 20:14 ` Jeff Law
2016-07-15 4:47 ` [RFC][IPA-VRP] Teach tree-vrp to use the VR set in params kugan
2016-07-18 11:33 ` Richard Biener
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=57886949.8010300@linaro.org \
--to=kugan.vivekanandarajah@linaro.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=hubicka@ucw.cz \
--cc=mjambor@suse.cz \
--cc=richard.guenther@gmail.com \
/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: link
Be 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).