Go to file
Kewen Lin 603a4ad499 Consider doloop IV in IVOPTs
For the targets supporting low-overhead loops, IVOPTs has to take care of
   the loops which will probably be transformed in RTL doloop optimization,
   to try to make selected IV candidate set optimal.  The process of doloop
   support includes:

   1) Analyze the current loop will be transformed to doloop or not, find and
      mark its compare type IV use as doloop use (iv_group field doloop_p), and
      set flag doloop_use_p of ivopts_data to notify subsequent processings on
      doloop.  See analyze_and_mark_doloop_use and its callees for the details.
      The target hook predict_doloop_p can be used for target specific checks.

   2) Add one doloop dedicated IV cand {(may_be_zero ? 1 : (niter + 1)), +, -1},
      set flag doloop_p of iv_cand, step cost is set as zero and no extra cost
      like biv.  For cost determination between doloop IV cand and IV use, the
      target hooks doloop_cost_for_generic and doloop_cost_for_address are
      provided to add on extra costs for generic type and address type IV use.
      Zero cost is assigned to the pair between doloop IV cand and doloop IV
      use, and bound zero is set for IV elimination.

   3) With the cost setting in step 2), the current cost model based IV
      selection algorithm will process as usual, pick up doloop dedicated IV if
      profitable.

gcc/ChangeLog

2019-09-14  Kewen Lin  <linkw@gcc.gnu.org>

    PR middle-end/80791
    * config/rs6000/rs6000.c (TARGET_HAVE_COUNT_REG_DECR_P): New macro.
    (TARGET_DOLOOP_COST_FOR_GENERIC): Likewise.
    (TARGET_DOLOOP_COST_FOR_ADDRESS): Likewise.
    * target.def (have_count_reg_decr_p): New hook.
    (doloop_cost_for_generic): Likewise.
    (doloop_cost_for_address): Likewise.
    * doc/tm.texi.in (TARGET_HAVE_COUNT_REG_DECR_P): Likewise.
    (TARGET_DOLOOP_COST_FOR_GENERIC): Likewise.
    (TARGET_DOLOOP_COST_FOR_ADDRESS): Likewise.
    * doc/tm.texi: Regenerate.
    * tree-ssa-loop-ivopts.c (comp_cost::operator+=): Consider infinite cost
    addend.
    (record_group): Init doloop_p.
    (add_candidate_1): Add optional argument doloop, change the handlings
    accordingly.
    (add_candidate): Likewise.
    (generic_predict_doloop_p): Update attribute.
    (force_expr_to_var_cost): Add costing for expressions COND_EXPR/LT_EXPR/
    LE_EXPR/GT_EXPR/GE_EXPR/EQ_EXPR/NE_EXPR/UNORDERED_EXPR/ORDERED_EXPR/
    UNLT_EXPR/UNLE_EXPR/UNGT_EXPR/UNGE_EXPR/UNEQ_EXPR/LTGT_EXPR/MAX_EXPR/
    MIN_EXPR.
    (get_computation_cost): Update for doloop IV cand extra cost.    
    (determine_group_iv_cost_cond): Update for doloop IV cand.
    (determine_iv_cost): Likewise.
    (ivopts_estimate_reg_pressure): Likewise.
    (may_eliminate_iv): Update handlings for doloop IV cand.
    (add_iv_candidate_for_doloop): New function.
    (find_iv_candidates): Call function add_iv_candidate_for_doloop.
    (iv_ca_set_no_cp): Update for doloop IV cand.
    (iv_ca_set_cp): Likewise.
    (iv_ca_dump): Dump register cost.
    (find_doloop_use): New function.
    (analyze_and_mark_doloop_use): Likewise.
    (tree_ssa_iv_optimize_loop): Call function analyze_and_mark_doloop_use.

gcc/testsuite/ChangeLog

2019-09-14  Kewen Lin  <linkw@gcc.gnu.org>

    PR middle-end/80791
    * gcc.dg/tree-ssa/ivopts-3.c: Adjust for doloop change.
    * gcc.dg/tree-ssa/ivopts-lt.c: Likewise.
    * gcc.dg/tree-ssa/pr32044.c: Likewise.

