[PATCH PR90078]Capping comp_cost computation in ivopts

bin.cheng bin.cheng@linux.alibaba.com
Wed Apr 17 07:00:00 GMT 2019


Hi,
As discussed in PR90078, this patch checks possible infinite_cost overflow in ivopts.
Also as discussed, overflow happens mostly because of cost scaling wrto bb_freq/loop_freq.
For the moment, we only implement capping in comp_cost operators, while in next
stage1, we may instead implement capping in get_scaled_computation_cost_at with
more supporting benchmark data.

BTW, I think switching costs around comparison between infinite_cost is unnecessary
since there will be no overflow in integer after capping with infinite_cost.

Bootstrap and test on x86_64, is it OK?

Thanks,
bin

2019-04-17  Bin Cheng  <bin.cheng@linux.alibaba.com>

        PR tree-optimization/92078
        * tree-ssa-loop-ivopts.c (comp_cost::operator +,-,+=,-+,/=,*=): Add
        checks for infinite_cost overflow.

2018-04-17  Bin Cheng  <bin.cheng@linux.alibaba.com>

        PR tree-optimization/92078
        * gcc/testsuite/g++.dg/tree-ssa/pr90078.C: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-pr90078.patch
Type: application/octet-stream
Size: 8310 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20190417/38951422/attachment.obj>


More information about the Gcc-patches mailing list