[Patch] PR tree-optimization/68234 Improve range info for loop Phi node

Jiong Wang jiong.wang@foss.arm.com
Wed Nov 11 09:23:00 GMT 2015


As discussed at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68234, this
patch haven't touch the existed code logic in vrp_visit_phi_node, it
only entends SCEV check to those VR_VARYING loop PHI node.

Previously, we only do this check if the PHI node is with valid range
info but later dropped either side to infinite. The miss of those PHI
node with initial estimiation of VR_VARYING caused the missing of some
further optimization opportunity, for example the testcase included in
this patch, with improved range info, we can efficient turn the signed
divide into right shift.

This patch pass x86-64 and AArch64 boostrap, no regression on both.
Meanwhile a simple benchmaring shows there are quite a few new VR_RANGE
found after this patch during gcc bootstrapping. There is no performance
regression on spec2006 int on aarch64.

During gcc bootstrapping, on x86-64 there are 4828 new VR_VARYING -> 
VR_RANGE
found by vrp1, and 5008 new by vrp2.

While on AArch64 there are 44756 new by vrp1, and 6047 new by vrp2.

OK for trunk?

2015-11-11  Richard Biener  <rguenth@gcc.gnu.org>
             Jiong Wang      <jiong.wang@arm.com>
gcc/
   PR tree-optimization/68234
   * tree-vrp.c (vrp_visit_phi_node): Extend SCEV check to those loop PHI
   node which estimiated to be VR_VARYING initially.

gcc/testsuite/
   * gcc.dg/tree-ssa/pr68234.c: New testcase.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: vrp-new.patch
Type: text/x-patch
Size: 3044 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20151111/68f81512/attachment.bin>


More information about the Gcc-patches mailing list