From-SVN: r275713
2019-09-14 09:01:21 +00:00
config [ARM/FDPIC v6 02/24] [ARM] FDPIC: Handle arm*-*-uclinuxfdpiceabi in configure scripts 2019-09-10 09:37:00 +02:00
contrib GCC port for eBPF 2019-09-09 12:13:23 +02:00
fixincludes [Darwin, fixincludes] Fix PR83531 2019-08-18 18:54:13 +00:00
gcc Consider doloop IV in IVOPTs 2019-09-14 09:01:21 +00:00
gnattools
gotools libgo: update to Go 1.13beta1 release 2019-09-06 18:12:46 +00:00
include Fix file descriptor existence of MinGW. 2019-08-08 07:50:28 +00:00
INSTALL
intl
libada
libatomic [ARM/FDPIC v6 02/24] [ARM] FDPIC: Handle arm*-*-uclinuxfdpiceabi in configure scripts 2019-09-10 09:37:00 +02:00
libbacktrace Remove Cell Broadband Engine SPU targets 2019-09-03 15:08:28 +00:00
libcc1
libcpp [preprocessor] Popping "" file names 2019-09-06 12:54:19 +00:00
libdecnumber
libffi re PR other/79543 (Inappropriate "ld --version" checking) 2019-09-03 14:10:26 +00:00
libgcc [ARM/FDPIC v6 13/24] [ARM] FDPIC: Force LSB bit for PC in Cortex-M architecture 2019-09-10 09:58:44 +02:00
libgfortran Improve PRNG jumping when using threads 2019-09-05 09:59:55 +03:00
libgo libgo: don't use \? in grep pattern 2019-09-13 17:07:20 +00:00
libgomp libgomp plugin - init string 2019-09-13 20:14:02 +02:00
libhsail-rt
libiberty rust-demangle.c (unescape): Remove. 2019-09-03 14:04:32 -06:00
libitm [ARM/FDPIC v6 23/24] [ARM] FDPIC: Implement libitm support. 2019-09-10 10:11:46 +02:00
libobjc
liboffloadmic
libphobos libphobos.exp (libphobos_init): Add multi-lib libgcc dirs to the ld_library_path var. 2019-09-03 08:24:03 +00:00
libquadmath quadmath.h (M_Eq, [...]): Use two more decimal places. 2019-08-02 09:59:19 +02:00
libsanitizer [ARM/FDPIC v6 03/24] [ARM] FDPIC: Force FDPIC related options unless -mno-fdpic is provided 2019-09-10 09:39:47 +02:00
libssp
libstdc++-v3 PR libstdc++/91748 fix std::for_each_n for random access iterators 2019-09-12 11:51:39 +01:00
libvtv
lto-plugin
maintainer-scripts update_web_docs_svn: Proceed even if the invocation of sphinx fails. 2019-08-04 22:31:54 +00:00
zlib
.dir-locals.el
.gitattributes
.gitignore Add .clangd and compile_commands.json to .gitignore. 2019-08-28 19:33:28 +00:00
ABOUT-NLS
ar-lib
ChangeLog [PATCH][GCC] Update my email address 2019-09-13 10:41:37 +00:00
ChangeLog.jit
ChangeLog.tree-ssa
compile
config-ml.in
config.guess Update config.sub and config.guess. 2019-09-09 11:14:32 +02:00
config.rpath
config.sub Update config.sub and config.guess. 2019-09-09 11:14:32 +02:00
configure GCC port for eBPF 2019-09-09 12:13:23 +02:00
configure.ac GCC port for eBPF 2019-09-09 12:13:23 +02:00
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
COPYING.RUNTIME
depcomp
install-sh
libtool-ldflags
libtool.m4 [ARM/FDPIC v6 02/24] [ARM] FDPIC: Handle arm*-*-uclinuxfdpiceabi in configure scripts 2019-09-10 09:37:00 +02:00
lt~obsolete.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
MAINTAINERS [PATCH][GCC] Update my email address 2019-09-13 10:41:37 +00:00
Makefile.def Sync top-level change from gdb 2019-06-15 21:32:03 +00:00
Makefile.in Makefile.tpl (HOST_EXPORTS): Add CXX_FOR_BUILD. 2019-08-23 15:37:22 -06:00
Makefile.tpl Makefile.tpl (HOST_EXPORTS): Add CXX_FOR_BUILD. 2019-08-23 15:37:22 -06:00
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
symlink-tree
test-driver
ylwrap

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.