This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH GCC]Introduce loop interchange pass and enable it at -O3

This is the overall loop interchange patch on gimple-linterchange branch.  Note the new pass
is enabled at -O3 level by default.  Bootstrap and regtest on x86_64 and AArch64(ongoing).
NOte after cost model change it is now far more conservative than original version.  It only
interchanges 11 loops in spec2k6 (416 doesn't build at the moment), vs ~250 for the original
version.  I will collect compilation time data, though there shouldn't be any surprise given
few loops are actually interchanged.  I will also collect spec2k6 data, shouldn't affect cases
other than bwaves either.
So is it OK?

2017-12-07  Bin Cheng  <>
	    Richard Biener  <>

	PR tree-optimization/81303
	* (gimple-loop-interchange.o): New object file.
	* common.opt (floop-interchange): Reuse the option from graphite.
	* doc/invoke.texi (-floop-interchange): Ditto.  New document for
	-floop-interchange and mention it for -O3.
	* opts.c (default_options_table): Enable -floop-interchange at -O3.
	* New file.
	* params.def (PARAM_LOOP_INTERCHANGE_MAX_NUM_STMTS): New parameter.
	* passes.def (pass_linterchange): New pass.
	* timevar.def (TV_LINTERCHANGE): New time var.
	* tree-pass.h (make_pass_linterchange): New declaration.
	* tree-ssa-loop-ivcanon.c (create_canonical_iv): Change to external
	interchange.  Record IV before/after increment in new parameters.
	* tree-ssa-loop-ivopts.h (create_canonical_iv): New declaration.
	* tree-vect-loop.c (vect_is_simple_reduction): Factor out reduction
	path check into...
	(check_reduction_path): ...New function here.
	* tree-vectorizer.h (check_reduction_path): New declaration.

2017-12-07  Bin Cheng  <>
	    Richard Biener  <>

	PR tree-optimization/81303
	* gcc.dg/tree-ssa/loop-interchange-1.c: New test.
	* gcc.dg/tree-ssa/loop-interchange-1b.c: New test.
	* gcc.dg/tree-ssa/loop-interchange-2.c: New test.
	* gcc.dg/tree-ssa/loop-interchange-3.c: New test.
	* gcc.dg/tree-ssa/loop-interchange-4.c: New test.
	* gcc.dg/tree-ssa/loop-interchange-5.c: New test.
	* gcc.dg/tree-ssa/loop-interchange-6.c: New test.
	* gcc.dg/tree-ssa/loop-interchange-7.c: New test.
	* gcc.dg/tree-ssa/loop-interchange-8.c: New test.
	* gcc.dg/tree-ssa/loop-interchange-9.c: New test.
	* gcc.dg/tree-ssa/loop-interchange-10.c: New test.
	* gcc.dg/tree-ssa/loop-interchange-11.c: New test.
	* gcc.dg/tree-ssa/loop-interchange-12.c: New test.
	* gcc.dg/tree-ssa/loop-interchange-13.c: New test.

Attachment: linterchange-20171207.txt
Description: linterchange-20171207.txt

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]