gcc/gcc/graphite-isl-ast-to-gimple.c

3259 lines
96 KiB
C
Raw Normal View History

2015-12-17 19:50:05 +01:00
/* Translation of isl AST to Gimple.
Copyright (C) 2014-2016 Free Software Foundation, Inc.
Contributed by Roman Gareev <gareevroman@gmail.com>.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#define USES_ISL
#include "config.h"
#ifdef HAVE_isl
#define INCLUDE_MAP
#include "system.h"
#include "coretypes.h"
tree-core.h: Include symtab.h. 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * tree-core.h: Include symtab.h. * rtl.h: Include hard-reg-set.h but not flags.h. (HARD_CONST): Remove condition compilation involving HARD_CONST since hard-reg-set.h is always included. * regs.h: Don't include hard-reg-set.h or rtl.h. * cfg.h: Include dominance.h. * gimple.h: Include tree-ssa-alias.h and gimple-expr.h. * backend.h: New. Aggregate commonly used backend header files. * gimple-ssa.h: Don't include tree-hasher.h. * ssa.h: New. Aggregate commonly used SSA header files. * regset.h: Remove bitmap.h and hard-reg-set.h #includes. * sel-sched-ir.h: Flatten includes. * lra-int.h: Flatten completely. * sel-sched-dump.h: Flatten includes. * ira-int.h: Flatten includes. * gimple-streamer.h: Remove all includes. * cfgloop.h: Remove all #includes except cfgloopmanip.h. * resource.h: Flatten hard-reg-set.h and df.h. * sched-int.h: Flatten insn-arrt.h and df.h. * valtrack.h: flatten bitmap.h, df.h, and rtl.h * df.h: Flatten includes, leaving regset.h, alloc-pool.h and timevar.h. * genattrtab.c (write_header): Adjust generated includes. * genautomata.c (main): Likewise. * genconditions.c (write-header): Likewise. * genemit.c (main): Likewise. * gengtype.c (open_base_files): Likewise. * genopinit.c (main): Likewise. * genoutput.c (output_prologue): Likewise. * genpeep.c (main): Likewise. * genpreds.c (write_insn_preds_c): Likewise. * genrecog.c (write_header): Likewise. * alias.c: Adjust includes. * asan.c: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * auto-profile.c: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * ccmp.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgbuild.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfgloop.c: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * cilk-common.c: Likewise. * combine-stack-adj.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * cppbuiltin.c: Likewise. * cprop.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * data-streamer-in.c: Likewise. * data-streamer-out.c: Likewise. * data-streamer.c: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * debug.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dfp.c: Likewise. * dojump.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * dse.c: Likewise. * dumpfile.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * explow.c: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * final.c: Likewise. * fixed-value.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * fwprop.c: Likewise. * gcc-plugin.h: Likewise. * gcse-common.c: Likewise. * gcse.c: Likewise. * generic-match-head.c: Likewise. * ggc-page.c: Likewise. * gimple-builder.c: Likewise. * gimple-expr.c: Likewise. * gimple-fold.c: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-match-head.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimple.c: Likewise. * gimplify-me.c: Likewise. * gimplify.c: Likewise. * godump.c: Likewise. * graph.c: Likewise. * graphite-blocking.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-isl-ast-to-gimple.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * ifcvt.c: Likewise. * init-regs.c: Likewise. * internal-fn.c: Likewise. * ipa-chkp.c: Likewise. * ipa-comdats.c: Likewise. * ipa-cp.c: Likewise. * ipa-devirt.c: Likewise. * ipa-icf-gimple.c: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-polymorphic-call.c: Likewise. * ipa-profile.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref.c: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-visibility.c: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-assigns.c: Likewise. * lra-coalesce.c: Likewise. * lra-constraints.c: Likewise. * lra-eliminations.c: Likewise. * lra-lives.c: Likewise. * lra-remat.c: Likewise. * lra-spills.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * opts-global.c: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * real.c: Likewise. * realmpfr.c: Likewise. * recog.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regrename.c: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * reorg.c: Likewise. * resource.c: Likewise. * rtl-chkp.c: Likewise. * rtlanal.c: Likewise. * rtlhooks.c: Likewise. * sanopt.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * shrink-wrap.c: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * symtab.c: Likewise. * target-globals.c: Likewise. * targhooks.c: Likewise. * toplev.c: Likewise. * tracer.c: Likewise. * trans-mem.c: Likewise. * tree-affine.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chkp-opt.c: Likewise. * tree-chkp.c: Likewise. * tree-chrec.c: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-nested.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-scopedtables.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tsan.c: Likewise. * ubsan.c: Likewise. * valtrack.c: Likewise. * value-prof.c: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * vtable-verify.c: Likewise. * web.c: Likewise. * wide-int.cc: Likewise. * xcoffout.c: Likewise. * config/aarch64/aarch64-builtins.c: Likewise. * config/aarch64/aarch64.c: Likewise. * config/aarch64/cortex-a57-fma-steering.c: Likewise. * config/alpha/alpha.c: Likewise. * config/arc/arc.c: Likewise. * config/arm/aarch-common.c: Likewise. * config/arm/arm-builtins.c: Likewise. * config/arm/arm-c.c: Likewise. * config/arm/arm.c: Likewise. * config/avr/avr-c.c: Likewise. * config/avr/avr-log.c: Likewise. * config/avr/avr.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/cr16/cr16.c: Likewise. * config/cris/cris.c: Likewise. * config/darwin-c.c: Likewise. * config/darwin.c: Likewise. * config/epiphany/epiphany.c: Likewise. * config/epiphany/mode-switch-use.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. * config/fr30/fr30.c: Likewise. * config/frv/frv.c: Likewise. * config/ft32/ft32.c: Likewise. * config/h8300/h8300.c: Likewise. * config/i386/i386-c.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/msformat-c.c: Likewise. * config/i386/winnt-cxx.c: Likewise. * config/i386/winnt-stubs.c: Likewise. * config/i386/winnt.c: Likewise. * config/ia64/ia64-c.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/lm32/lm32.c: Likewise. * config/m32c/m32c-pragma.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32r/m32r.c: Likewise. * config/m68k/m68k.c: Likewise. * config/mcore/mcore.c: Likewise. * config/mep/mep-pragma.c: Likewise. * config/mep/mep.c: Likewise. * config/microblaze/microblaze-c.c: Likewise. * config/microblaze/microblaze.c: Likewise. * config/mips/mips.c: Likewise. * config/mmix/mmix.c: Likewise. * config/mn10300/mn10300.c: Likewise. * config/moxie/moxie.c: Likewise. * config/msp430/msp430-c.c: Likewise. * config/msp430/msp430.c: Likewise. * config/nds32/nds32-cost.c: Likewise. * config/nds32/nds32-fp-as-gp.c: Likewise. * config/nds32/nds32-intrinsic.c: Likewise. * config/nds32/nds32-isr.c: Likewise. * config/nds32/nds32-md-auxiliary.c: Likewise. * config/nds32/nds32-memory-manipulation.c: Likewise. * config/nds32/nds32-pipelines-auxiliary.c: Likewise. * config/nds32/nds32-predicates.c: Likewise. * config/nds32/nds32.c: Likewise. * config/nios2/nios2.c: Likewise. * config/nvptx/nvptx.c: Likewise. * config/pa/pa.c: Likewise. * config/pdp11/pdp11.c: Likewise. * config/rl78/rl78-c.c: Likewise. * config/rl78/rl78.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/s390/s390-c.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh-c.c: Likewise. * config/sh/sh-mem.cc: Likewise. * config/sh/sh.c: Likewise. * config/sh/sh_optimize_sett_clrt.cc: Likewise. * config/sh/sh_treg_combine.cc: Likewise. * config/sol2-c.c: Likewise. * config/sol2-cxx.c: Likewise. * config/sol2-stubs.c: Likewise. * config/sol2.c: Likewise. * config/sparc/sparc-c.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu-c.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/tilegx/mul-tables.c: Likewise. * config/tilegx/tilegx-c.c: Likewise. * config/tilegx/tilegx.c: Likewise. * config/tilepro/mul-tables.c: Likewise. * config/tilepro/tilepro-c.c: Likewise. * config/tilepro/tilepro.c: Likewise. * config/v850/v850-c.c: Likewise. * config/v850/v850.c: Likewise. * config/vax/vax.c: Likewise. * config/visium/visium.c: Likewise. * config/vms/vms-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/xtensa/xtensa.c: Likewise. ada 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * gcc-interface/cuintp.c: Adjust includes. * gcc-interface/decl.c: Likewise. * gcc-interface/misc.c: Likewise. * gcc-interface/targtyps.c: Likewise. * gcc-interface/trans.c: Likewise. * gcc-interface/utils.c: Likewise. * gcc-interface/utils2.c: Likewise. c 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * c-array-notation.c: Adjust includes. * c-aux-info.c: Likewise. * c-convert.c: Likewise. * c-decl.c: Likewise. * c-errors.c: Likewise. * c-lang.c: Likewise. * c-objc-common.c: Likewise. * c-parser.c: Likewise. * c-typeck.c: Likewise. c-family 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * array-notation-common.c: Adjust includes. * c-ada-spec.c: Likewise. * c-cilkplus.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-dump.c: Likewise. * c-format.c: Likewise. * c-gimplify.c: Likewise. * c-indentation.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-pch.c: Likewise. * c-ppoutput.c: Likewise. * c-pragma.c: Likewise. * c-pretty-print.c: Likewise. * c-semantics.c: Likewise. * c-ubsan.c: Likewise. * cilk.c: Likewise. * stub-objc.c: Likewise. cp 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * call.c: Adjust includes. * class.c: Likewise. * constexpr.c: Likewise. * cp-array-notation.c: Likewise. * cp-gimplify.c: Likewise. * cp-lang.c: Likewise. * cp-objcp-common.c: Likewise. * cp-ubsan.c: Likewise. * cvt.c: Likewise. * decl.c: Likewise. * decl2.c: Likewise. * dump.c: Likewise. * error.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * friend.c: Likewise. * init.c: Likewise. * lambda.c: Likewise. * lex.c: Likewise. * mangle.c: Likewise. * method.c: Likewise. * name-lookup.c: Likewise. * optimize.c: Likewise. * parser.c: Likewise. * pt.c: Likewise. * ptree.c: Likewise. * repo.c: Likewise. * rtti.c: Likewise. * search.c: Likewise. * semantics.c: Likewise. * tree.c: Likewise. * typeck.c: Likewise. * typeck2.c: Likewise. fortran 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * convert.c: Adjust includes. * cpp.c: Likewise. * decl.c: Likewise. * f95-lang.c: Likewise. * iresolve.c: Likewise. * match.c: Likewise. * module.c: Likewise. * options.c: Likewise. * target-memory.c: Likewise. * trans-array.c: Likewise. * trans-common.c: Likewise. * trans-const.c: Likewise. * trans-decl.c: Likewise. * trans-expr.c: Likewise. * trans-intrinsic.c: Likewise. * trans-io.c: Likewise. * trans-openmp.c: Likewise. * trans-stmt.c: Likewise. * trans-types.c: Likewise. * trans.c: Likewise. go 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * go-backend.c: Adjust includes. * go-gcc.cc: Likewise. * go-lang.c: Likewise. java 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * boehm.c: Adjust includes. * builtins.c: Likewise. * class.c: Likewise. * constants.c: Likewise. * decl.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * java-gimplify.c: Likewise. * jcf-dump.c: Likewise. * jcf-io.c: Likewise. * jcf-parse.c: Likewise. * jvgenmain.c: Likewise. * lang.c: Likewise. * mangle.c: Likewise. * mangle_name.c: Likewise. * resource.c: Likewise. * typeck.c: Likewise. * verify-glue.c: Likewise. jit 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * dummy-frontend.c: Adjust includes. * jit-common.h: Likewise. * jit-playback.c: Likewise. lto 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * lto-lang.c: Adjust includes. * lto-object.c: Likewise. * lto-partition.c: Likewise. * lto-symtab.c: Likewise. * lto.c: Likewise. objc 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * objc-act.c: Adjust includes. * objc-encoding.c: Likewise. * objc-gnu-runtime-abi-01.c: Likewise. * objc-lang.c: Likewise. * objc-map.c: Likewise. * objc-next-runtime-abi-01.c: Likewise. * objc-next-runtime-abi-02.c: Likewise. * objc-runtime-shared-support.c: Likewise. objcp 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * objcp-decl.c: Adjust includes. * objcp-lang.c: Likewise. From-SVN: r225531
2015-07-08 02:53:03 +02:00
#include "backend.h"
gimple-predict.h: New file. 2015-07-10 Andrew MacLeod <amacleod@redhat.com> * gimple-predict.h: New file. (gimple_predict_predictor, gimple_predict_set_predictor, gimple_predict_outcome, gimple_predict_set_outcome, gimple_build_predict): Relocate here. * gimple.h (gimple_predict_predictor, gimple_predict_set_predictor, gimple_predict_outcome, gimple_predict_set_outcome): Move to gimple-predict.h. * gimple.c (gimple_build_predict): Move to gimple-predict.h * basic-block.h: Don't include cfghooks.h. * backend.h: Don't include predict.h. * cfghooks.h: Include predict.h. * gimple-pretty-print.c: Include gimple-predict.h. * gimplify.c: Likwise. * predict.c: Adjust includes. * tree-inline.c: Likewise. * asan.c: Likewise. * auto-inc-dec.c: Likewise. * auto-profile.c: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfganal.c: Likewise. * cfgbuild.c: Likewise. * cfg.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfgloopanal.c: Likewise. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * cprop.c: Likewise. * cse.c: Likewise. * dce.c: Likewise. * dojump.c: Likewise. * dse.c: Likewise. * except.c: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * fwprop.c: Likewise. * gcc-plugin.h: Likewise. * gcse.c: Likewise. * genattrtab.c: Likewise. * genemit.c: Likewise. * gengtype.c: Likewise. * genopinit.c: Likewise. * genoutput.c: Likewise. * genpreds.c: Likewise. * genrecog.c: Likewise. * gimple-fold.c: Likewise. * gimple-iterator.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * graph.c: Likewise. * graphite-blocking.c: Likewise. * graphite.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-isl-ast-to-gimple.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * haifa-sched.c: Likewise. * ifcvt.c: Likewise. * internal-fn.c: Likewise. * ipa-cp.c: Likewise. * ipa-profile.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-lives.c: Likewise. * jump.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-assigns.c: Likewise. * lra.c: Likewise. * lra-coalesce.c: Likewise. * lra-constraints.c: Likewise. * lra-lives.c: Likewise. * lto-cgraph.c: Likewise. * lto-streamer-in.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * passes.c: Likewise. * postreload.c: Likewise. * postreload-gcse.c: Likewise. * profile.c: Likewise. * recog.c: Likewise. * regstat.c: Likewise. * reload1.c: Likewise. * reorg.c: Likewise. * rtlanal.c: Likewise. * sched-ebb.c: Likewise. * sel-sched-ir.c: Likewise. * sese.c: Likewise. * shrink-wrap.c: Likewise. * simplify-rtx.c: Likewise. * stmt.c: Likewise. * store-motion.c: Likewise. * tracer.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chkp.c: Likewise. * tree-complex.c: Likewise. * tree-eh.c: Likewise. * tree-if-conv.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-sra.c: Likewise. * tree-ssa.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vrp.c: Likewise. * ubsan.c: Likewise. * value-prof.c: Likewise. * varasm.c: Likewise. * var-tracking.c: Likewise. * config/aarch64/aarch64-builtins.c: Likewise. * config/aarch64/aarch64.c: Likewise. * config/aarch64/cortex-a57-fma-steering.c: Likewise. * config/alpha/alpha.c: Likewise. * config/arc/arc.c: Likewise. * config/arm/arm.c: Likewise. * config/avr/avr.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/cr16/cr16.c: Likewise. * config/cris/cris.c: Likewise. * config/darwin.c: Likewise. * config/darwin-c.c: Likewise. * config/epiphany/epiphany.c: Likewise. * config/epiphany/mode-switch-use.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. * config/fr30/fr30.c: Likewise. * config/frv/frv.c: Likewise. * config/ft32/ft32.c: Likewise. * config/h8300/h8300.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/winnt.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/lm32/lm32.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32r/m32r.c: Likewise. * config/m68k/m68k.c: Likewise. * config/mcore/mcore.c: Likewise. * config/mep/mep.c: Likewise. * config/microblaze/microblaze.c: Likewise. * config/mips/mips.c: Likewise. * config/mmix/mmix.c: Likewise. * config/mn10300/mn10300.c: Likewise. * config/moxie/moxie.c: Likewise. * config/msp430/msp430.c: Likewise. * config/nds32/nds32.c: Likewise. * config/nds32/nds32-cost.c: Likewise. * config/nds32/nds32-fp-as-gp.c: Likewise. * config/nds32/nds32-intrinsic.c: Likewise. * config/nds32/nds32-isr.c: Likewise. * config/nds32/nds32-md-auxiliary.c: Likewise. * config/nds32/nds32-memory-manipulation.c: Likewise. * config/nds32/nds32-pipelines-auxiliary.c: Likewise. * config/nds32/nds32-predicates.c: Likewise. * config/nios2/nios2.c: Likewise. * config/nvptx/nvptx.c: Likewise. * config/pa/pa.c: Likewise. * config/pdp11/pdp11.c: Likewise. * config/rl78/rl78.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh.c: Likewise. * config/sh/sh-mem.cc: Likewise. * config/sh/sh_optimize_sett_clrt.cc: Likewise. * config/sh/sh_treg_combine.cc: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/tilegx/tilegx.c: Likewise. * config/tilepro/tilepro.c: Likewise. * config/v850/v850.c: Likewise. * config/vax/vax.c: Likewise. * config/visium/visium.c: Likewise. * config/xtensa/xtensa.c: Likewise. java 2015-07-10 Andrew MacLeod <amacleod@redhat.com> * java-gimplify.c: Include cfghooks.h rather than predict.h. lto 2015-07-10 Andrew MacLeod <amacleod@redhat.com> * lto.c: Include cfghooks.h rather than predict.h. From-SVN: r225668
2015-07-10 14:13:06 +02:00
#include "cfghooks.h"
genattrtab.c (write_header): Include hash-set.h... 2015-01-09 Michael Collison <michael.collison@linaro.org> * genattrtab.c (write_header): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-attrtab.c. * genautomata.c (main) : Include hash-set.h, macInclude hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-automata.c. * genemit.c (main): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-emit.c. * gengtype.c (open_base_files): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating gtype-desc.c. * genopinit.c (main): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-opinit.c. * genoutput.c (output_prologue): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-output.c. * genpeep.c (main): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-peep.c. * genpreds.c (write_insn_preds_c): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-preds.c. * optc-save-gen-awk: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating options-save.c. * opth-gen.awk: Change include guard from GCC_C_COMMON_H to GCC_C_COMMON_C when generating options.h. * ada/gcc-interface/cuintp.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ada/gcc-interface/decl.c: ditto. * ada/gcc-interface/misc.c: ditto. * ada/gcc-interface/targtyps.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ada/gcc-interface/trans.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, real.h, fold-const.h, wide-int.h, inchash.h due to flattening of tree.h. * ada/gcc-interface/utils.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ada/gcc-interface/utils2.c: ditto. * alias.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * asan.c: ditto. * attribs.c: ditto. * auto-inc-dec.c: ditto. * auto-profile.c: ditto * bb-reorder.c: ditto. * bt-load.c: Include symtab.h due to flattening of tree.h. * builtins.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * c/c-array-notation.c: ditto. * c/c-aux-info.c: ditto. * c/c-convert.c: ditto. * c/c-decl.c: ditto. * c/c-errors.c: ditto. * c/c-lang.c: dittoxs. * c/c-objc-common.c: ditto. * c/c-parser.c: ditto. * c/c-typeck.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, inchash.h, real.h and fixed-value.h due to flattening of tree.h. * calls.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ccmp.c: ditto. * c-family/array-notation-common.c: ditto. * c-family/c-ada-spec.c: ditto. * c-family/c-cilkplus.c: ditto. * c-family/c-common.c: Include input.h due to flattening of tree.h. Define macro GCC_C_COMMON_C. * c-family/c-common.h: Flatten tree.h header files into c-common.h. Remove include of tree-core.h. * c-family/c-cppbuiltin.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * c-family/c-dump.c: ditto. * c-family/c-format.c: Flatten tree.h header files into c-common.h. * c-family/c-cppbuiltin.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * c-family/c-dump.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * c-family/c-format.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * c-family/c-gimplify.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * c-family/cilk.c: ditto. * c-family/c-lex.c: ditto. * c-family/c-omp.c: ditto. * c-family/c-opts.c: ditto. * c-family/c-pch.c: ditto. * c-family/c-ppoutput.c: ditto. * c-family/c-pragma.c: ditto. * c-family/c-pretty-print.c: ditto. * c-family/c-semantics.c: ditto. * c-family/c-ubsan.c: ditto. * c-family/stub-objc.c: ditto. * cfgbuild.c: ditto. * cfg.c: ditto. * cfgcleanup.c: ditto. * cfgexpand.c: ditto. * cfghooks.c: ditto. * cfgloop.c: Include symtab.h, fold-const.h, and inchash.h due to flattening of tree.h. * cfgloopmanip.c: ditto. * cfgrtl.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * cgraphbuild.c: ditto. * cgraph.c: ditto. * cgraphclones.c: ditto. * cgraphunit.c: ditto. * cilk-common.c: ditto. * combine.c: ditto. * combine-stack-adj.c: Include symbol.h due to flattening of tree.h. * config/aarch64/aarch64-builtins.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/aarch64/aarch64.c: ditto. * config/alpha/alpha.c: ditto. * config/arc/arc.c: ditto. * config/arm/aarch-common.c: ditto. * config/arm/arm-builtins.c: ditto. * config/arm/arm.c: ditto. * config/arm/arm-c.c: ditto. * config/avr/avr.c: ditto. * config/avr/avr-c.c: ditto. * config/avr/avr-log.c: ditto. * config/bfin/bfin.c: ditto. * config/c6x/c6x.c: ditto. * config/cr16/cr16.c: ditto. * config/cris/cris.c: ditto. * config/darwin.c: ditto. * config/darwin-c.c: ditto. * config/default-c.c: ditto. * config/epiphany/epiphany.c: ditto. * config/fr30/fr30.c: ditto. * config/frv/frv.c: ditto. * config/glibc-c.c: ditto. * config/h8300/h8300.c: ditto. * config/i386/i386.c: ditto. * config/i386/i386-c.c: ditto. * config/i386/msformat.c: ditto. * config/i386/winnt.c: ditto. * config/i386/winnt-cxx.c: ditto. * config/i386/winnt-stubs.c: ditto. * config/ia64/ia64.c: ditto. * config/ia64/ia64-c.c: ditto. * config/iq2000/iq2000.c: ditto. * config/lm32/lm32.c: Include symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/m32c/m32c.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/m32c/m32c-pragma.c: ditto. * config/m32c/m32cr.c: ditto. * config/m68/m68k.c: ditto. * config/mcore/mcore.c: ditto. * config/mep/mep.c: ditto. * config/mep/mep-pragma.c: ditto. * config/microblaze/microblaze.c: ditto. * config/microblaze/microblaze-c.c: ditto. * config/mips/mips.c: ditto. * config/mmix/mmix.c: Include symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/mn10300/mn10300.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/moxie/moxie.c: ditto. * config/msp430/msp430.c: ditto. * config/msp430/msp430-c.c: ditto. * config/nds32/nds32.c: ditto. * config/nds32/nds32-cost.c: ditto. * config/nds32/nds32-fp-as-gp.c: ditto. * config/nds32/nds32-intrinsic.c: ditto. * config/nds32/nds32-isr.c: ditto. * config/nds32/nds32-md-auxillary.c: ditto. * config/nds32/nds32-memory-manipulationx.c: ditto. * config/nds32/nds32-pipelines-auxillary.c: ditto. * config/nds32/nds32-predicates.c: ditto. * config/nios2/nios2.c: ditto. * config/nvptx/nvptx.c: ditto. * config/pa/pa.c: ditto. * config/pdp11/pdp11x.c: Include symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/rl78/rl78.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/rl78/rl78-cx.c: ditto. * config/rs6000/rs6000.c: ditto. * config/rs6000/rs6000-c.c: ditto. * config/rx/rx.c: ditto. * config/s390/s390.c: ditto. * config/sh/sh.c: ditto. * config/sh/sc.c: ditto. * config/sh/sh-mem.cc: ditto. * config/sh/sh_treg_combine.cc: Include symtab.h, inchash.h and tree.h due to flattening of tree.h. Remove include of tree-core.h. * config/sol2.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/sol2-c.c: ditto. * config/sol2-cxx.c: ditto. * config/sol2-stubs.c: ditto. * config/sparc/sparc.c: ditto. * config/sparc/sparc-cx.c: ditto. * config/spu/spu.c: ditto. * config/spu/spu-c.c: ditto * config/storym16/stormy16.c: ditto. * config/tilegx/tilegx.c: Include symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/tilepro/gen-mul-tables.cc: Include symtab.h in generated file. * config/tilegx/tilegx-c.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/tilepro/tilepro.c: Include symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/tilepro/tilepro-c.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/v850/v850.c: ditto. * config/v850/v850-c.c: ditto. * config/vax/vax.c: ditto. * config/vms/vms.c: ditto. * config/vms/vms-c.c: ditto. * config/vxworks.c: ditto. * config/winnt-c.c: ditto. * config/xtensa/xtensa.c: Include symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * convert.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * coverage.c: ditto. * cp/call.c: ditto. * cp/class.c: ditto. * cp/constexpr.c: ditto. * cp/cp-array-notation.c: ditto. * cp/cp-gimplify.c: ditto. * cp/cp-lang.c: ditto. * cp/cp-objcp-common.c: ditto. * cp/cvt.c: ditto. * cp/decl2.c: ditto. * cp/decl.c: ditto. * cp/dump.c: ditto. * cp/error.c: ditto. * cp/except.c: ditto. * cp/expr.c: ditto. * cp/friend.c: ditto. * cp/init.c: ditto. * cp/lambda.c: ditto. * cp/lex.c: ditto. * cp/mangle.c: ditto. * cp/name-lookup.c: ditto. * cp/optimize.c: ditto. * cp/parser.c: ditto. * cp/pt.c: ditto. * cp/ptree.c: ditto. * cp/repo.c: ditto. * cp/rtti.c: ditto. * cp/search.c: ditto. * cp/semantics.c: ditto. * cp/tree.c: ditto. * cp/typeck2.c: ditto. * cp/typeck.c: ditto. * cppbuiltin.c: ditto. * cprop.c: ditto. * cse.c: Add include of symtab.h due to flattening of tree.h. * cselib.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * data-streamer.c: ditto. * data-streamer-in.c: ditto. * data-streamer-out.c: ditto. * dbxout.c: ditto. * dce.c: ditto. * ddg.c: Add include of symtab.h due to flattening of tree.h. * debug.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * dfp.c: ditto. * df-scan.c: ditto. * dojump.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * double-int.c: ditto. * dse.c: ditto. * dumpfile.c: ditto. * dwarf2asm.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * dwarf2cfi.c: ditto. * dwarf2out.c: ditto. * emit-rtl.c: ditto. * except.c: ditto. * explow.c: ditto. * expmed.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * expr.c: ditto. * final.c: ditto. * fixed-value.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and fixed-value.h due to flattening of tree.h. * fold-const.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. Relocate inline function convert_to_ptrofftype_loc from tree.h. Relocate inline function fold_build_pointer_plus_loc from tree.h. Relocate inline function fold_build_pointer_plus_hwi_loc from tree.h. * fold-const.h: Relocate macro convert_to_ptrofftype from tree.h. Relocate macro fold_build_pointer_plus to relocate from tree.h.h. Relocate macro fold_build_pointer_plus_hwi from tree.h. Add prototype for convert_to_ptrofftype_loc relocated from tree.h. Add prototype for fold_build_pointer_plus_loc relocated from tree.h. Add prototype for fold_build_pointer_plus_hwi_loc relocated from tree.h. * fortran/convert.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/cpp.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/decl.c: ditto. * fortran/f95.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/iresolve.c: ditto. * fortran/match.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/module.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/options.c: ditto. * fortran/target-memory.c: Include hash-set.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/trans-array.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/trans.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/trans-common.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/trans-const.c: ditto. * fortran/trans-decl.c: ditto. * fortran/trans-expr.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/trans-intrinsic.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * fortran/trans-io.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/trans-openmp.c: ditto. * fortran/trans-stmt.c: ditto. * fortran/trans-types.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * function.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * gcc-plugin.h: Include statistics.h, double-int.h, real.h, fixed-value.h, alias.h, flags.h, and symtab.h due to flattening of tree.h * gcse.c: ditto. * generic-match-head.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ggc-page.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * gimple-builder.c: ditto. * gimple.c: ditto. * gimple-expr.c: ditto. * gimple-fold.c: ditto. * gimple-iterator.c: ditto. * gimple-low.c: ditto. * gimple-match-head.c: ditto. * gimple-pretty-print.c: ditto. * generic-ssa-isolate-paths.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * gimple-ssa-strength-reduction.c: ditto. * gimple-streamer-in.c: ditto. * gimple-streamer-out.c: ditto. * gimple-walk.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * gimplify.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * gimplify-me.c: ditto. * go/go-gcc.cc: ditto. * go/go-lang.c: ditto. * go/gdump.c: ditto. * graphite-blocking.c: ditto. * graphite.c: ditto. * graphite-dependencies.c: ditto. * graphite-interchange.c: ditto. * graphite-isl-ast-to-gimple.c: ditto. * graphite-optimize-isl.c: ditto. * graphite-poly.c: ditto. * graphite-scop-detection.c: ditto. * graphite-sese-to-poly.c: ditto. * hw-doloop.c: Include symtab.h due to flattening of tree.h. * ifcvt.c: ditto. * init-regs.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * internal-fc.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h,options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa.c: ditto. * ipa-chkp.c: ditto. * ipa-comdats.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-cp.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h,options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-devirt.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-icf.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h,options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-icf-gimple.c: ditto. * ipa-inline-analysis.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-inline.c: ditto. * ipa-inline-transform.c: ditto. * ipa-polymorhpic-call.c: ditto. * ipa-profile.c: ditto. * ipa-prop.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-pure-const.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-ref.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-reference.c: ditto. * ipa-split.c: ditto. * ipa-utils.c: ditto. * ipa-visbility.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ira.c: ditto. * ira-color.c: Include hash-set.h due to flattening of tree.h. * ira-costs.c: ditto. * ira-emit.c: ditto. * java/boehm.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * java/builtins.c: ditto. * java/class.c: ditto. * java/constants.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * java/decl.c: ditto. * java/except.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * java/expr.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h,inchash.h and real.h due to flattening of tree.h. * java/gimplify.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * java/jcf-dump.c: ditto. * java/jcf-io.c: ditto. * java/jcf-parse.c: ditto. * java/jvgenmain.c: ditto. * java/lang.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * java/mangle.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * java/mangle_name.c: ditto. * java/resource.c: ditto. * java/typeck.c: ditto. * java/verify-glue.c: ditto. * java/verify-impl.c: ditto. * jump.c: Include symtab.h due to flattening of tree.h. * langhooks.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * loop-doloop.c: Include symtab.h due to flattening of tree.h. * loop-init.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * loop-invariant.c: Include symtab.h due to flattening of tree.h. * loop-iv.c: ditto. * loop-unroll.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lower-subreg.c: ditto. * lra-assigns.c: Include symtab.h due to flattening of tree.h. * lra.c: Include symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * lra-coalesce.c: Include symtab.h due to flattening of tree.h. * lra-constraints.c: ditto. * lra-eliminations.c: ditto. * lra-livesc: ditto. * lra-remat.c: ditto. * lra-spills.c: ditto. * lto/lto.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lto/lto-lang.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lto/lto-object.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lto/lto-partition.c: ditto. * lto/lto-symtab.c: ditto. * lto-cgraph.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lto-compress.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lto-opts.c: ditto. * lto-section-in.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lto-section-out.c: ditto. * lto-streamer.c: ditto. * lto-streamer-in.c: ditto. * lto-streamer-out.c: ditto. * modulo-sched.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * objc/objc-act.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * objc/objc-encoding.c: ditto. * objc/objc-gnu-runtime-abi-01.c: ditto. * objc/objc-lang.c: ditto. * objc/objc-map.c: ditto. * objc/objc-next-runtime-abi-01.c: ditto. * objc/objc-next-runtime-abi-02.c: ditto. * objc/objc-runtime-shared-support.c: ditto. * objcp/objcp-decl.c: ditto. * objcp/objcp-lang.c: ditto. * omega.c: ditto. * omega-low.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * optabs.c: ditto. * opts-global.c: ditto. * passes.c: ditto. * plugin.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * postreload.c: Include symtab.h due to flattening of tree.h. * postreload-gcse.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * predict.c: ditto. * print-rtl.c: ditto. * print-tree.c: ditto. * profile.c: Include symtab.h, fold-const.h and inchash.h due to flattening of tree.h. * real.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * realmpfr.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * recog.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ree.c: ditto. * reginfo.c: ditto. * reg-stack.c: ditto. * reload1.c: Include symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * reload.c: Include symtab.h due to flattening of tree.h. * reorg.c: ditto. * rtlanal.c: Include symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * rtl-chkp.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * rtlhooks.c: Include symtab.h due to flattening of tree.h. * sanopt.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * sched-deps.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * sched-vis.c: ditto. * sdbout.c: ditto. * sel-sched.c: Include symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * sel-sched-ir.c: ditto. * sese.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * shrink-wrap.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * simplify-rtx.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * stack-ptr-mod.c: ditto. * stmt.c: ditto. * store-motion.c: ditto. * store-layout.c: ditto. * stringpool.c: ditto. * symtab.c: ditto. * target-globals.c: ditto. * targhooks.c: ditto. * toplev.c: ditto. * tracer.c: ditto. * trans-mem.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-affine.c: ditto. * tree-browser.c: ditto. * tree.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-call-cdce.c: Include symtab.h, alias.h, double-int.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * tree-cfg.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-cfgcleanup.c: ditto. * tree-chkp.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-chkp-opt.c: ditto. * tree-chrec.c: ditto. * tree-chkp-opt.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * tree-core.h: Flatten header file by removing all #include statements. * tree-data-ref.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-dfa.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * tree-diagnostic.c: ditto. * tree-dump.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h, real.h and fixed-value.h due to flattening of tree.h. * tree-dfa.c: ditto. * tree-eh.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * tree-emutls.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree.h: Flatten header files by removing all includes except tree-core.h. Remove inline function convert_to_ptrofftype_loc to relocate to fold-const.c. Remove macro convert_to_ptrofftype to relocate to fold-const.h. Remove inline function fold_build_pointer_plus_loc to relocate to fold-const.c. Remove macro fold_build_pointer_plus to relocate to fold-const.h. Remove inline function fold_build_pointer_plus_hwi_loc to relocate to fold-const.c. Remove macro fold_build_pointer_plus_hwi to relocate to fold-const.h. * tree-if-conv.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h, real.h and fixed-value.h due to flattening of tree.h. * tree-inline.c: ditto. * tree-into-ssa.c: ditto. * tree-iterator.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-loop-distribution.c: ditto. * tree-nested.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-nrv.c: ditto. * tree-object-size.c: ditto. * tree-outof-ssa.c: ditto. * tree-parloops.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-phinodes.c: ditto. * tree-predcom.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-pretty-print.c: ditto. * tree-profile.c: double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-scalar-evolution.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-sra.c: Include vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-ssa-alias.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa.c: ditto. * tree-ssa-ccp.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * tree-ssa-coalesce.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-copy.c: ditto. * tree-ssa-copyrename.c: ditto. * tree-ssa-dce.c: ditto. * tree-ssa-dom.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * tree-ssa-dse.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-forwprop.c: ditto. * tree-ssa-ifcombine.c: ditto. * tree-ssa-live.c: ditto. * tree-ssa-loop.c: ditto. * tree-ssa-loop-ch.c: ditto. * tree-ssa-loop-im.c: ditto. * tree-ssa-loop-ivcanon.c: ditto. * tree-ssa-loop-ivopts.c: ditto. * tree-ssa-loop-manip.c: ditto. * tree-ssa-loop-niter.c: ditto. * tree-ssa-loop-prefetch.c: ditto. * tree-ssa-loop-unswitch.c: ditto. * tree-ssa-loop-math-opts.c: ditto. * tree-ssanames.c: ditto. * tree-ssa-operands.c: ditto. * tree-ssa-phiopt.c: ditto. * tree-ssa-phiprop.c: ditto. * tree-ssa-pre.c: ditto. * tree-ssa-propagate.c: ditto. * tree-ssa-reassoc.c: ditto. * tree-ssa-sccvn.c: ditto. * tree-ssa-sink.c: ditto. * tree-ssa-strlen.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-structalias.c: double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-tail-merge.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-ter.c: ditto. * tree-ssa-threadedge.c: ditto. * tree-ssa-threadupdate.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-uncprop.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-uninit.c: ditto. * tree-stdarg.c: Include vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-streamer.c: Include vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-streamer-in.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, inchash.h, real.h and fixed-value.h due to flattening of tree.h. * tree-streamer-out.c: dittoo. * tree-switch-conversion.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-tailcall.c: ditto. * tree-vect-data-refs.c: ditto. * tree-vect-generic.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-vect-loop.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-vect-loop-manip.c: ditto. * tree-vectorizer.c: ditto. * tree-vect-patterns.c: ditto. * tree-vect-slp.c: ditto. * tree-vect-stmts.c: ditto. * tree-vrp.c: ditto. * tsan.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * ubsan.c: ditto. * value-prof.c.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * varasm.c: ditto. * varpool.c: ditto. * var-tracking.c: ditto. * vmsdbgout.c: ditto. * vtable-verify.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * wide-int.cc: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * xcoffout.c: ditto. * libcc1/plugin.cc: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. From-SVN: r219402
2015-01-09 21:18:42 +01:00
#include "tree.h"
tree-core.h: Include symtab.h. 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * tree-core.h: Include symtab.h. * rtl.h: Include hard-reg-set.h but not flags.h. (HARD_CONST): Remove condition compilation involving HARD_CONST since hard-reg-set.h is always included. * regs.h: Don't include hard-reg-set.h or rtl.h. * cfg.h: Include dominance.h. * gimple.h: Include tree-ssa-alias.h and gimple-expr.h. * backend.h: New. Aggregate commonly used backend header files. * gimple-ssa.h: Don't include tree-hasher.h. * ssa.h: New. Aggregate commonly used SSA header files. * regset.h: Remove bitmap.h and hard-reg-set.h #includes. * sel-sched-ir.h: Flatten includes. * lra-int.h: Flatten completely. * sel-sched-dump.h: Flatten includes. * ira-int.h: Flatten includes. * gimple-streamer.h: Remove all includes. * cfgloop.h: Remove all #includes except cfgloopmanip.h. * resource.h: Flatten hard-reg-set.h and df.h. * sched-int.h: Flatten insn-arrt.h and df.h. * valtrack.h: flatten bitmap.h, df.h, and rtl.h * df.h: Flatten includes, leaving regset.h, alloc-pool.h and timevar.h. * genattrtab.c (write_header): Adjust generated includes. * genautomata.c (main): Likewise. * genconditions.c (write-header): Likewise. * genemit.c (main): Likewise. * gengtype.c (open_base_files): Likewise. * genopinit.c (main): Likewise. * genoutput.c (output_prologue): Likewise. * genpeep.c (main): Likewise. * genpreds.c (write_insn_preds_c): Likewise. * genrecog.c (write_header): Likewise. * alias.c: Adjust includes. * asan.c: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * auto-profile.c: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * ccmp.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgbuild.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfgloop.c: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * cilk-common.c: Likewise. * combine-stack-adj.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * cppbuiltin.c: Likewise. * cprop.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * data-streamer-in.c: Likewise. * data-streamer-out.c: Likewise. * data-streamer.c: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * debug.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dfp.c: Likewise. * dojump.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * dse.c: Likewise. * dumpfile.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * explow.c: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * final.c: Likewise. * fixed-value.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * fwprop.c: Likewise. * gcc-plugin.h: Likewise. * gcse-common.c: Likewise. * gcse.c: Likewise. * generic-match-head.c: Likewise. * ggc-page.c: Likewise. * gimple-builder.c: Likewise. * gimple-expr.c: Likewise. * gimple-fold.c: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-match-head.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimple.c: Likewise. * gimplify-me.c: Likewise. * gimplify.c: Likewise. * godump.c: Likewise. * graph.c: Likewise. * graphite-blocking.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-isl-ast-to-gimple.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * ifcvt.c: Likewise. * init-regs.c: Likewise. * internal-fn.c: Likewise. * ipa-chkp.c: Likewise. * ipa-comdats.c: Likewise. * ipa-cp.c: Likewise. * ipa-devirt.c: Likewise. * ipa-icf-gimple.c: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-polymorphic-call.c: Likewise. * ipa-profile.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref.c: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-visibility.c: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-assigns.c: Likewise. * lra-coalesce.c: Likewise. * lra-constraints.c: Likewise. * lra-eliminations.c: Likewise. * lra-lives.c: Likewise. * lra-remat.c: Likewise. * lra-spills.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * opts-global.c: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * real.c: Likewise. * realmpfr.c: Likewise. * recog.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regrename.c: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * reorg.c: Likewise. * resource.c: Likewise. * rtl-chkp.c: Likewise. * rtlanal.c: Likewise. * rtlhooks.c: Likewise. * sanopt.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * shrink-wrap.c: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * symtab.c: Likewise. * target-globals.c: Likewise. * targhooks.c: Likewise. * toplev.c: Likewise. * tracer.c: Likewise. * trans-mem.c: Likewise. * tree-affine.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chkp-opt.c: Likewise. * tree-chkp.c: Likewise. * tree-chrec.c: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-nested.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-scopedtables.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tsan.c: Likewise. * ubsan.c: Likewise. * valtrack.c: Likewise. * value-prof.c: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * vtable-verify.c: Likewise. * web.c: Likewise. * wide-int.cc: Likewise. * xcoffout.c: Likewise. * config/aarch64/aarch64-builtins.c: Likewise. * config/aarch64/aarch64.c: Likewise. * config/aarch64/cortex-a57-fma-steering.c: Likewise. * config/alpha/alpha.c: Likewise. * config/arc/arc.c: Likewise. * config/arm/aarch-common.c: Likewise. * config/arm/arm-builtins.c: Likewise. * config/arm/arm-c.c: Likewise. * config/arm/arm.c: Likewise. * config/avr/avr-c.c: Likewise. * config/avr/avr-log.c: Likewise. * config/avr/avr.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/cr16/cr16.c: Likewise. * config/cris/cris.c: Likewise. * config/darwin-c.c: Likewise. * config/darwin.c: Likewise. * config/epiphany/epiphany.c: Likewise. * config/epiphany/mode-switch-use.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. * config/fr30/fr30.c: Likewise. * config/frv/frv.c: Likewise. * config/ft32/ft32.c: Likewise. * config/h8300/h8300.c: Likewise. * config/i386/i386-c.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/msformat-c.c: Likewise. * config/i386/winnt-cxx.c: Likewise. * config/i386/winnt-stubs.c: Likewise. * config/i386/winnt.c: Likewise. * config/ia64/ia64-c.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/lm32/lm32.c: Likewise. * config/m32c/m32c-pragma.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32r/m32r.c: Likewise. * config/m68k/m68k.c: Likewise. * config/mcore/mcore.c: Likewise. * config/mep/mep-pragma.c: Likewise. * config/mep/mep.c: Likewise. * config/microblaze/microblaze-c.c: Likewise. * config/microblaze/microblaze.c: Likewise. * config/mips/mips.c: Likewise. * config/mmix/mmix.c: Likewise. * config/mn10300/mn10300.c: Likewise. * config/moxie/moxie.c: Likewise. * config/msp430/msp430-c.c: Likewise. * config/msp430/msp430.c: Likewise. * config/nds32/nds32-cost.c: Likewise. * config/nds32/nds32-fp-as-gp.c: Likewise. * config/nds32/nds32-intrinsic.c: Likewise. * config/nds32/nds32-isr.c: Likewise. * config/nds32/nds32-md-auxiliary.c: Likewise. * config/nds32/nds32-memory-manipulation.c: Likewise. * config/nds32/nds32-pipelines-auxiliary.c: Likewise. * config/nds32/nds32-predicates.c: Likewise. * config/nds32/nds32.c: Likewise. * config/nios2/nios2.c: Likewise. * config/nvptx/nvptx.c: Likewise. * config/pa/pa.c: Likewise. * config/pdp11/pdp11.c: Likewise. * config/rl78/rl78-c.c: Likewise. * config/rl78/rl78.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/s390/s390-c.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh-c.c: Likewise. * config/sh/sh-mem.cc: Likewise. * config/sh/sh.c: Likewise. * config/sh/sh_optimize_sett_clrt.cc: Likewise. * config/sh/sh_treg_combine.cc: Likewise. * config/sol2-c.c: Likewise. * config/sol2-cxx.c: Likewise. * config/sol2-stubs.c: Likewise. * config/sol2.c: Likewise. * config/sparc/sparc-c.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu-c.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/tilegx/mul-tables.c: Likewise. * config/tilegx/tilegx-c.c: Likewise. * config/tilegx/tilegx.c: Likewise. * config/tilepro/mul-tables.c: Likewise. * config/tilepro/tilepro-c.c: Likewise. * config/tilepro/tilepro.c: Likewise. * config/v850/v850-c.c: Likewise. * config/v850/v850.c: Likewise. * config/vax/vax.c: Likewise. * config/visium/visium.c: Likewise. * config/vms/vms-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/xtensa/xtensa.c: Likewise. ada 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * gcc-interface/cuintp.c: Adjust includes. * gcc-interface/decl.c: Likewise. * gcc-interface/misc.c: Likewise. * gcc-interface/targtyps.c: Likewise. * gcc-interface/trans.c: Likewise. * gcc-interface/utils.c: Likewise. * gcc-interface/utils2.c: Likewise. c 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * c-array-notation.c: Adjust includes. * c-aux-info.c: Likewise. * c-convert.c: Likewise. * c-decl.c: Likewise. * c-errors.c: Likewise. * c-lang.c: Likewise. * c-objc-common.c: Likewise. * c-parser.c: Likewise. * c-typeck.c: Likewise. c-family 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * array-notation-common.c: Adjust includes. * c-ada-spec.c: Likewise. * c-cilkplus.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-dump.c: Likewise. * c-format.c: Likewise. * c-gimplify.c: Likewise. * c-indentation.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-pch.c: Likewise. * c-ppoutput.c: Likewise. * c-pragma.c: Likewise. * c-pretty-print.c: Likewise. * c-semantics.c: Likewise. * c-ubsan.c: Likewise. * cilk.c: Likewise. * stub-objc.c: Likewise. cp 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * call.c: Adjust includes. * class.c: Likewise. * constexpr.c: Likewise. * cp-array-notation.c: Likewise. * cp-gimplify.c: Likewise. * cp-lang.c: Likewise. * cp-objcp-common.c: Likewise. * cp-ubsan.c: Likewise. * cvt.c: Likewise. * decl.c: Likewise. * decl2.c: Likewise. * dump.c: Likewise. * error.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * friend.c: Likewise. * init.c: Likewise. * lambda.c: Likewise. * lex.c: Likewise. * mangle.c: Likewise. * method.c: Likewise. * name-lookup.c: Likewise. * optimize.c: Likewise. * parser.c: Likewise. * pt.c: Likewise. * ptree.c: Likewise. * repo.c: Likewise. * rtti.c: Likewise. * search.c: Likewise. * semantics.c: Likewise. * tree.c: Likewise. * typeck.c: Likewise. * typeck2.c: Likewise. fortran 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * convert.c: Adjust includes. * cpp.c: Likewise. * decl.c: Likewise. * f95-lang.c: Likewise. * iresolve.c: Likewise. * match.c: Likewise. * module.c: Likewise. * options.c: Likewise. * target-memory.c: Likewise. * trans-array.c: Likewise. * trans-common.c: Likewise. * trans-const.c: Likewise. * trans-decl.c: Likewise. * trans-expr.c: Likewise. * trans-intrinsic.c: Likewise. * trans-io.c: Likewise. * trans-openmp.c: Likewise. * trans-stmt.c: Likewise. * trans-types.c: Likewise. * trans.c: Likewise. go 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * go-backend.c: Adjust includes. * go-gcc.cc: Likewise. * go-lang.c: Likewise. java 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * boehm.c: Adjust includes. * builtins.c: Likewise. * class.c: Likewise. * constants.c: Likewise. * decl.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * java-gimplify.c: Likewise. * jcf-dump.c: Likewise. * jcf-io.c: Likewise. * jcf-parse.c: Likewise. * jvgenmain.c: Likewise. * lang.c: Likewise. * mangle.c: Likewise. * mangle_name.c: Likewise. * resource.c: Likewise. * typeck.c: Likewise. * verify-glue.c: Likewise. jit 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * dummy-frontend.c: Adjust includes. * jit-common.h: Likewise. * jit-playback.c: Likewise. lto 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * lto-lang.c: Adjust includes. * lto-object.c: Likewise. * lto-partition.c: Likewise. * lto-symtab.c: Likewise. * lto.c: Likewise. objc 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * objc-act.c: Adjust includes. * objc-encoding.c: Likewise. * objc-gnu-runtime-abi-01.c: Likewise. * objc-lang.c: Likewise. * objc-map.c: Likewise. * objc-next-runtime-abi-01.c: Likewise. * objc-next-runtime-abi-02.c: Likewise. * objc-runtime-shared-support.c: Likewise. objcp 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * objcp-decl.c: Adjust includes. * objcp-lang.c: Likewise. From-SVN: r225531
2015-07-08 02:53:03 +02:00
#include "gimple.h"
fix pr46851 and pr60340: remove unmaintained omega dependence test Regstrapped on amd64-linux. 2015-07-18 Sebastian Pop <s.pop@samsung.com> PR middle-end/46851 PR middle-end/60340 * Makefile.in: Removed omega.o. * common.opt: Remove flag fcheck-data-deps. * doc/invoke.texi: Remove documentation for fcheck-data-deps and its associated params: omega-max-vars, omega-max-geqs, omega-max-eqs, omega-max-wild-cards, omega-hash-table-size, omega-max-keys, omega-eliminate-redundant-constraints. * doc/loop.texi: Remove all the section on Omega. * graphite-blocking.c: Include missing params.h: it used to be included through tree-data-ref.h and omega.h. * graphite-isl-ast-to-gimple.c: Same. * graphite-optimize-isl.c: Same. * graphite-sese-to-poly.c: Same. * graphite.c: Same. * omega.c: Remove. * omega.h: Remove. * params.def: Removed PARAM_OMEGA_MAX_VARS, PARAM_OMEGA_MAX_GEQS, PARAM_OMEGA_MAX_EQS, PARAM_OMEGA_MAX_WILD_CARDS, PARAM_OMEGA_HASH_TABLE_SIZE, PARAM_OMEGA_MAX_KEYS, and PARAM_OMEGA_ELIMINATE_REDUNDANT_CONSTRAINTS. * passes.def: Remove pass_check_data_deps. * tree-data-ref.c (dump_affine_function): Declare DEBUG_FUNCTION. (dump_conflict_function): Same. (dump_subscript): Same. (print_direction_vector): Same. (print_dir_vectors): Same. (print_lambda_vector): Same. (print_dist_vectors): Same. (dump_data_dependence_relation): Same. (dump_data_dependence_relations): Same. (dump_dist_dir_vectors): Same. (dump_ddrs): Same. (init_omega_eq_with_af): Removed. (omega_extract_distance_vectors): Removed. (omega_setup_subscript): Removed. (init_omega_for_ddr_1): Removed. (init_omega_for_ddr): Removed. (ddr_consistent_p): Removed. (compute_affine_dependence): Do not use omega to check data dependences. (compute_data_dependences_for_bb): Removed. (analyze_all_data_dependences): Removed. (tree_check_data_deps): Removed. * tree-data-ref.h: Do not include omega.h. (compute_data_dependences_for_bb): Removed. (tree_check_data_deps): Removed. * tree-ssa-loop.c (pass_check_data_deps): Removed. (make_pass_check_data_deps): Removed. * tree-ssa-phiopt.c: Include params.h. * tree-vect-data-refs.c: Same. * tree-vect-slp.c: Same. testsuite/ * gcc.dg/tree-ssa/pr42327.c: Removed. * g++.dg/other/pr35011.C: Removed. From-SVN: r225979
2015-07-18 03:11:05 +02:00
#include "params.h"
tree-core.h: Include symtab.h. 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * tree-core.h: Include symtab.h. * rtl.h: Include hard-reg-set.h but not flags.h. (HARD_CONST): Remove condition compilation involving HARD_CONST since hard-reg-set.h is always included. * regs.h: Don't include hard-reg-set.h or rtl.h. * cfg.h: Include dominance.h. * gimple.h: Include tree-ssa-alias.h and gimple-expr.h. * backend.h: New. Aggregate commonly used backend header files. * gimple-ssa.h: Don't include tree-hasher.h. * ssa.h: New. Aggregate commonly used SSA header files. * regset.h: Remove bitmap.h and hard-reg-set.h #includes. * sel-sched-ir.h: Flatten includes. * lra-int.h: Flatten completely. * sel-sched-dump.h: Flatten includes. * ira-int.h: Flatten includes. * gimple-streamer.h: Remove all includes. * cfgloop.h: Remove all #includes except cfgloopmanip.h. * resource.h: Flatten hard-reg-set.h and df.h. * sched-int.h: Flatten insn-arrt.h and df.h. * valtrack.h: flatten bitmap.h, df.h, and rtl.h * df.h: Flatten includes, leaving regset.h, alloc-pool.h and timevar.h. * genattrtab.c (write_header): Adjust generated includes. * genautomata.c (main): Likewise. * genconditions.c (write-header): Likewise. * genemit.c (main): Likewise. * gengtype.c (open_base_files): Likewise. * genopinit.c (main): Likewise. * genoutput.c (output_prologue): Likewise. * genpeep.c (main): Likewise. * genpreds.c (write_insn_preds_c): Likewise. * genrecog.c (write_header): Likewise. * alias.c: Adjust includes. * asan.c: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * auto-profile.c: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * ccmp.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgbuild.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfgloop.c: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * cilk-common.c: Likewise. * combine-stack-adj.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * cppbuiltin.c: Likewise. * cprop.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * data-streamer-in.c: Likewise. * data-streamer-out.c: Likewise. * data-streamer.c: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * debug.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dfp.c: Likewise. * dojump.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * dse.c: Likewise. * dumpfile.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * explow.c: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * final.c: Likewise. * fixed-value.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * fwprop.c: Likewise. * gcc-plugin.h: Likewise. * gcse-common.c: Likewise. * gcse.c: Likewise. * generic-match-head.c: Likewise. * ggc-page.c: Likewise. * gimple-builder.c: Likewise. * gimple-expr.c: Likewise. * gimple-fold.c: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-match-head.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimple.c: Likewise. * gimplify-me.c: Likewise. * gimplify.c: Likewise. * godump.c: Likewise. * graph.c: Likewise. * graphite-blocking.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-isl-ast-to-gimple.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * ifcvt.c: Likewise. * init-regs.c: Likewise. * internal-fn.c: Likewise. * ipa-chkp.c: Likewise. * ipa-comdats.c: Likewise. * ipa-cp.c: Likewise. * ipa-devirt.c: Likewise. * ipa-icf-gimple.c: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-polymorphic-call.c: Likewise. * ipa-profile.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref.c: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-visibility.c: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-assigns.c: Likewise. * lra-coalesce.c: Likewise. * lra-constraints.c: Likewise. * lra-eliminations.c: Likewise. * lra-lives.c: Likewise. * lra-remat.c: Likewise. * lra-spills.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * opts-global.c: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * real.c: Likewise. * realmpfr.c: Likewise. * recog.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regrename.c: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * reorg.c: Likewise. * resource.c: Likewise. * rtl-chkp.c: Likewise. * rtlanal.c: Likewise. * rtlhooks.c: Likewise. * sanopt.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * shrink-wrap.c: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * symtab.c: Likewise. * target-globals.c: Likewise. * targhooks.c: Likewise. * toplev.c: Likewise. * tracer.c: Likewise. * trans-mem.c: Likewise. * tree-affine.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chkp-opt.c: Likewise. * tree-chkp.c: Likewise. * tree-chrec.c: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-nested.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-scopedtables.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tsan.c: Likewise. * ubsan.c: Likewise. * valtrack.c: Likewise. * value-prof.c: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * vtable-verify.c: Likewise. * web.c: Likewise. * wide-int.cc: Likewise. * xcoffout.c: Likewise. * config/aarch64/aarch64-builtins.c: Likewise. * config/aarch64/aarch64.c: Likewise. * config/aarch64/cortex-a57-fma-steering.c: Likewise. * config/alpha/alpha.c: Likewise. * config/arc/arc.c: Likewise. * config/arm/aarch-common.c: Likewise. * config/arm/arm-builtins.c: Likewise. * config/arm/arm-c.c: Likewise. * config/arm/arm.c: Likewise. * config/avr/avr-c.c: Likewise. * config/avr/avr-log.c: Likewise. * config/avr/avr.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/cr16/cr16.c: Likewise. * config/cris/cris.c: Likewise. * config/darwin-c.c: Likewise. * config/darwin.c: Likewise. * config/epiphany/epiphany.c: Likewise. * config/epiphany/mode-switch-use.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. * config/fr30/fr30.c: Likewise. * config/frv/frv.c: Likewise. * config/ft32/ft32.c: Likewise. * config/h8300/h8300.c: Likewise. * config/i386/i386-c.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/msformat-c.c: Likewise. * config/i386/winnt-cxx.c: Likewise. * config/i386/winnt-stubs.c: Likewise. * config/i386/winnt.c: Likewise. * config/ia64/ia64-c.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/lm32/lm32.c: Likewise. * config/m32c/m32c-pragma.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32r/m32r.c: Likewise. * config/m68k/m68k.c: Likewise. * config/mcore/mcore.c: Likewise. * config/mep/mep-pragma.c: Likewise. * config/mep/mep.c: Likewise. * config/microblaze/microblaze-c.c: Likewise. * config/microblaze/microblaze.c: Likewise. * config/mips/mips.c: Likewise. * config/mmix/mmix.c: Likewise. * config/mn10300/mn10300.c: Likewise. * config/moxie/moxie.c: Likewise. * config/msp430/msp430-c.c: Likewise. * config/msp430/msp430.c: Likewise. * config/nds32/nds32-cost.c: Likewise. * config/nds32/nds32-fp-as-gp.c: Likewise. * config/nds32/nds32-intrinsic.c: Likewise. * config/nds32/nds32-isr.c: Likewise. * config/nds32/nds32-md-auxiliary.c: Likewise. * config/nds32/nds32-memory-manipulation.c: Likewise. * config/nds32/nds32-pipelines-auxiliary.c: Likewise. * config/nds32/nds32-predicates.c: Likewise. * config/nds32/nds32.c: Likewise. * config/nios2/nios2.c: Likewise. * config/nvptx/nvptx.c: Likewise. * config/pa/pa.c: Likewise. * config/pdp11/pdp11.c: Likewise. * config/rl78/rl78-c.c: Likewise. * config/rl78/rl78.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/s390/s390-c.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh-c.c: Likewise. * config/sh/sh-mem.cc: Likewise. * config/sh/sh.c: Likewise. * config/sh/sh_optimize_sett_clrt.cc: Likewise. * config/sh/sh_treg_combine.cc: Likewise. * config/sol2-c.c: Likewise. * config/sol2-cxx.c: Likewise. * config/sol2-stubs.c: Likewise. * config/sol2.c: Likewise. * config/sparc/sparc-c.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu-c.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/tilegx/mul-tables.c: Likewise. * config/tilegx/tilegx-c.c: Likewise. * config/tilegx/tilegx.c: Likewise. * config/tilepro/mul-tables.c: Likewise. * config/tilepro/tilepro-c.c: Likewise. * config/tilepro/tilepro.c: Likewise. * config/v850/v850-c.c: Likewise. * config/v850/v850.c: Likewise. * config/vax/vax.c: Likewise. * config/visium/visium.c: Likewise. * config/vms/vms-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/xtensa/xtensa.c: Likewise. ada 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * gcc-interface/cuintp.c: Adjust includes. * gcc-interface/decl.c: Likewise. * gcc-interface/misc.c: Likewise. * gcc-interface/targtyps.c: Likewise. * gcc-interface/trans.c: Likewise. * gcc-interface/utils.c: Likewise. * gcc-interface/utils2.c: Likewise. c 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * c-array-notation.c: Adjust includes. * c-aux-info.c: Likewise. * c-convert.c: Likewise. * c-decl.c: Likewise. * c-errors.c: Likewise. * c-lang.c: Likewise. * c-objc-common.c: Likewise. * c-parser.c: Likewise. * c-typeck.c: Likewise. c-family 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * array-notation-common.c: Adjust includes. * c-ada-spec.c: Likewise. * c-cilkplus.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-dump.c: Likewise. * c-format.c: Likewise. * c-gimplify.c: Likewise. * c-indentation.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-pch.c: Likewise. * c-ppoutput.c: Likewise. * c-pragma.c: Likewise. * c-pretty-print.c: Likewise. * c-semantics.c: Likewise. * c-ubsan.c: Likewise. * cilk.c: Likewise. * stub-objc.c: Likewise. cp 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * call.c: Adjust includes. * class.c: Likewise. * constexpr.c: Likewise. * cp-array-notation.c: Likewise. * cp-gimplify.c: Likewise. * cp-lang.c: Likewise. * cp-objcp-common.c: Likewise. * cp-ubsan.c: Likewise. * cvt.c: Likewise. * decl.c: Likewise. * decl2.c: Likewise. * dump.c: Likewise. * error.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * friend.c: Likewise. * init.c: Likewise. * lambda.c: Likewise. * lex.c: Likewise. * mangle.c: Likewise. * method.c: Likewise. * name-lookup.c: Likewise. * optimize.c: Likewise. * parser.c: Likewise. * pt.c: Likewise. * ptree.c: Likewise. * repo.c: Likewise. * rtti.c: Likewise. * search.c: Likewise. * semantics.c: Likewise. * tree.c: Likewise. * typeck.c: Likewise. * typeck2.c: Likewise. fortran 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * convert.c: Adjust includes. * cpp.c: Likewise. * decl.c: Likewise. * f95-lang.c: Likewise. * iresolve.c: Likewise. * match.c: Likewise. * module.c: Likewise. * options.c: Likewise. * target-memory.c: Likewise. * trans-array.c: Likewise. * trans-common.c: Likewise. * trans-const.c: Likewise. * trans-decl.c: Likewise. * trans-expr.c: Likewise. * trans-intrinsic.c: Likewise. * trans-io.c: Likewise. * trans-openmp.c: Likewise. * trans-stmt.c: Likewise. * trans-types.c: Likewise. * trans.c: Likewise. go 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * go-backend.c: Adjust includes. * go-gcc.cc: Likewise. * go-lang.c: Likewise. java 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * boehm.c: Adjust includes. * builtins.c: Likewise. * class.c: Likewise. * constants.c: Likewise. * decl.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * java-gimplify.c: Likewise. * jcf-dump.c: Likewise. * jcf-io.c: Likewise. * jcf-parse.c: Likewise. * jvgenmain.c: Likewise. * lang.c: Likewise. * mangle.c: Likewise. * mangle_name.c: Likewise. * resource.c: Likewise. * typeck.c: Likewise. * verify-glue.c: Likewise. jit 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * dummy-frontend.c: Adjust includes. * jit-common.h: Likewise. * jit-playback.c: Likewise. lto 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * lto-lang.c: Adjust includes. * lto-object.c: Likewise. * lto-partition.c: Likewise. * lto-symtab.c: Likewise. * lto.c: Likewise. objc 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * objc-act.c: Adjust includes. * objc-encoding.c: Likewise. * objc-gnu-runtime-abi-01.c: Likewise. * objc-lang.c: Likewise. * objc-map.c: Likewise. * objc-next-runtime-abi-01.c: Likewise. * objc-next-runtime-abi-02.c: Likewise. * objc-runtime-shared-support.c: Likewise. objcp 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * objcp-decl.c: Adjust includes. * objcp-lang.c: Likewise. From-SVN: r225531
2015-07-08 02:53:03 +02:00
#include "fold-const.h"
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
#include "gimple-fold.h"
#include "gimple-iterator.h"
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
#include "gimplify.h"
#include "gimplify-me.h"
#include "tree-eh.h"
#include "tree-ssa-loop.h"
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
#include "tree-ssa-operands.h"
#include "tree-ssa-propagate.h"
#include "tree-pass.h"
#include "cfgloop.h"
#include "tree-data-ref.h"
#include "tree-ssa-loop-manip.h"
#include "tree-scalar-evolution.h"
#include "gimple-ssa.h"
Remove limit_scops This patch removes graphite-scop-detection.c:limit_scops function and fix related issues arising because of that. The functionality limit_scop was added as an intermediate step to discard the loops which graphite could not handle. Removing limit_scop required handling of different cases of loops and surrounding code. The scop is now larger so most test cases required 'number of scops detected' to be fixed. By increasing the size of scop we can now optimize loops which are 'siblings' of each other. This could enable loop fusion on a number of loops. Since in the graphite framework we mostly want to opimize loop-nests/adjacent-loops, we now discard scops with less than 2 loops. We also discard scops without any data references. Essentially: - Remove limite_scops. - Only select scops when there are at least two loops (loop nest or, side by side). - Discard loops without data-refs. - Fix test cases. Passes bootstrap and reg-test. gcc/ChangeLog: 2015-09-02 Aditya Kumar <hiraditya@msn.com> Sebastian Pop <s.pop@samsung.com> * graphite-isl-ast-to-gimple.c (gcc_expression_from_isl_ast_expr_id): Return the parameter if it was saved in corresponding parameter_rename_map of the region. (copy_def): Copy def from sese region to the newly created region. (copy_internal_parameters): Copy all the internal parameters defined within a region to the newly created region. (graphite_regenerate_ast_isl): Copy parameters to the new region before translating isl to gimple. * graphite-scop-detection.c (graphite_can_represent_loop): Bail out if the loop-nest does not have any data-references. (build_graphite_scops): Create a scop only when there is at least one loop inside it. (contains_only_close_phi_nodes): Deleted. (print_graphite_scop_statistics): Deleted (print_graphite_statistics): Deleted (limit_scops): Deleted. (build_scops): Removed call to limit_scops. * sese.c (new_sese): Construct. (free_sese): Destruct. (sese_add_exit_phis_edge): update_stmt after exit phi edge has been added. (set_rename): Pass sese region so that parameters inside the region can be added to its parameter_rename_map. (rename_uses): Pass sese region. (graphite_copy_stmts_from_block): Do not copy parameters that have been generated in the header of the scop. For each SSA_NAME in the parameter_rename_map rename its usage. (invariant_in_sese_p_rec): Return false if tree t is defined outside sese region. (scalar_evolution_in_region): If the tree t is invariant just return t. * sese.h: Added a parameter renamne map (parameter_rename_map_t) to struct sese to keep track of all the parameters which need renaming. * tree-data-ref.c (loop_nest_has_data_refs): Check if a loop nest has any data-refs. * tree-data-ref.h: Declaration of loop_nest_has_data_refs. gcc/testsuite/ChangeLog: 2015-09-02 Aditya Kumar <hiraditya@msn.com> Sebastian Pop <s.pop@samsung.com> * gcc.dg/graphite/block-0.c: Modifed test case to match current output. * gcc.dg/graphite/block-1.c: Same. * gcc.dg/graphite/block-5.c: Same. * gcc.dg/graphite/block-6.c: Same. * gcc.dg/graphite/interchange-1.c: Same. * gcc.dg/graphite/interchange-10.c: Same. * gcc.dg/graphite/interchange-11.c: Same. * gcc.dg/graphite/interchange-13.c: Same. * gcc.dg/graphite/interchange-14.c: Same. * gcc.dg/graphite/interchange-3.c: Same. * gcc.dg/graphite/interchange-4.c: Same. * gcc.dg/graphite/interchange-7.c: Same. * gcc.dg/graphite/interchange-8.c: Same. * gcc.dg/graphite/interchange-9.c: Same. * gcc.dg/graphite/isl-codegen-loop-dumping.c: Same. * gcc.dg/graphite/pr35356-1.c (foo): Same. * gcc.dg/graphite/pr37485.c: Same. * gcc.dg/graphite/scop-0.c (int toto): Same. * gcc.dg/graphite/scop-1.c: Same. * gcc.dg/graphite/scop-10.c: Same. * gcc.dg/graphite/scop-11.c: Same. * gcc.dg/graphite/scop-12.c: Same. * gcc.dg/graphite/scop-13.c: Same. * gcc.dg/graphite/scop-16.c: Same. * gcc.dg/graphite/scop-17.c: Same. * gcc.dg/graphite/scop-18.c: Same. * gcc.dg/graphite/scop-2.c: Same. * gcc.dg/graphite/scop-21.c (int test): Same. * gcc.dg/graphite/scop-22.c (void foo): Same. * gcc.dg/graphite/scop-4.c: Same. * gcc.dg/graphite/scop-5.c: Same. * gcc.dg/graphite/scop-6.c: Same. * gcc.dg/graphite/scop-7.c: Same. * gcc.dg/graphite/scop-8.c: Same. * gcc.dg/graphite/scop-9.c: Same. * gcc.dg/graphite/scop-mvt.c (void mvt): Introduced dependency so that data-refs remain inside the inner loop. * gcc.dg/graphite/uns-block-1.c: Modifed test case to match o/p. * gcc.dg/graphite/uns-interchange-14.c: Same. * gcc.dg/graphite/uns-interchange-9.c: Same. * gfortran.dg/graphite/interchange-3.f90 libgomp/ChangeLog: 2015-09-04 Aditya Kumar <hiraditya@msn.com> Sebastian Pop <s.pop@samsung.com> * testsuite/libgomp.graphite/bounds.c (int foo): Modifed test case to match o/p. * testsuite/libgomp.graphite/force-parallel-1.c (void parloop): Same. * testsuite/libgomp.graphite/force-parallel-4.c: Same. * testsuite/libgomp.graphite/force-parallel-5.c: Same. * testsuite/libgomp.graphite/force-parallel-7.c: Same. * testsuite/libgomp.graphite/force-parallel-8.c: Same. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r227567
2015-09-09 00:18:11 +02:00
#include "tree-phinodes.h"
#include "tree-into-ssa.h"
Remove limit_scops This patch removes graphite-scop-detection.c:limit_scops function and fix related issues arising because of that. The functionality limit_scop was added as an intermediate step to discard the loops which graphite could not handle. Removing limit_scop required handling of different cases of loops and surrounding code. The scop is now larger so most test cases required 'number of scops detected' to be fixed. By increasing the size of scop we can now optimize loops which are 'siblings' of each other. This could enable loop fusion on a number of loops. Since in the graphite framework we mostly want to opimize loop-nests/adjacent-loops, we now discard scops with less than 2 loops. We also discard scops without any data references. Essentially: - Remove limite_scops. - Only select scops when there are at least two loops (loop nest or, side by side). - Discard loops without data-refs. - Fix test cases. Passes bootstrap and reg-test. gcc/ChangeLog: 2015-09-02 Aditya Kumar <hiraditya@msn.com> Sebastian Pop <s.pop@samsung.com> * graphite-isl-ast-to-gimple.c (gcc_expression_from_isl_ast_expr_id): Return the parameter if it was saved in corresponding parameter_rename_map of the region. (copy_def): Copy def from sese region to the newly created region. (copy_internal_parameters): Copy all the internal parameters defined within a region to the newly created region. (graphite_regenerate_ast_isl): Copy parameters to the new region before translating isl to gimple. * graphite-scop-detection.c (graphite_can_represent_loop): Bail out if the loop-nest does not have any data-references. (build_graphite_scops): Create a scop only when there is at least one loop inside it. (contains_only_close_phi_nodes): Deleted. (print_graphite_scop_statistics): Deleted (print_graphite_statistics): Deleted (limit_scops): Deleted. (build_scops): Removed call to limit_scops. * sese.c (new_sese): Construct. (free_sese): Destruct. (sese_add_exit_phis_edge): update_stmt after exit phi edge has been added. (set_rename): Pass sese region so that parameters inside the region can be added to its parameter_rename_map. (rename_uses): Pass sese region. (graphite_copy_stmts_from_block): Do not copy parameters that have been generated in the header of the scop. For each SSA_NAME in the parameter_rename_map rename its usage. (invariant_in_sese_p_rec): Return false if tree t is defined outside sese region. (scalar_evolution_in_region): If the tree t is invariant just return t. * sese.h: Added a parameter renamne map (parameter_rename_map_t) to struct sese to keep track of all the parameters which need renaming. * tree-data-ref.c (loop_nest_has_data_refs): Check if a loop nest has any data-refs. * tree-data-ref.h: Declaration of loop_nest_has_data_refs. gcc/testsuite/ChangeLog: 2015-09-02 Aditya Kumar <hiraditya@msn.com> Sebastian Pop <s.pop@samsung.com> * gcc.dg/graphite/block-0.c: Modifed test case to match current output. * gcc.dg/graphite/block-1.c: Same. * gcc.dg/graphite/block-5.c: Same. * gcc.dg/graphite/block-6.c: Same. * gcc.dg/graphite/interchange-1.c: Same. * gcc.dg/graphite/interchange-10.c: Same. * gcc.dg/graphite/interchange-11.c: Same. * gcc.dg/graphite/interchange-13.c: Same. * gcc.dg/graphite/interchange-14.c: Same. * gcc.dg/graphite/interchange-3.c: Same. * gcc.dg/graphite/interchange-4.c: Same. * gcc.dg/graphite/interchange-7.c: Same. * gcc.dg/graphite/interchange-8.c: Same. * gcc.dg/graphite/interchange-9.c: Same. * gcc.dg/graphite/isl-codegen-loop-dumping.c: Same. * gcc.dg/graphite/pr35356-1.c (foo): Same. * gcc.dg/graphite/pr37485.c: Same. * gcc.dg/graphite/scop-0.c (int toto): Same. * gcc.dg/graphite/scop-1.c: Same. * gcc.dg/graphite/scop-10.c: Same. * gcc.dg/graphite/scop-11.c: Same. * gcc.dg/graphite/scop-12.c: Same. * gcc.dg/graphite/scop-13.c: Same. * gcc.dg/graphite/scop-16.c: Same. * gcc.dg/graphite/scop-17.c: Same. * gcc.dg/graphite/scop-18.c: Same. * gcc.dg/graphite/scop-2.c: Same. * gcc.dg/graphite/scop-21.c (int test): Same. * gcc.dg/graphite/scop-22.c (void foo): Same. * gcc.dg/graphite/scop-4.c: Same. * gcc.dg/graphite/scop-5.c: Same. * gcc.dg/graphite/scop-6.c: Same. * gcc.dg/graphite/scop-7.c: Same. * gcc.dg/graphite/scop-8.c: Same. * gcc.dg/graphite/scop-9.c: Same. * gcc.dg/graphite/scop-mvt.c (void mvt): Introduced dependency so that data-refs remain inside the inner loop. * gcc.dg/graphite/uns-block-1.c: Modifed test case to match o/p. * gcc.dg/graphite/uns-interchange-14.c: Same. * gcc.dg/graphite/uns-interchange-9.c: Same. * gfortran.dg/graphite/interchange-3.f90 libgomp/ChangeLog: 2015-09-04 Aditya Kumar <hiraditya@msn.com> Sebastian Pop <s.pop@samsung.com> * testsuite/libgomp.graphite/bounds.c (int foo): Modifed test case to match o/p. * testsuite/libgomp.graphite/force-parallel-1.c (void parloop): Same. * testsuite/libgomp.graphite/force-parallel-4.c: Same. * testsuite/libgomp.graphite/force-parallel-5.c: Same. * testsuite/libgomp.graphite/force-parallel-7.c: Same. * testsuite/libgomp.graphite/force-parallel-8.c: Same. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r227567
2015-09-09 00:18:11 +02:00
#include "ssa-iterators.h"
#include "tree-cfg.h"
Preserve the original program while using graphite. Earlier, graphite used to translate portions of the original program after scop-detection in order to represent the SCoP into polyhedral model. This was required because each basic block was represented as independent basic block in the polyhedral model. So all the cross-basic-block dependencies were translated out-of-ssa. With this patch those dependencies are also exposed to the ISL, so there is no need to modify the original structure of the program. After this patch we should be able to enable graphite at some default optimization level. Highlights: Remove cross bb scalar to array translation For reductions, add support for more than just INT_CST Early bailout on codegen. Verify loop-closed ssa structure during copy of renames The uses of exprs should come from bb which dominates the bb Collect the init value of close phi in loop-guard Do not follow vuses for close-phi, postpone loop-close phi until the corresponding loop-phi is processed Bail out if no bb found to place cond/loop -phis Move insertion of liveouts at the end of codegen Insert loop-phis in the loop-header. This patch passes regtest and bootstrap with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' 2015-11-11 Aditya Kumar <aditya.k7@samsung.com> Sebastian Pop <s.pop@samsung.com> * graphite-isl-ast-to-gimple.c (class translate_isl_ast_to_gimple): New member codegen_error (translate_isl_ast_for_loop): Remove call to single_succ_edge and early return. (translate_isl_ast_node_user): Early return in case of error. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_to_gimple::translate_pending_phi_nodes): New. (add_parameters_to_ivs_params): Remove macro. (graphite_regenerate_ast_isl): Add if_region pointer to region. * graphite-poly.c (new_poly_dr): Remove macro. (print_pdr): Same. (new_gimple_poly_bb): Same. (free_gimple_poly_bb): Same. (print_scop_params): Same. * graphite-poly.h (struct poly_dr): Same. (struct poly_bb): Add new_bb. (gbb_from_bb): Remove dead code. (pbb_from_bb): Same. * graphite-scop-detection.c (parameter_index_in_region_1): Same. (parameter_index_in_region): Same. (find_scop_parameters): Same. (build_cross_bb_scalars_def): New. (build_cross_bb_scalars_use): New. (graphite_find_cross_bb_scalar_vars): New (try_generate_gimple_bb): Reads and Writes. (build_alias_set): Move. (gather_bbs::before_dom_children): Gather bbs visited. (build_scops): call build_alias_set. * graphite-sese-to-poly.c (phi_arg_in_outermost_loop): Delete. (remove_simple_copy_phi): Delete. (remove_invariant_phi): Delete. (simple_copy_phi_p): Delete. (reduction_phi_p): Delete. (isl_id_for_dr): Remove unused param. (parameter_index_in_region_1): Remove macro usage. (set_scop_parameter_dim): Same. (add_param_constraints): Same. (add_conditions_to_constraints): Same (build_scop_iteration_domain): Same. (pdr_add_alias_set): Comment. (add_scalar_version_numbers): New. (build_poly_dr): ISL id. (build_scop_drs): Move. (build_poly_sr_1): Same. (insert_stmts): Remove. (build_poly_sr): New. (new_pbb_from_pbb): Delete. (insert_out_of_ssa_copy_on_edge): Delete. (create_zero_dim_array): Delete. (scalar_close_phi_node_p): Delete. (propagate_expr_outside_region): Delete. (rewrite_close_phi_out_of_ssa): Delete. (rewrite_phi_out_of_ssa): Delete. (rewrite_degenerate_phi): Delete. (rewrite_reductions_out_of_ssa): Delete. (rewrite_cross_bb_scalar_dependence): Delete. (handle_scalar_deps_crossing_scop_limits): (rewrite_cross_bb_scalar_deps): Delete. (build_poly_scop): Remove calls to out-of-ssa functions. * graphite.c (graphite_transform_loops): Early return in case of codegen error. * sese.c (debug_rename_map_1): Delete. (debug_rename_map): Delete. (sese_record_loop): Remove macro. (build_sese_loop_nests): Same. (new_sese_info): Same. (free_sese_info): Same. (sese_insert_phis_for_liveouts): (is_loop_closed_ssa_use): New. (number_of_phi_nodes): New. (bb_contains_loop_close_phi_nodes): New. (bb_contains_loop_phi_nodes): New. (phi_uses_name): New. (is_valid_rename): (get_rename): Add old_bb and loop_phi for more precise matching of exprs. (set_rename): Pass region. (later_of_the_two): New. (gsi_insert_earliest): New. (collect_all_ssa_names): New. (substitute_ssa_name): New. (rename_all_uses): New. (get_rename_from_scev): New. (rename_uses): Pass old_bb for more precise matching of exprs. (get_def_bb_for_const): New. (get_new_name): New. (get_loc): New. (get_edges): New. (copy_loop_phi_args): New. (copy_loop_phi_nodes): New. (get_loop_init_value): New. (find_init_value): New. (find_init_value_close_phi): New. (copy_loop_close_phi_args): New. (copy_loop_close_phi_nodes): New. (add_phi_arg_for_new_expr): New. (copy_cond_phi_args): New. (copy_cond_phi_nodes): New. (copy_phi_nodes): New. (should_copy_to_new_region): New. (set_rename_for_each_def): New. (graphite_copy_stmts_from_block): Early return in case of error. (copy_bb_and_scalar_dependences): Same. * sese.h (vec_find): New. (SESE_PARAMS): Delete. (SESE_LOOPS): Delete. (SESE_LOOP_NEST): Delete. (sese_contains_loop): Remove macro usage. (sese_nb_params): Same. (struct gimple_poly_bb): Added read_scalar_refs, write_scalar_refs. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r230200
2015-11-12 01:37:47 +01:00
#include "gimple-pretty-print.h"
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
#include "cfganal.h"
#include "value-prof.h"
#include "graphite.h"
/* We always try to use signed 128 bit types, but fall back to smaller types
in case a platform does not provide types of these sizes. In the future we
should use isl to derive the optimal type for each subexpression. */
static int max_mode_int_precision =
GET_MODE_PRECISION (mode_for_size (MAX_FIXED_MODE_SIZE, MODE_INT, 0));
static int graphite_expression_type_precision = 128 <= max_mode_int_precision ?
128 : max_mode_int_precision;
struct ast_build_info
{
ast_build_info()
: is_parallelizable(false)
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
{ }
bool is_parallelizable;
};
/* Converts a GMP constant VAL to a tree and returns it. */
static tree
gmp_cst_to_tree (tree type, mpz_t val)
{
tree t = type ? type : integer_type_node;
mpz_t tmp;
mpz_init (tmp);
mpz_set (tmp, val);
wide_int wi = wi::from_mpz (t, tmp, true);
mpz_clear (tmp);
return wide_int_to_tree (t, wi);
}
/* Verifies properties that GRAPHITE should maintain during translation. */
static inline void
graphite_verify (void)
{
[PATCH 7/9] ENABLE_CHECKING refactoring: middle-end, LTO FE [PATCH 7/9] ENABLE_CHECKING refactoring: middle-end, LTO FE gcc/lto/ChangeLog: 2015-10-27 Mikhail Maltsev <maltsevm@gmail.com> * lto.c (unify_scc): Use flag_checking and remove ENABLE_CHECKING conditionals. (lto_fixup_state): Likewise. (do_whole_program_analysis): Use symtab_node::checking_verify_symtab_nodes and remove ENABLE_CHECKING conditionals. gcc/ChangeLog: 2015-10-27 Mikhail Maltsev <maltsevm@gmail.com> * attribs.c (check_attribute_tables): New function, broken out from... (init_attributes): Use it. * cfgcleanup.c (try_optimize_cfg): Use flag_checking, CHECKING_P gcc_checking_assert and checking_* functions to eliminate ENABLE_CHECKING conditionals. * cfgexpand.c (expand_goto, expand_debug_expr): Likewise. (pass_expand::execute): Likewise. * cgraphclones.c (symbol_table::materialize_all_clones): Likewise. * cgraphunit.c (mark_functions_to_output): Likewise. (cgraph_node::expand_thunk): Likewise. (symbol_table::compile): Likewise. * ddg.c (add_cross_iteration_register_deps): Likewise. (create_ddg_all_sccs): Likewise. * df-core.c (df_finish_pass, df_analyze): Likewise. * diagnostic-core.h: Likewise. * diagnostic.c (diagnostic_report_diagnostic): Likewise. * dominance.c (calculate_dominance_info): Likewise. * dwarf2out.c (add_AT_die_ref): Likewise. (const_ok_for_output_1, mem_loc_descriptor): Likewise. (loc_list_from_tree, gen_lexical_block_die): Likewise. gen_type_die_with_usage, gen_type_die): Likewise. (dwarf2out_decl): Likewise. * emit-rtl.c (verify_rtx_sharing, reorder_insns_nobb): Likewise. * except.c (duplicate_eh_regions): Likewise. * fwprop.c (register_active_defs, update_df_init): Likewise. (fwprop_init, fwprop_done): Likewise. (update_uses): Likewise. * ggc-page.c (ggc_grow): Likewise. * gimplify.c (gimplify_body): Likewise. (gimplify_hasher::equal): Likewise. * graphite-isl-ast-to-gimple.c (graphite_verify): Likewise. * graphite-scop-detection.c (canonicalize_loop_closed_ssa_form): Likewise. * graphite-sese-to-poly.c (rewrite_reductions_out_of_ssa): Likewise. (rewrite_cross_bb_scalar_deps_out_of_ssa): Likwise. * hash-table.h (::find_empty_slot_for_expand): Likewise. * ifcvt.c (if_convert): Likewise. * ipa-cp.c (ipcp_propagate_stage): Likewise. * ipa-devirt.c (type_in_anonymous_namespace_p): Likewise. (odr_type_p, odr_types_equivalent_p): Likewise. (add_type_duplicate, get_odr_type): Likewise. * ipa-icf.c (sem_item_optimizer::execute): Likewise. (sem_item_optimizer::subdivide_classes_by_equality): Likewise. (sem_item_optimizer::verify_classes): Likewise. (sem_item_optimizer::traverse_congruence_split): Likewise. (sem_item_optimizer::checking_verify_classes): New. * ipa-icf.h (sem_item_optimizer::checking_verify_classes): Add new method. * cfgrtl.c (commit_edge_insertions): Likewise. (fixup_reorder_chain, cfg_layout_finalize): Likewise. (rtl_flow_call_edges_add): Likewise. * cgraph.c (symbol_table::create_edge): Likewise. (cgraph_edge::redirect_call_stmt_to_callee): Likewise. * cgraph.h (symtab_node): Likewise. (symtab_node::checking_verify_symtab_nodes): Define. (cgraph_node::checking_verify_cgraph_nodes): Define. * cfghooks.h (checking_verify_flow_info): Define. * cfgloop.h (checking_verify_loop_structure): Define. * dominance.h (checking_verify_dominators): Define. * et-forest.c: Fix comment. * ipa-inline-analysis.c (compute_inline_parameters): Use flag_checking, CHECKING_P gcc_checking_assert and checking_* functions to eliminate ENABLE_CHECKING conditionals. * ipa-inline-transform.c (save_inline_function_body): Likewise. * ipa-inline.c (inline_small_functions): Likewise. (early_inliner): Likewise. * ipa-inline.h (estimate_edge_growth): Likewise. * ipa-visibility.c (function_and_variable_visibility): Likewise. * ipa.c (symbol_table::remove_unreachable_nodes): Likewise. (ipa_single_use): Likewise. * ira-int.h: Likewise. * ira.c (ira): Likewise. * loop-doloop.c (doloop_optimize_loops): Likewise. * loop-init.c (loop_optimizer_init, fix_loop_structure): Likewise. * loop-invariant.c (move_loop_invariants): Likewise. * lra-assigns.c (lra_assign): Likewise. * lra-constraints.c (lra_constraints): Likewise. * lra-eliminations.c (lra_eliminate): Likewise. * lra-int.h (struct lra_reg): Likewise. * lra-lives.c (check_pseudos_live_through_calls): Likewise. (lra_create_live_ranges_1): Likewise. * lra-remat.c (create_remat_bb_data): Likewise. * lra.c (lra_update_insn_recog_data, restore_scratches): Likewise. (lra): Likewise. (check_rtl): Always define. Remove incorrect guard around extract_constrain_insn call. * lto-cgraph.c (input_cgraph_1: Use flag_checking, CHECKING_P gcc_checking_assert and checking_* functions to eliminate ENABLE_CHECKING conditionals. * lto-streamer-out.c (DFS::DFS): Likewise. (lto_output): Likewise. * lto-streamer.c (lto_streamer_init): Likewise. * omp-low.c (scan_omp_target, expand_omp_taskreg): Likewise. expand_omp_target, execute_expand_omp): Likewise. (lower_omp_target): Likewise. * passes.c (execute_function_todo): Likewise. (execute_todo, execute_one_pass): Likewise. (verify_curr_properties): Always define. * predict.c (tree_estimate_probability: Use flag_checking, CHECKING_P gcc_checking_assert and checking_* functions to eliminate ENABLE_CHECKING conditionals. (propagate_freq): Likewise. * pretty-print.c (pp_format): Likewise. * real.c (real_to_decimal_for_mode): Likewise. * recog.c (split_all_insns): Likewise. * regcprop.c (kill_value_one_regno): Likewise. (copy_value): Likewise. (validate_value_data): Define unconditionally. * reload.c: Fix comment. * timevar.c: Include options.h * tree-ssa.h (checking_verify_ssa): Define. * tree-ssa-loop-manip.h (checking_verify_loop_closed_ssa): Define. * sched-deps.c (CHECK): Remove unused macro. (add_or_update_dep_1, sd_add_dep: Use flag_checking, CHECKING_P gcc_checking_assert and checking_* functions to eliminate ENABLE_CHECKING conditionals. * sel-sched-ir.c (free_regset_pool, tidy_control_flow): Likewise. * sel-sched.c (struct moveop_static_params): Likewise. (find_best_reg_for_expr, move_cond_jump): Likewise. (move_op_orig_expr_not_found): Likewise. (code_motion_process_successors, move_op): Likewise. * ssa-iterators.h (first_readonly_imm_use): Likewise. (next_readonly_imm_use): Likewise. * store-motion.c (compute_store_table): Likewise. * symbol-summary.h (function_summary::function_summary): Likewise. * target.h (cumulative_args_t): Likewise. (get_cumulative_args, pack_cumulative_args): Likewise. * timevar.c: (timer::print): Likewise. * trans-mem.c (ipa_tm_execute): Likewise. * tree-cfg.c (move_stmt_op): Likewise. (move_sese_region_to_fn): Likewise. (gimple_flow_call_edges_add): Likewise. * tree-cfgcleanup.c (cleanup_tree_cfg_noloop, repair_loop_structures): Likewise. * tree-eh.c (remove_unreachable_handlers): Likewise. * tree-if-conv.c (pass_if_conversion::execute): Likewise. * tree-inline.c (expand_call_inline, optimize_inline_calls): Likewise. * tree-into-ssa.c (update_ssa): Likewise. * tree-loop-distribution.c (pass_loop_distribution::execute): Likewise. * tree-outof-ssa.c (eliminate_useless_phis, rewrite_trees): Likewise. * tree-parloops.c (pass_parallelize_loops::execute): Likewise. * tree-predcom.c (suitable_component_p): Likewise. * tree-profile.c (gimple_gen_const_delta_profiler): Likewise. * tree-ssa-alias.c (refs_may_alias_p_1): Likewise. * tree-ssa-live.c (verify_live_on_entry): Likewise. * tree-ssa-live.h (register_ssa_partition): Likewise. * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely): Likewise. * tree-ssa-loop-manip.c (add_exit_phi): Likewise. (tree_transform_and_unroll_loop): Likewise. * tree-ssa-math-opts.c (pass_cse_reciprocals::execute): Likewise. * tree-ssa-operands.c (get_expr_operands): Likewise. * tree-ssa-propagate.c (replace_exp_1): Likewise. * tree-ssa-structalias.c (rewrite_constraints): Likewise. * tree-ssa-ter.c (free_temp_expr_table): Likewise. * tree-ssa-threadupdate.c (duplicate_thread_path): Likewise. * tree-ssanames.c (release_ssa_name_fn): Likewise. * tree-stdarg.c (expand_ifn_va_arg): Likewise. * tree-vect-loop-manip.c (slpeel_tree_duplicate_loop_to_edge_cfg): Likewise. (slpeel_checking_verify_cfg_after_peeling): Likewise. (vect_do_peeling_for_loop_bound): Likewise. (vect_do_peeling_for_alignment): Likewise. * tree-vrp.c (supports_overflow_infinity): Likewise. (set_value_range): Likewise. * tree.c (free_lang_data_in_cgraph): Likewise. * value-prof.c (gimple_remove_histogram_value): Likewise. (free_hist): Likewise. * var-tracking.c (canonicalize_values_star): Likewise. (compute_bb_dataflow, vt_find_locations, vt_emit_notes): Likewise. From-SVN: r229470
2015-10-28 02:05:53 +01:00
checking_verify_loop_structure ();
checking_verify_loop_closed_ssa (true);
}
2015-12-17 19:50:05 +01:00
/* IVS_PARAMS maps isl's scattering and parameter identifiers
to corresponding trees. */
typedef std::map<isl_id *, tree> ivs_params;
2015-12-17 19:50:05 +01:00
/* Free all memory allocated for isl's identifiers. */
new scop schedule for isl-0.15 Keep unchanged the implementation for isl-0.14. * graphite-poly.c (apply_poly_transforms): Simplify. (print_isl_set): Use more readable format: ISL_YAML_STYLE_BLOCK. (print_isl_map): Same. (print_isl_union_map): Same. (print_isl_schedule): New. (debug_isl_schedule): New. * graphite-dependences.c (scop_get_reads): Do not call isl_union_map_add_map that is undocumented isl functionality. (scop_get_must_writes): Same. (scop_get_may_writes): Same. (scop_get_original_schedule): Remove. (scop_get_dependences): Do not call isl_union_map_compute_flow that is deprecated in isl 0.15. Instead, use isl_union_access_* interface. (compute_deps): Remove. * graphite-isl-ast-to-gimple.c (print_schedule_ast): New. (debug_schedule_ast): New. (translate_isl_ast_to_gimple::scop_to_isl_ast): Call set_separate_option. (graphite_regenerate_ast_isl): Add dump. (translate_isl_ast_to_gimple::scop_to_isl_ast): Generate code from scop->transformed_schedule. (graphite_regenerate_ast_isl): Add more dump. * graphite-optimize-isl.c (optimize_isl): Set scop->transformed_schedule. Check whether schedules are equal. (apply_poly_transforms): Move here. * graphite-poly.c (apply_poly_transforms): ... from here. (free_poly_bb): Static. (free_scop): Static. (pbb_number_of_iterations_at_time): Remove. (print_isl_ast): New. (debug_isl_ast): New. (debug_scop_pbb): New. * graphite-scop-detection.c (print_edge): Move. (print_sese): Move. * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons): Remove. (build_scop_scattering): Remove. (create_pw_aff_from_tree): Assert instead of bailing out. (add_condition_to_pbb): Remove unused code, do not fail. (add_conditions_to_domain): Same. (add_conditions_to_constraints): Remove. (build_scop_context): New. (add_iter_domain_dimension): New. (build_iteration_domains): Initialize pbb->iterators. Call add_conditions_to_domain. (nested_in): New. (loop_at): New. (index_outermost_in_loop): New. (index_pbb_in_loop): New. (outermost_pbb_in): New. (add_in_sequence): New. (add_outer_projection): New. (outer_projection_mupa): New. (add_loop_schedule): New. (build_schedule_pbb): New. (build_schedule_loop): New. (embed_in_surrounding_loops): New. (build_schedule_loop_nest): New. (build_original_schedule): New. (build_poly_scop): Call build_original_schedule. * graphite.h: Declare print_isl_schedule and debug_isl_schedule. (free_poly_dr): Remove. (struct poly_bb): Add iterators. Remove schedule, transformed, saved. (free_poly_bb): Remove. (debug_loop_vec): Remove. (print_isl_ast): Declare. (debug_isl_ast): Declare. (scop_do_interchange): Remove. (scop_do_strip_mine): Remove. (scop_do_block): Remove. (flatten_all_loops): Remove. (optimize_isl): Remove. (pbb_number_of_iterations_at_time): Remove. (debug_scop_pbb): Declare. (print_schedule_ast): Declare. (debug_schedule_ast): Declare. (struct scop): Remove schedule. Add original_schedule, transformed_schedule. (free_gimple_poly_bb): Remove. (print_generated_program): Remove. (debug_generated_program): Remove. (unify_scattering_dimensions): Remove. * sese.c (print_edge): ... here. (print_sese): ... here. (debug_edge): ... here. (debug_sese): ... here. * sese.h (print_edge): Declare. (print_sese): Declare. (dump_edge): Declare. (dump_sese): Declare. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r232812
2016-01-26 01:19:20 +01:00
static void ivs_params_clear (ivs_params &ip)
{
std::map<isl_id *, tree>::iterator it;
for (it = ip.begin ();
it != ip.end (); it++)
{
isl_id_free (it->first);
}
}
#ifdef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
/* Set the "separate" option for the schedule node. */
new scop schedule for isl-0.15 Keep unchanged the implementation for isl-0.14. * graphite-poly.c (apply_poly_transforms): Simplify. (print_isl_set): Use more readable format: ISL_YAML_STYLE_BLOCK. (print_isl_map): Same. (print_isl_union_map): Same. (print_isl_schedule): New. (debug_isl_schedule): New. * graphite-dependences.c (scop_get_reads): Do not call isl_union_map_add_map that is undocumented isl functionality. (scop_get_must_writes): Same. (scop_get_may_writes): Same. (scop_get_original_schedule): Remove. (scop_get_dependences): Do not call isl_union_map_compute_flow that is deprecated in isl 0.15. Instead, use isl_union_access_* interface. (compute_deps): Remove. * graphite-isl-ast-to-gimple.c (print_schedule_ast): New. (debug_schedule_ast): New. (translate_isl_ast_to_gimple::scop_to_isl_ast): Call set_separate_option. (graphite_regenerate_ast_isl): Add dump. (translate_isl_ast_to_gimple::scop_to_isl_ast): Generate code from scop->transformed_schedule. (graphite_regenerate_ast_isl): Add more dump. * graphite-optimize-isl.c (optimize_isl): Set scop->transformed_schedule. Check whether schedules are equal. (apply_poly_transforms): Move here. * graphite-poly.c (apply_poly_transforms): ... from here. (free_poly_bb): Static. (free_scop): Static. (pbb_number_of_iterations_at_time): Remove. (print_isl_ast): New. (debug_isl_ast): New. (debug_scop_pbb): New. * graphite-scop-detection.c (print_edge): Move. (print_sese): Move. * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons): Remove. (build_scop_scattering): Remove. (create_pw_aff_from_tree): Assert instead of bailing out. (add_condition_to_pbb): Remove unused code, do not fail. (add_conditions_to_domain): Same. (add_conditions_to_constraints): Remove. (build_scop_context): New. (add_iter_domain_dimension): New. (build_iteration_domains): Initialize pbb->iterators. Call add_conditions_to_domain. (nested_in): New. (loop_at): New. (index_outermost_in_loop): New. (index_pbb_in_loop): New. (outermost_pbb_in): New. (add_in_sequence): New. (add_outer_projection): New. (outer_projection_mupa): New. (add_loop_schedule): New. (build_schedule_pbb): New. (build_schedule_loop): New. (embed_in_surrounding_loops): New. (build_schedule_loop_nest): New. (build_original_schedule): New. (build_poly_scop): Call build_original_schedule. * graphite.h: Declare print_isl_schedule and debug_isl_schedule. (free_poly_dr): Remove. (struct poly_bb): Add iterators. Remove schedule, transformed, saved. (free_poly_bb): Remove. (debug_loop_vec): Remove. (print_isl_ast): Declare. (debug_isl_ast): Declare. (scop_do_interchange): Remove. (scop_do_strip_mine): Remove. (scop_do_block): Remove. (flatten_all_loops): Remove. (optimize_isl): Remove. (pbb_number_of_iterations_at_time): Remove. (debug_scop_pbb): Declare. (print_schedule_ast): Declare. (debug_schedule_ast): Declare. (struct scop): Remove schedule. Add original_schedule, transformed_schedule. (free_gimple_poly_bb): Remove. (print_generated_program): Remove. (debug_generated_program): Remove. (unify_scattering_dimensions): Remove. * sese.c (print_edge): ... here. (print_sese): ... here. (debug_edge): ... here. (debug_sese): ... here. * sese.h (print_edge): Declare. (print_sese): Declare. (dump_edge): Declare. (dump_sese): Declare. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r232812
2016-01-26 01:19:20 +01:00
static isl_schedule_node *
set_separate_option (__isl_take isl_schedule_node *node, void *user)
{
if (user)
return node;
if (isl_schedule_node_get_type (node) != isl_schedule_node_band)
return node;
/* Set the "separate" option unless it is set earlier to another option. */
if (isl_schedule_node_band_member_get_ast_loop_type (node, 0)
== isl_ast_loop_default)
return isl_schedule_node_band_member_set_ast_loop_type
(node, 0, isl_ast_loop_separate);
return node;
}
new scop schedule for isl-0.15 Keep unchanged the implementation for isl-0.14. * graphite-poly.c (apply_poly_transforms): Simplify. (print_isl_set): Use more readable format: ISL_YAML_STYLE_BLOCK. (print_isl_map): Same. (print_isl_union_map): Same. (print_isl_schedule): New. (debug_isl_schedule): New. * graphite-dependences.c (scop_get_reads): Do not call isl_union_map_add_map that is undocumented isl functionality. (scop_get_must_writes): Same. (scop_get_may_writes): Same. (scop_get_original_schedule): Remove. (scop_get_dependences): Do not call isl_union_map_compute_flow that is deprecated in isl 0.15. Instead, use isl_union_access_* interface. (compute_deps): Remove. * graphite-isl-ast-to-gimple.c (print_schedule_ast): New. (debug_schedule_ast): New. (translate_isl_ast_to_gimple::scop_to_isl_ast): Call set_separate_option. (graphite_regenerate_ast_isl): Add dump. (translate_isl_ast_to_gimple::scop_to_isl_ast): Generate code from scop->transformed_schedule. (graphite_regenerate_ast_isl): Add more dump. * graphite-optimize-isl.c (optimize_isl): Set scop->transformed_schedule. Check whether schedules are equal. (apply_poly_transforms): Move here. * graphite-poly.c (apply_poly_transforms): ... from here. (free_poly_bb): Static. (free_scop): Static. (pbb_number_of_iterations_at_time): Remove. (print_isl_ast): New. (debug_isl_ast): New. (debug_scop_pbb): New. * graphite-scop-detection.c (print_edge): Move. (print_sese): Move. * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons): Remove. (build_scop_scattering): Remove. (create_pw_aff_from_tree): Assert instead of bailing out. (add_condition_to_pbb): Remove unused code, do not fail. (add_conditions_to_domain): Same. (add_conditions_to_constraints): Remove. (build_scop_context): New. (add_iter_domain_dimension): New. (build_iteration_domains): Initialize pbb->iterators. Call add_conditions_to_domain. (nested_in): New. (loop_at): New. (index_outermost_in_loop): New. (index_pbb_in_loop): New. (outermost_pbb_in): New. (add_in_sequence): New. (add_outer_projection): New. (outer_projection_mupa): New. (add_loop_schedule): New. (build_schedule_pbb): New. (build_schedule_loop): New. (embed_in_surrounding_loops): New. (build_schedule_loop_nest): New. (build_original_schedule): New. (build_poly_scop): Call build_original_schedule. * graphite.h: Declare print_isl_schedule and debug_isl_schedule. (free_poly_dr): Remove. (struct poly_bb): Add iterators. Remove schedule, transformed, saved. (free_poly_bb): Remove. (debug_loop_vec): Remove. (print_isl_ast): Declare. (debug_isl_ast): Declare. (scop_do_interchange): Remove. (scop_do_strip_mine): Remove. (scop_do_block): Remove. (flatten_all_loops): Remove. (optimize_isl): Remove. (pbb_number_of_iterations_at_time): Remove. (debug_scop_pbb): Declare. (print_schedule_ast): Declare. (debug_schedule_ast): Declare. (struct scop): Remove schedule. Add original_schedule, transformed_schedule. (free_gimple_poly_bb): Remove. (print_generated_program): Remove. (debug_generated_program): Remove. (unify_scattering_dimensions): Remove. * sese.c (print_edge): ... here. (print_sese): ... here. (debug_edge): ... here. (debug_sese): ... here. * sese.h (print_edge): Declare. (print_sese): Declare. (dump_edge): Declare. (dump_sese): Declare. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r232812
2016-01-26 01:19:20 +01:00
/* Print SCHEDULE under an AST form on file F. */
void
print_schedule_ast (FILE *f, __isl_keep isl_schedule *schedule, scop_p scop)
{
isl_set *set = isl_set_params (isl_set_copy (scop->param_context));
isl_ast_build *context = isl_ast_build_from_context (set);
isl_ast_node *ast
= isl_ast_build_node_from_schedule (context, isl_schedule_copy (schedule));
isl_ast_build_free (context);
print_isl_ast (f, ast);
isl_ast_node_free (ast);
}
DEBUG_FUNCTION void
debug_schedule_ast (__isl_keep isl_schedule *s, scop_p scop)
{
print_schedule_ast (stderr, s, scop);
}
#endif
enum phi_node_kind
{
unknown_phi,
loop_phi,
close_phi,
cond_phi
};
class translate_isl_ast_to_gimple
{
public:
move graphite bookkeeping from sese to sese_info 2015-10-06 Aditya Kumar <aditya.k7@samsung.com> Sebastian Pop <s.pop@samsung.com> * graphite-isl-ast-to-gimple.c (translate_isl_ast_to_gimple): Use an sese_info_p. (copy_def): Same. (copy_internal_parameters): Same. (translate_isl_ast_to_gimple): Use an sese_l. (build_iv_mapping): Same. * graphite-poly.c (new_sese): Rename new_sese_info. (free_sese): Rename free_sese_info. * graphite-poly.h (struct scop): Use an sese_info_p. (scop_set_region): Same. * graphite-scop-detection.c (struct sese_l): Moved... (get_entry_bb): Moved... (get_exit_bb): Moved... (parameter_index_in_region_1): Use an sese_info_p. (parameter_index_in_region): Same. (scan_tree_for_params): Same. (find_params_in_bb): Same. (sese_dom_walker): Use an sese_l. * graphite-sese-to-poly.c (remove_invariant_phi): Same. (reduction_phi_p): Same. (parameter_index_in_region_1): Use an sese_info_p. (propagate_expr_outside_region): Use an sese_l. * graphite.c: Replace uses of SCOP_REGION. * sese.c (sese_record_loop): Use an sese_info_p. (build_sese_loop_nests): Same. (sese_build_liveouts_use): Same. (sese_build_liveouts_bb): Same. (sese_build_liveouts_bb): Same. (sese_bad_liveouts_use): Same. (sese_reset_debug_liveouts_bb): Same. (sese_build_liveouts): Same. (new_sese): Renamed new_sese_info. (free_sese): Renamed free_sese_info. (set_rename): Use an sese_info_p. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (outermost_loop_in_sese_1): Use an sese_l. (outermost_loop_in_sese): Same. (if_region_set_false_region): Use an sese_info_p. (move_sese_in_condition): Same. (scalar_evolution_in_region): Use an sese_l. * sese.h (struct sese_l): ... here. (SESE_ENTRY): Remove. (SESE_ENTRY_BB): Remove. (SESE_EXIT): Remove. (SESE_EXIT_BB): Remove. (sese_contains_loop): Use an sese_info_p. (sese_nb_params): Same. (bb_in_sese_p): Use an sese_l. (stmt_in_sese_p): Same. (defined_in_sese_p): Same. (loop_in_sese_p): Same. (sese_loop_depth): Same. (struct ifsese_s): Use an sese_info_p. (gbb_loop_at_index): Use an sese_l. (nb_common_loops): Same. (scev_analyzable_p): Same. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r228572
2015-10-07 17:40:17 +02:00
translate_isl_ast_to_gimple (sese_info_p r)
: region (r), codegen_error (false) { }
edge translate_isl_ast (loop_p context_loop, __isl_keep isl_ast_node *node,
edge next_e, ivs_params &ip);
edge translate_isl_ast_node_for (loop_p context_loop,
__isl_keep isl_ast_node *node,
edge next_e, ivs_params &ip);
edge translate_isl_ast_for_loop (loop_p context_loop,
__isl_keep isl_ast_node *node_for,
edge next_e,
tree type, tree lb, tree ub,
ivs_params &ip);
edge translate_isl_ast_node_if (loop_p context_loop,
__isl_keep isl_ast_node *node,
edge next_e, ivs_params &ip);
edge translate_isl_ast_node_user (__isl_keep isl_ast_node *node,
edge next_e, ivs_params &ip);
edge translate_isl_ast_node_block (loop_p context_loop,
__isl_keep isl_ast_node *node,
edge next_e, ivs_params &ip);
tree unary_op_to_tree (tree type, __isl_take isl_ast_expr *expr,
ivs_params &ip);
tree binary_op_to_tree (tree type, __isl_take isl_ast_expr *expr,
ivs_params &ip);
tree ternary_op_to_tree (tree type, __isl_take isl_ast_expr *expr,
ivs_params &ip);
tree nary_op_to_tree (tree type, __isl_take isl_ast_expr *expr,
ivs_params &ip);
tree gcc_expression_from_isl_expression (tree type,
__isl_take isl_ast_expr *,
ivs_params &ip);
tree gcc_expression_from_isl_ast_expr_id (tree type,
__isl_keep isl_ast_expr *expr_id,
ivs_params &ip);
tree gcc_expression_from_isl_expr_int (tree type,
__isl_take isl_ast_expr *expr);
tree gcc_expression_from_isl_expr_op (tree type,
__isl_take isl_ast_expr *expr,
ivs_params &ip);
struct loop *graphite_create_new_loop (edge entry_edge,
__isl_keep isl_ast_node *node_for,
loop_p outer, tree type,
tree lb, tree ub, ivs_params &ip);
edge graphite_create_new_loop_guard (edge entry_edge,
__isl_keep isl_ast_node *node_for,
tree *type,
tree *lb, tree *ub, ivs_params &ip);
edge graphite_create_new_guard (edge entry_edge,
__isl_take isl_ast_expr *if_cond,
ivs_params &ip);
void build_iv_mapping (vec<tree> iv_map, gimple_poly_bb_p gbb,
__isl_keep isl_ast_expr *user_expr, ivs_params &ip,
move graphite bookkeeping from sese to sese_info 2015-10-06 Aditya Kumar <aditya.k7@samsung.com> Sebastian Pop <s.pop@samsung.com> * graphite-isl-ast-to-gimple.c (translate_isl_ast_to_gimple): Use an sese_info_p. (copy_def): Same. (copy_internal_parameters): Same. (translate_isl_ast_to_gimple): Use an sese_l. (build_iv_mapping): Same. * graphite-poly.c (new_sese): Rename new_sese_info. (free_sese): Rename free_sese_info. * graphite-poly.h (struct scop): Use an sese_info_p. (scop_set_region): Same. * graphite-scop-detection.c (struct sese_l): Moved... (get_entry_bb): Moved... (get_exit_bb): Moved... (parameter_index_in_region_1): Use an sese_info_p. (parameter_index_in_region): Same. (scan_tree_for_params): Same. (find_params_in_bb): Same. (sese_dom_walker): Use an sese_l. * graphite-sese-to-poly.c (remove_invariant_phi): Same. (reduction_phi_p): Same. (parameter_index_in_region_1): Use an sese_info_p. (propagate_expr_outside_region): Use an sese_l. * graphite.c: Replace uses of SCOP_REGION. * sese.c (sese_record_loop): Use an sese_info_p. (build_sese_loop_nests): Same. (sese_build_liveouts_use): Same. (sese_build_liveouts_bb): Same. (sese_build_liveouts_bb): Same. (sese_bad_liveouts_use): Same. (sese_reset_debug_liveouts_bb): Same. (sese_build_liveouts): Same. (new_sese): Renamed new_sese_info. (free_sese): Renamed free_sese_info. (set_rename): Use an sese_info_p. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (outermost_loop_in_sese_1): Use an sese_l. (outermost_loop_in_sese): Same. (if_region_set_false_region): Use an sese_info_p. (move_sese_in_condition): Same. (scalar_evolution_in_region): Use an sese_l. * sese.h (struct sese_l): ... here. (SESE_ENTRY): Remove. (SESE_ENTRY_BB): Remove. (SESE_EXIT): Remove. (SESE_EXIT_BB): Remove. (sese_contains_loop): Use an sese_info_p. (sese_nb_params): Same. (bb_in_sese_p): Use an sese_l. (stmt_in_sese_p): Same. (defined_in_sese_p): Same. (loop_in_sese_p): Same. (sese_loop_depth): Same. (struct ifsese_s): Use an sese_info_p. (gbb_loop_at_index): Use an sese_l. (nb_common_loops): Same. (scev_analyzable_p): Same. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r228572
2015-10-07 17:40:17 +02:00
sese_l &region);
Preserve the original program while using graphite. Earlier, graphite used to translate portions of the original program after scop-detection in order to represent the SCoP into polyhedral model. This was required because each basic block was represented as independent basic block in the polyhedral model. So all the cross-basic-block dependencies were translated out-of-ssa. With this patch those dependencies are also exposed to the ISL, so there is no need to modify the original structure of the program. After this patch we should be able to enable graphite at some default optimization level. Highlights: Remove cross bb scalar to array translation For reductions, add support for more than just INT_CST Early bailout on codegen. Verify loop-closed ssa structure during copy of renames The uses of exprs should come from bb which dominates the bb Collect the init value of close phi in loop-guard Do not follow vuses for close-phi, postpone loop-close phi until the corresponding loop-phi is processed Bail out if no bb found to place cond/loop -phis Move insertion of liveouts at the end of codegen Insert loop-phis in the loop-header. This patch passes regtest and bootstrap with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' 2015-11-11 Aditya Kumar <aditya.k7@samsung.com> Sebastian Pop <s.pop@samsung.com> * graphite-isl-ast-to-gimple.c (class translate_isl_ast_to_gimple): New member codegen_error (translate_isl_ast_for_loop): Remove call to single_succ_edge and early return. (translate_isl_ast_node_user): Early return in case of error. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_to_gimple::translate_pending_phi_nodes): New. (add_parameters_to_ivs_params): Remove macro. (graphite_regenerate_ast_isl): Add if_region pointer to region. * graphite-poly.c (new_poly_dr): Remove macro. (print_pdr): Same. (new_gimple_poly_bb): Same. (free_gimple_poly_bb): Same. (print_scop_params): Same. * graphite-poly.h (struct poly_dr): Same. (struct poly_bb): Add new_bb. (gbb_from_bb): Remove dead code. (pbb_from_bb): Same. * graphite-scop-detection.c (parameter_index_in_region_1): Same. (parameter_index_in_region): Same. (find_scop_parameters): Same. (build_cross_bb_scalars_def): New. (build_cross_bb_scalars_use): New. (graphite_find_cross_bb_scalar_vars): New (try_generate_gimple_bb): Reads and Writes. (build_alias_set): Move. (gather_bbs::before_dom_children): Gather bbs visited. (build_scops): call build_alias_set. * graphite-sese-to-poly.c (phi_arg_in_outermost_loop): Delete. (remove_simple_copy_phi): Delete. (remove_invariant_phi): Delete. (simple_copy_phi_p): Delete. (reduction_phi_p): Delete. (isl_id_for_dr): Remove unused param. (parameter_index_in_region_1): Remove macro usage. (set_scop_parameter_dim): Same. (add_param_constraints): Same. (add_conditions_to_constraints): Same (build_scop_iteration_domain): Same. (pdr_add_alias_set): Comment. (add_scalar_version_numbers): New. (build_poly_dr): ISL id. (build_scop_drs): Move. (build_poly_sr_1): Same. (insert_stmts): Remove. (build_poly_sr): New. (new_pbb_from_pbb): Delete. (insert_out_of_ssa_copy_on_edge): Delete. (create_zero_dim_array): Delete. (scalar_close_phi_node_p): Delete. (propagate_expr_outside_region): Delete. (rewrite_close_phi_out_of_ssa): Delete. (rewrite_phi_out_of_ssa): Delete. (rewrite_degenerate_phi): Delete. (rewrite_reductions_out_of_ssa): Delete. (rewrite_cross_bb_scalar_dependence): Delete. (handle_scalar_deps_crossing_scop_limits): (rewrite_cross_bb_scalar_deps): Delete. (build_poly_scop): Remove calls to out-of-ssa functions. * graphite.c (graphite_transform_loops): Early return in case of codegen error. * sese.c (debug_rename_map_1): Delete. (debug_rename_map): Delete. (sese_record_loop): Remove macro. (build_sese_loop_nests): Same. (new_sese_info): Same. (free_sese_info): Same. (sese_insert_phis_for_liveouts): (is_loop_closed_ssa_use): New. (number_of_phi_nodes): New. (bb_contains_loop_close_phi_nodes): New. (bb_contains_loop_phi_nodes): New. (phi_uses_name): New. (is_valid_rename): (get_rename): Add old_bb and loop_phi for more precise matching of exprs. (set_rename): Pass region. (later_of_the_two): New. (gsi_insert_earliest): New. (collect_all_ssa_names): New. (substitute_ssa_name): New. (rename_all_uses): New. (get_rename_from_scev): New. (rename_uses): Pass old_bb for more precise matching of exprs. (get_def_bb_for_const): New. (get_new_name): New. (get_loc): New. (get_edges): New. (copy_loop_phi_args): New. (copy_loop_phi_nodes): New. (get_loop_init_value): New. (find_init_value): New. (find_init_value_close_phi): New. (copy_loop_close_phi_args): New. (copy_loop_close_phi_nodes): New. (add_phi_arg_for_new_expr): New. (copy_cond_phi_args): New. (copy_cond_phi_nodes): New. (copy_phi_nodes): New. (should_copy_to_new_region): New. (set_rename_for_each_def): New. (graphite_copy_stmts_from_block): Early return in case of error. (copy_bb_and_scalar_dependences): Same. * sese.h (vec_find): New. (SESE_PARAMS): Delete. (SESE_LOOPS): Delete. (SESE_LOOP_NEST): Delete. (sese_contains_loop): Remove macro usage. (sese_nb_params): Same. (struct gimple_poly_bb): Added read_scalar_refs, write_scalar_refs. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r230200
2015-11-12 01:37:47 +01:00
void translate_pending_phi_nodes (void);
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
void add_parameters_to_ivs_params (scop_p scop, ivs_params &ip);
__isl_give isl_ast_build *generate_isl_context (scop_p scop);
new scop schedule for isl-0.15 Keep unchanged the implementation for isl-0.14. * graphite-poly.c (apply_poly_transforms): Simplify. (print_isl_set): Use more readable format: ISL_YAML_STYLE_BLOCK. (print_isl_map): Same. (print_isl_union_map): Same. (print_isl_schedule): New. (debug_isl_schedule): New. * graphite-dependences.c (scop_get_reads): Do not call isl_union_map_add_map that is undocumented isl functionality. (scop_get_must_writes): Same. (scop_get_may_writes): Same. (scop_get_original_schedule): Remove. (scop_get_dependences): Do not call isl_union_map_compute_flow that is deprecated in isl 0.15. Instead, use isl_union_access_* interface. (compute_deps): Remove. * graphite-isl-ast-to-gimple.c (print_schedule_ast): New. (debug_schedule_ast): New. (translate_isl_ast_to_gimple::scop_to_isl_ast): Call set_separate_option. (graphite_regenerate_ast_isl): Add dump. (translate_isl_ast_to_gimple::scop_to_isl_ast): Generate code from scop->transformed_schedule. (graphite_regenerate_ast_isl): Add more dump. * graphite-optimize-isl.c (optimize_isl): Set scop->transformed_schedule. Check whether schedules are equal. (apply_poly_transforms): Move here. * graphite-poly.c (apply_poly_transforms): ... from here. (free_poly_bb): Static. (free_scop): Static. (pbb_number_of_iterations_at_time): Remove. (print_isl_ast): New. (debug_isl_ast): New. (debug_scop_pbb): New. * graphite-scop-detection.c (print_edge): Move. (print_sese): Move. * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons): Remove. (build_scop_scattering): Remove. (create_pw_aff_from_tree): Assert instead of bailing out. (add_condition_to_pbb): Remove unused code, do not fail. (add_conditions_to_domain): Same. (add_conditions_to_constraints): Remove. (build_scop_context): New. (add_iter_domain_dimension): New. (build_iteration_domains): Initialize pbb->iterators. Call add_conditions_to_domain. (nested_in): New. (loop_at): New. (index_outermost_in_loop): New. (index_pbb_in_loop): New. (outermost_pbb_in): New. (add_in_sequence): New. (add_outer_projection): New. (outer_projection_mupa): New. (add_loop_schedule): New. (build_schedule_pbb): New. (build_schedule_loop): New. (embed_in_surrounding_loops): New. (build_schedule_loop_nest): New. (build_original_schedule): New. (build_poly_scop): Call build_original_schedule. * graphite.h: Declare print_isl_schedule and debug_isl_schedule. (free_poly_dr): Remove. (struct poly_bb): Add iterators. Remove schedule, transformed, saved. (free_poly_bb): Remove. (debug_loop_vec): Remove. (print_isl_ast): Declare. (debug_isl_ast): Declare. (scop_do_interchange): Remove. (scop_do_strip_mine): Remove. (scop_do_block): Remove. (flatten_all_loops): Remove. (optimize_isl): Remove. (pbb_number_of_iterations_at_time): Remove. (debug_scop_pbb): Declare. (print_schedule_ast): Declare. (debug_schedule_ast): Declare. (struct scop): Remove schedule. Add original_schedule, transformed_schedule. (free_gimple_poly_bb): Remove. (print_generated_program): Remove. (debug_generated_program): Remove. (unify_scattering_dimensions): Remove. * sese.c (print_edge): ... here. (print_sese): ... here. (debug_edge): ... here. (debug_sese): ... here. * sese.h (print_edge): Declare. (print_sese): Declare. (dump_edge): Declare. (dump_sese): Declare. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r232812
2016-01-26 01:19:20 +01:00
#ifdef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
__isl_give isl_ast_node * scop_to_isl_ast (scop_p scop);
#else
int get_max_schedule_dimensions (scop_p scop);
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
__isl_give isl_map *extend_schedule (__isl_take isl_map *schedule,
int nb_schedule_dims);
__isl_give isl_union_map *generate_isl_schedule (scop_p scop);
new scop schedule for isl-0.15 Keep unchanged the implementation for isl-0.14. * graphite-poly.c (apply_poly_transforms): Simplify. (print_isl_set): Use more readable format: ISL_YAML_STYLE_BLOCK. (print_isl_map): Same. (print_isl_union_map): Same. (print_isl_schedule): New. (debug_isl_schedule): New. * graphite-dependences.c (scop_get_reads): Do not call isl_union_map_add_map that is undocumented isl functionality. (scop_get_must_writes): Same. (scop_get_may_writes): Same. (scop_get_original_schedule): Remove. (scop_get_dependences): Do not call isl_union_map_compute_flow that is deprecated in isl 0.15. Instead, use isl_union_access_* interface. (compute_deps): Remove. * graphite-isl-ast-to-gimple.c (print_schedule_ast): New. (debug_schedule_ast): New. (translate_isl_ast_to_gimple::scop_to_isl_ast): Call set_separate_option. (graphite_regenerate_ast_isl): Add dump. (translate_isl_ast_to_gimple::scop_to_isl_ast): Generate code from scop->transformed_schedule. (graphite_regenerate_ast_isl): Add more dump. * graphite-optimize-isl.c (optimize_isl): Set scop->transformed_schedule. Check whether schedules are equal. (apply_poly_transforms): Move here. * graphite-poly.c (apply_poly_transforms): ... from here. (free_poly_bb): Static. (free_scop): Static. (pbb_number_of_iterations_at_time): Remove. (print_isl_ast): New. (debug_isl_ast): New. (debug_scop_pbb): New. * graphite-scop-detection.c (print_edge): Move. (print_sese): Move. * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons): Remove. (build_scop_scattering): Remove. (create_pw_aff_from_tree): Assert instead of bailing out. (add_condition_to_pbb): Remove unused code, do not fail. (add_conditions_to_domain): Same. (add_conditions_to_constraints): Remove. (build_scop_context): New. (add_iter_domain_dimension): New. (build_iteration_domains): Initialize pbb->iterators. Call add_conditions_to_domain. (nested_in): New. (loop_at): New. (index_outermost_in_loop): New. (index_pbb_in_loop): New. (outermost_pbb_in): New. (add_in_sequence): New. (add_outer_projection): New. (outer_projection_mupa): New. (add_loop_schedule): New. (build_schedule_pbb): New. (build_schedule_loop): New. (embed_in_surrounding_loops): New. (build_schedule_loop_nest): New. (build_original_schedule): New. (build_poly_scop): Call build_original_schedule. * graphite.h: Declare print_isl_schedule and debug_isl_schedule. (free_poly_dr): Remove. (struct poly_bb): Add iterators. Remove schedule, transformed, saved. (free_poly_bb): Remove. (debug_loop_vec): Remove. (print_isl_ast): Declare. (debug_isl_ast): Declare. (scop_do_interchange): Remove. (scop_do_strip_mine): Remove. (scop_do_block): Remove. (flatten_all_loops): Remove. (optimize_isl): Remove. (pbb_number_of_iterations_at_time): Remove. (debug_scop_pbb): Declare. (print_schedule_ast): Declare. (debug_schedule_ast): Declare. (struct scop): Remove schedule. Add original_schedule, transformed_schedule. (free_gimple_poly_bb): Remove. (print_generated_program): Remove. (debug_generated_program): Remove. (unify_scattering_dimensions): Remove. * sese.c (print_edge): ... here. (print_sese): ... here. (debug_edge): ... here. (debug_sese): ... here. * sese.h (print_edge): Declare. (print_sese): Declare. (dump_edge): Declare. (dump_sese): Declare. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r232812
2016-01-26 01:19:20 +01:00
__isl_give isl_ast_build *set_options (__isl_take isl_ast_build *control,
__isl_keep isl_union_map *schedule);
__isl_give isl_ast_node *scop_to_isl_ast (scop_p scop, ivs_params &ip);
#endif
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
bool is_valid_rename (tree rename, basic_block def_bb, basic_block use_bb,
phi_node_kind, tree old_name, basic_block old_bb) const;
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
tree get_rename (basic_block new_bb, tree old_name,
basic_block old_bb, phi_node_kind) const;
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
tree get_rename_from_scev (tree old_name, gimple_seq *stmts, loop_p loop,
basic_block new_bb, basic_block old_bb,
vec<tree> iv_map);
basic_block get_def_bb_for_const (basic_block bb, basic_block old_bb) const;
tree get_new_name (basic_block new_bb, tree op,
basic_block old_bb, phi_node_kind) const;
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
void collect_all_ssa_names (tree new_expr, vec<tree> *vec_ssa);
bool copy_loop_phi_args (gphi *old_phi, init_back_edge_pair_t &ibp_old_bb,
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
gphi *new_phi, init_back_edge_pair_t &ibp_new_bb,
bool postpone);
bool copy_loop_phi_nodes (basic_block bb, basic_block new_bb);
bool add_close_phis_to_merge_points (gphi *old_phi, gphi *new_phi,
tree default_value);
tree add_close_phis_to_outer_loops (tree last_merge_name, edge merge_e,
gimple *old_close_phi);
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
bool copy_loop_close_phi_args (basic_block old_bb, basic_block new_bb,
bool postpone);
bool copy_loop_close_phi_nodes (basic_block old_bb, basic_block new_bb);
bool copy_cond_phi_args (gphi *phi, gphi *new_phi, vec<tree> iv_map,
bool postpone);
bool copy_cond_phi_nodes (basic_block bb, basic_block new_bb,
vec<tree> iv_map);
bool graphite_copy_stmts_from_block (basic_block bb, basic_block new_bb,
vec<tree> iv_map);
edge copy_bb_and_scalar_dependences (basic_block bb, edge next_e,
vec<tree> iv_map);
edge edge_for_new_close_phis (basic_block bb);
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
bool add_phi_arg_for_new_expr (tree old_phi_args[2], tree new_phi_args[2],
edge old_bb_dominating_edge,
edge old_bb_non_dominating_edge,
gphi *phi, gphi *new_phi,
basic_block new_bb);
bool rename_uses (gimple *copy, gimple_stmt_iterator *gsi_tgt,
basic_block old_bb, loop_p loop, vec<tree> iv_map);
void set_rename (tree old_name, tree expr);
void set_rename_for_each_def (gimple *stmt);
void gsi_insert_earliest (gimple_seq seq);
tree rename_all_uses (tree new_expr, basic_block new_bb, basic_block old_bb);
bool codegen_error_p () const { return codegen_error; }
bool is_constant (tree op) const
{
return TREE_CODE (op) == INTEGER_CST
|| TREE_CODE (op) == REAL_CST
|| TREE_CODE (op) == COMPLEX_CST
|| TREE_CODE (op) == VECTOR_CST;
}
private:
/* The region to be translated. */
move graphite bookkeeping from sese to sese_info 2015-10-06 Aditya Kumar <aditya.k7@samsung.com> Sebastian Pop <s.pop@samsung.com> * graphite-isl-ast-to-gimple.c (translate_isl_ast_to_gimple): Use an sese_info_p. (copy_def): Same. (copy_internal_parameters): Same. (translate_isl_ast_to_gimple): Use an sese_l. (build_iv_mapping): Same. * graphite-poly.c (new_sese): Rename new_sese_info. (free_sese): Rename free_sese_info. * graphite-poly.h (struct scop): Use an sese_info_p. (scop_set_region): Same. * graphite-scop-detection.c (struct sese_l): Moved... (get_entry_bb): Moved... (get_exit_bb): Moved... (parameter_index_in_region_1): Use an sese_info_p. (parameter_index_in_region): Same. (scan_tree_for_params): Same. (find_params_in_bb): Same. (sese_dom_walker): Use an sese_l. * graphite-sese-to-poly.c (remove_invariant_phi): Same. (reduction_phi_p): Same. (parameter_index_in_region_1): Use an sese_info_p. (propagate_expr_outside_region): Use an sese_l. * graphite.c: Replace uses of SCOP_REGION. * sese.c (sese_record_loop): Use an sese_info_p. (build_sese_loop_nests): Same. (sese_build_liveouts_use): Same. (sese_build_liveouts_bb): Same. (sese_build_liveouts_bb): Same. (sese_bad_liveouts_use): Same. (sese_reset_debug_liveouts_bb): Same. (sese_build_liveouts): Same. (new_sese): Renamed new_sese_info. (free_sese): Renamed free_sese_info. (set_rename): Use an sese_info_p. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (outermost_loop_in_sese_1): Use an sese_l. (outermost_loop_in_sese): Same. (if_region_set_false_region): Use an sese_info_p. (move_sese_in_condition): Same. (scalar_evolution_in_region): Use an sese_l. * sese.h (struct sese_l): ... here. (SESE_ENTRY): Remove. (SESE_ENTRY_BB): Remove. (SESE_EXIT): Remove. (SESE_EXIT_BB): Remove. (sese_contains_loop): Use an sese_info_p. (sese_nb_params): Same. (bb_in_sese_p): Use an sese_l. (stmt_in_sese_p): Same. (defined_in_sese_p): Same. (loop_in_sese_p): Same. (sese_loop_depth): Same. (struct ifsese_s): Use an sese_info_p. (gbb_loop_at_index): Use an sese_l. (nb_common_loops): Same. (scev_analyzable_p): Same. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r228572
2015-10-07 17:40:17 +02:00
sese_info_p region;
Preserve the original program while using graphite. Earlier, graphite used to translate portions of the original program after scop-detection in order to represent the SCoP into polyhedral model. This was required because each basic block was represented as independent basic block in the polyhedral model. So all the cross-basic-block dependencies were translated out-of-ssa. With this patch those dependencies are also exposed to the ISL, so there is no need to modify the original structure of the program. After this patch we should be able to enable graphite at some default optimization level. Highlights: Remove cross bb scalar to array translation For reductions, add support for more than just INT_CST Early bailout on codegen. Verify loop-closed ssa structure during copy of renames The uses of exprs should come from bb which dominates the bb Collect the init value of close phi in loop-guard Do not follow vuses for close-phi, postpone loop-close phi until the corresponding loop-phi is processed Bail out if no bb found to place cond/loop -phis Move insertion of liveouts at the end of codegen Insert loop-phis in the loop-header. This patch passes regtest and bootstrap with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' 2015-11-11 Aditya Kumar <aditya.k7@samsung.com> Sebastian Pop <s.pop@samsung.com> * graphite-isl-ast-to-gimple.c (class translate_isl_ast_to_gimple): New member codegen_error (translate_isl_ast_for_loop): Remove call to single_succ_edge and early return. (translate_isl_ast_node_user): Early return in case of error. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_to_gimple::translate_pending_phi_nodes): New. (add_parameters_to_ivs_params): Remove macro. (graphite_regenerate_ast_isl): Add if_region pointer to region. * graphite-poly.c (new_poly_dr): Remove macro. (print_pdr): Same. (new_gimple_poly_bb): Same. (free_gimple_poly_bb): Same. (print_scop_params): Same. * graphite-poly.h (struct poly_dr): Same. (struct poly_bb): Add new_bb. (gbb_from_bb): Remove dead code. (pbb_from_bb): Same. * graphite-scop-detection.c (parameter_index_in_region_1): Same. (parameter_index_in_region): Same. (find_scop_parameters): Same. (build_cross_bb_scalars_def): New. (build_cross_bb_scalars_use): New. (graphite_find_cross_bb_scalar_vars): New (try_generate_gimple_bb): Reads and Writes. (build_alias_set): Move. (gather_bbs::before_dom_children): Gather bbs visited. (build_scops): call build_alias_set. * graphite-sese-to-poly.c (phi_arg_in_outermost_loop): Delete. (remove_simple_copy_phi): Delete. (remove_invariant_phi): Delete. (simple_copy_phi_p): Delete. (reduction_phi_p): Delete. (isl_id_for_dr): Remove unused param. (parameter_index_in_region_1): Remove macro usage. (set_scop_parameter_dim): Same. (add_param_constraints): Same. (add_conditions_to_constraints): Same (build_scop_iteration_domain): Same. (pdr_add_alias_set): Comment. (add_scalar_version_numbers): New. (build_poly_dr): ISL id. (build_scop_drs): Move. (build_poly_sr_1): Same. (insert_stmts): Remove. (build_poly_sr): New. (new_pbb_from_pbb): Delete. (insert_out_of_ssa_copy_on_edge): Delete. (create_zero_dim_array): Delete. (scalar_close_phi_node_p): Delete. (propagate_expr_outside_region): Delete. (rewrite_close_phi_out_of_ssa): Delete. (rewrite_phi_out_of_ssa): Delete. (rewrite_degenerate_phi): Delete. (rewrite_reductions_out_of_ssa): Delete. (rewrite_cross_bb_scalar_dependence): Delete. (handle_scalar_deps_crossing_scop_limits): (rewrite_cross_bb_scalar_deps): Delete. (build_poly_scop): Remove calls to out-of-ssa functions. * graphite.c (graphite_transform_loops): Early return in case of codegen error. * sese.c (debug_rename_map_1): Delete. (debug_rename_map): Delete. (sese_record_loop): Remove macro. (build_sese_loop_nests): Same. (new_sese_info): Same. (free_sese_info): Same. (sese_insert_phis_for_liveouts): (is_loop_closed_ssa_use): New. (number_of_phi_nodes): New. (bb_contains_loop_close_phi_nodes): New. (bb_contains_loop_phi_nodes): New. (phi_uses_name): New. (is_valid_rename): (get_rename): Add old_bb and loop_phi for more precise matching of exprs. (set_rename): Pass region. (later_of_the_two): New. (gsi_insert_earliest): New. (collect_all_ssa_names): New. (substitute_ssa_name): New. (rename_all_uses): New. (get_rename_from_scev): New. (rename_uses): Pass old_bb for more precise matching of exprs. (get_def_bb_for_const): New. (get_new_name): New. (get_loc): New. (get_edges): New. (copy_loop_phi_args): New. (copy_loop_phi_nodes): New. (get_loop_init_value): New. (find_init_value): New. (find_init_value_close_phi): New. (copy_loop_close_phi_args): New. (copy_loop_close_phi_nodes): New. (add_phi_arg_for_new_expr): New. (copy_cond_phi_args): New. (copy_cond_phi_nodes): New. (copy_phi_nodes): New. (should_copy_to_new_region): New. (set_rename_for_each_def): New. (graphite_copy_stmts_from_block): Early return in case of error. (copy_bb_and_scalar_dependences): Same. * sese.h (vec_find): New. (SESE_PARAMS): Delete. (SESE_LOOPS): Delete. (SESE_LOOP_NEST): Delete. (sese_contains_loop): Remove macro usage. (sese_nb_params): Same. (struct gimple_poly_bb): Added read_scalar_refs, write_scalar_refs. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r230200
2015-11-12 01:37:47 +01:00
2015-12-17 19:50:05 +01:00
/* This flag is set when an error occurred during the translation of isl AST
Preserve the original program while using graphite. Earlier, graphite used to translate portions of the original program after scop-detection in order to represent the SCoP into polyhedral model. This was required because each basic block was represented as independent basic block in the polyhedral model. So all the cross-basic-block dependencies were translated out-of-ssa. With this patch those dependencies are also exposed to the ISL, so there is no need to modify the original structure of the program. After this patch we should be able to enable graphite at some default optimization level. Highlights: Remove cross bb scalar to array translation For reductions, add support for more than just INT_CST Early bailout on codegen. Verify loop-closed ssa structure during copy of renames The uses of exprs should come from bb which dominates the bb Collect the init value of close phi in loop-guard Do not follow vuses for close-phi, postpone loop-close phi until the corresponding loop-phi is processed Bail out if no bb found to place cond/loop -phis Move insertion of liveouts at the end of codegen Insert loop-phis in the loop-header. This patch passes regtest and bootstrap with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' 2015-11-11 Aditya Kumar <aditya.k7@samsung.com> Sebastian Pop <s.pop@samsung.com> * graphite-isl-ast-to-gimple.c (class translate_isl_ast_to_gimple): New member codegen_error (translate_isl_ast_for_loop): Remove call to single_succ_edge and early return. (translate_isl_ast_node_user): Early return in case of error. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_to_gimple::translate_pending_phi_nodes): New. (add_parameters_to_ivs_params): Remove macro. (graphite_regenerate_ast_isl): Add if_region pointer to region. * graphite-poly.c (new_poly_dr): Remove macro. (print_pdr): Same. (new_gimple_poly_bb): Same. (free_gimple_poly_bb): Same. (print_scop_params): Same. * graphite-poly.h (struct poly_dr): Same. (struct poly_bb): Add new_bb. (gbb_from_bb): Remove dead code. (pbb_from_bb): Same. * graphite-scop-detection.c (parameter_index_in_region_1): Same. (parameter_index_in_region): Same. (find_scop_parameters): Same. (build_cross_bb_scalars_def): New. (build_cross_bb_scalars_use): New. (graphite_find_cross_bb_scalar_vars): New (try_generate_gimple_bb): Reads and Writes. (build_alias_set): Move. (gather_bbs::before_dom_children): Gather bbs visited. (build_scops): call build_alias_set. * graphite-sese-to-poly.c (phi_arg_in_outermost_loop): Delete. (remove_simple_copy_phi): Delete. (remove_invariant_phi): Delete. (simple_copy_phi_p): Delete. (reduction_phi_p): Delete. (isl_id_for_dr): Remove unused param. (parameter_index_in_region_1): Remove macro usage. (set_scop_parameter_dim): Same. (add_param_constraints): Same. (add_conditions_to_constraints): Same (build_scop_iteration_domain): Same. (pdr_add_alias_set): Comment. (add_scalar_version_numbers): New. (build_poly_dr): ISL id. (build_scop_drs): Move. (build_poly_sr_1): Same. (insert_stmts): Remove. (build_poly_sr): New. (new_pbb_from_pbb): Delete. (insert_out_of_ssa_copy_on_edge): Delete. (create_zero_dim_array): Delete. (scalar_close_phi_node_p): Delete. (propagate_expr_outside_region): Delete. (rewrite_close_phi_out_of_ssa): Delete. (rewrite_phi_out_of_ssa): Delete. (rewrite_degenerate_phi): Delete. (rewrite_reductions_out_of_ssa): Delete. (rewrite_cross_bb_scalar_dependence): Delete. (handle_scalar_deps_crossing_scop_limits): (rewrite_cross_bb_scalar_deps): Delete. (build_poly_scop): Remove calls to out-of-ssa functions. * graphite.c (graphite_transform_loops): Early return in case of codegen error. * sese.c (debug_rename_map_1): Delete. (debug_rename_map): Delete. (sese_record_loop): Remove macro. (build_sese_loop_nests): Same. (new_sese_info): Same. (free_sese_info): Same. (sese_insert_phis_for_liveouts): (is_loop_closed_ssa_use): New. (number_of_phi_nodes): New. (bb_contains_loop_close_phi_nodes): New. (bb_contains_loop_phi_nodes): New. (phi_uses_name): New. (is_valid_rename): (get_rename): Add old_bb and loop_phi for more precise matching of exprs. (set_rename): Pass region. (later_of_the_two): New. (gsi_insert_earliest): New. (collect_all_ssa_names): New. (substitute_ssa_name): New. (rename_all_uses): New. (get_rename_from_scev): New. (rename_uses): Pass old_bb for more precise matching of exprs. (get_def_bb_for_const): New. (get_new_name): New. (get_loc): New. (get_edges): New. (copy_loop_phi_args): New. (copy_loop_phi_nodes): New. (get_loop_init_value): New. (find_init_value): New. (find_init_value_close_phi): New. (copy_loop_close_phi_args): New. (copy_loop_close_phi_nodes): New. (add_phi_arg_for_new_expr): New. (copy_cond_phi_args): New. (copy_cond_phi_nodes): New. (copy_phi_nodes): New. (should_copy_to_new_region): New. (set_rename_for_each_def): New. (graphite_copy_stmts_from_block): Early return in case of error. (copy_bb_and_scalar_dependences): Same. * sese.h (vec_find): New. (SESE_PARAMS): Delete. (SESE_LOOPS): Delete. (SESE_LOOP_NEST): Delete. (sese_contains_loop): Remove macro usage. (sese_nb_params): Same. (struct gimple_poly_bb): Added read_scalar_refs, write_scalar_refs. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r230200
2015-11-12 01:37:47 +01:00
to Gimple. */
bool codegen_error;
/* A vector of all the edges at if_condition merge points. */
auto_vec<edge, 2> merge_points;
};
/* Return the tree variable that corresponds to the given isl ast identifier
expression (an isl_ast_expr of type isl_ast_expr_id).
FIXME: We should replace blind conversion of id's type with derivation
of the optimal type when we get the corresponding isl support. Blindly
converting type sizes may be problematic when we switch to smaller
types. */
tree translate_isl_ast_to_gimple::
gcc_expression_from_isl_ast_expr_id (tree type,
__isl_take isl_ast_expr *expr_id,
ivs_params &ip)
{
gcc_assert (isl_ast_expr_get_type (expr_id) == isl_ast_expr_id);
isl_id *tmp_isl_id = isl_ast_expr_get_id (expr_id);
std::map<isl_id *, tree>::iterator res;
res = ip.find (tmp_isl_id);
isl_id_free (tmp_isl_id);
gcc_assert (res != ip.end () &&
"Could not map isl_id to tree expression");
isl_ast_expr_free (expr_id);
Remove limit_scops This patch removes graphite-scop-detection.c:limit_scops function and fix related issues arising because of that. The functionality limit_scop was added as an intermediate step to discard the loops which graphite could not handle. Removing limit_scop required handling of different cases of loops and surrounding code. The scop is now larger so most test cases required 'number of scops detected' to be fixed. By increasing the size of scop we can now optimize loops which are 'siblings' of each other. This could enable loop fusion on a number of loops. Since in the graphite framework we mostly want to opimize loop-nests/adjacent-loops, we now discard scops with less than 2 loops. We also discard scops without any data references. Essentially: - Remove limite_scops. - Only select scops when there are at least two loops (loop nest or, side by side). - Discard loops without data-refs. - Fix test cases. Passes bootstrap and reg-test. gcc/ChangeLog: 2015-09-02 Aditya Kumar <hiraditya@msn.com> Sebastian Pop <s.pop@samsung.com> * graphite-isl-ast-to-gimple.c (gcc_expression_from_isl_ast_expr_id): Return the parameter if it was saved in corresponding parameter_rename_map of the region. (copy_def): Copy def from sese region to the newly created region. (copy_internal_parameters): Copy all the internal parameters defined within a region to the newly created region. (graphite_regenerate_ast_isl): Copy parameters to the new region before translating isl to gimple. * graphite-scop-detection.c (graphite_can_represent_loop): Bail out if the loop-nest does not have any data-references. (build_graphite_scops): Create a scop only when there is at least one loop inside it. (contains_only_close_phi_nodes): Deleted. (print_graphite_scop_statistics): Deleted (print_graphite_statistics): Deleted (limit_scops): Deleted. (build_scops): Removed call to limit_scops. * sese.c (new_sese): Construct. (free_sese): Destruct. (sese_add_exit_phis_edge): update_stmt after exit phi edge has been added. (set_rename): Pass sese region so that parameters inside the region can be added to its parameter_rename_map. (rename_uses): Pass sese region. (graphite_copy_stmts_from_block): Do not copy parameters that have been generated in the header of the scop. For each SSA_NAME in the parameter_rename_map rename its usage. (invariant_in_sese_p_rec): Return false if tree t is defined outside sese region. (scalar_evolution_in_region): If the tree t is invariant just return t. * sese.h: Added a parameter renamne map (parameter_rename_map_t) to struct sese to keep track of all the parameters which need renaming. * tree-data-ref.c (loop_nest_has_data_refs): Check if a loop nest has any data-refs. * tree-data-ref.h: Declaration of loop_nest_has_data_refs. gcc/testsuite/ChangeLog: 2015-09-02 Aditya Kumar <hiraditya@msn.com> Sebastian Pop <s.pop@samsung.com> * gcc.dg/graphite/block-0.c: Modifed test case to match current output. * gcc.dg/graphite/block-1.c: Same. * gcc.dg/graphite/block-5.c: Same. * gcc.dg/graphite/block-6.c: Same. * gcc.dg/graphite/interchange-1.c: Same. * gcc.dg/graphite/interchange-10.c: Same. * gcc.dg/graphite/interchange-11.c: Same. * gcc.dg/graphite/interchange-13.c: Same. * gcc.dg/graphite/interchange-14.c: Same. * gcc.dg/graphite/interchange-3.c: Same. * gcc.dg/graphite/interchange-4.c: Same. * gcc.dg/graphite/interchange-7.c: Same. * gcc.dg/graphite/interchange-8.c: Same. * gcc.dg/graphite/interchange-9.c: Same. * gcc.dg/graphite/isl-codegen-loop-dumping.c: Same. * gcc.dg/graphite/pr35356-1.c (foo): Same. * gcc.dg/graphite/pr37485.c: Same. * gcc.dg/graphite/scop-0.c (int toto): Same. * gcc.dg/graphite/scop-1.c: Same. * gcc.dg/graphite/scop-10.c: Same. * gcc.dg/graphite/scop-11.c: Same. * gcc.dg/graphite/scop-12.c: Same. * gcc.dg/graphite/scop-13.c: Same. * gcc.dg/graphite/scop-16.c: Same. * gcc.dg/graphite/scop-17.c: Same. * gcc.dg/graphite/scop-18.c: Same. * gcc.dg/graphite/scop-2.c: Same. * gcc.dg/graphite/scop-21.c (int test): Same. * gcc.dg/graphite/scop-22.c (void foo): Same. * gcc.dg/graphite/scop-4.c: Same. * gcc.dg/graphite/scop-5.c: Same. * gcc.dg/graphite/scop-6.c: Same. * gcc.dg/graphite/scop-7.c: Same. * gcc.dg/graphite/scop-8.c: Same. * gcc.dg/graphite/scop-9.c: Same. * gcc.dg/graphite/scop-mvt.c (void mvt): Introduced dependency so that data-refs remain inside the inner loop. * gcc.dg/graphite/uns-block-1.c: Modifed test case to match o/p. * gcc.dg/graphite/uns-interchange-14.c: Same. * gcc.dg/graphite/uns-interchange-9.c: Same. * gfortran.dg/graphite/interchange-3.f90 libgomp/ChangeLog: 2015-09-04 Aditya Kumar <hiraditya@msn.com> Sebastian Pop <s.pop@samsung.com> * testsuite/libgomp.graphite/bounds.c (int foo): Modifed test case to match o/p. * testsuite/libgomp.graphite/force-parallel-1.c (void parloop): Same. * testsuite/libgomp.graphite/force-parallel-4.c: Same. * testsuite/libgomp.graphite/force-parallel-5.c: Same. * testsuite/libgomp.graphite/force-parallel-7.c: Same. * testsuite/libgomp.graphite/force-parallel-8.c: Same. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r227567
2015-09-09 00:18:11 +02:00
tree t = res->second;
tree *val = region->parameter_rename_map->get(t);
if (!val)
val = &t;
return fold_convert (type, *val);
}
/* Converts an isl_ast_expr_int expression E to a GCC expression tree of
type TYPE. */
tree translate_isl_ast_to_gimple::
gcc_expression_from_isl_expr_int (tree type, __isl_take isl_ast_expr *expr)
{
gcc_assert (isl_ast_expr_get_type (expr) == isl_ast_expr_int);
isl_val *val = isl_ast_expr_get_val (expr);
mpz_t val_mpz_t;
mpz_init (val_mpz_t);
tree res;
if (isl_val_get_num_gmp (val, val_mpz_t) == -1)
res = NULL_TREE;
else
res = gmp_cst_to_tree (type, val_mpz_t);
isl_val_free (val);
isl_ast_expr_free (expr);
mpz_clear (val_mpz_t);
return res;
}
/* Converts a binary isl_ast_expr_op expression E to a GCC expression tree of
type TYPE. */
tree translate_isl_ast_to_gimple::
binary_op_to_tree (tree type, __isl_take isl_ast_expr *expr, ivs_params &ip)
{
isl_ast_expr *arg_expr = isl_ast_expr_get_op_arg (expr, 0);
tree tree_lhs_expr = gcc_expression_from_isl_expression (type, arg_expr, ip);
arg_expr = isl_ast_expr_get_op_arg (expr, 1);
tree tree_rhs_expr = gcc_expression_from_isl_expression (type, arg_expr, ip);
enum isl_ast_op_type expr_type = isl_ast_expr_get_op_type (expr);
isl_ast_expr_free (expr);
if (codegen_error_p ())
return NULL_TREE;
switch (expr_type)
{
case isl_ast_op_add:
return fold_build2 (PLUS_EXPR, type, tree_lhs_expr, tree_rhs_expr);
case isl_ast_op_sub:
return fold_build2 (MINUS_EXPR, type, tree_lhs_expr, tree_rhs_expr);
case isl_ast_op_mul:
return fold_build2 (MULT_EXPR, type, tree_lhs_expr, tree_rhs_expr);
case isl_ast_op_div:
2015-12-17 19:50:05 +01:00
/* As isl operates on arbitrary precision numbers, we may end up with
division by 2^64 that is folded to 0. */
if (integer_zerop (tree_rhs_expr))
{
codegen_error = true;
return NULL_TREE;
}
return fold_build2 (EXACT_DIV_EXPR, type, tree_lhs_expr, tree_rhs_expr);
case isl_ast_op_pdiv_q:
2015-12-17 19:50:05 +01:00
/* As isl operates on arbitrary precision numbers, we may end up with
division by 2^64 that is folded to 0. */
if (integer_zerop (tree_rhs_expr))
{
codegen_error = true;
return NULL_TREE;
}
return fold_build2 (TRUNC_DIV_EXPR, type, tree_lhs_expr, tree_rhs_expr);
#if HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
2015-12-17 19:50:05 +01:00
/* isl 0.15 or later. */
case isl_ast_op_zdiv_r:
#endif
case isl_ast_op_pdiv_r:
2015-12-17 19:50:05 +01:00
/* As isl operates on arbitrary precision numbers, we may end up with
division by 2^64 that is folded to 0. */
if (integer_zerop (tree_rhs_expr))
{
codegen_error = true;
return NULL_TREE;
}
return fold_build2 (TRUNC_MOD_EXPR, type, tree_lhs_expr, tree_rhs_expr);
case isl_ast_op_fdiv_q:
2015-12-17 19:50:05 +01:00
/* As isl operates on arbitrary precision numbers, we may end up with
division by 2^64 that is folded to 0. */
if (integer_zerop (tree_rhs_expr))
{
codegen_error = true;
return NULL_TREE;
}
return fold_build2 (FLOOR_DIV_EXPR, type, tree_lhs_expr, tree_rhs_expr);
case isl_ast_op_and:
return fold_build2 (TRUTH_ANDIF_EXPR, type,
tree_lhs_expr, tree_rhs_expr);
case isl_ast_op_or:
return fold_build2 (TRUTH_ORIF_EXPR, type, tree_lhs_expr, tree_rhs_expr);
case isl_ast_op_eq:
return fold_build2 (EQ_EXPR, type, tree_lhs_expr, tree_rhs_expr);
case isl_ast_op_le:
return fold_build2 (LE_EXPR, type, tree_lhs_expr, tree_rhs_expr);
case isl_ast_op_lt:
return fold_build2 (LT_EXPR, type, tree_lhs_expr, tree_rhs_expr);
case isl_ast_op_ge:
return fold_build2 (GE_EXPR, type, tree_lhs_expr, tree_rhs_expr);
case isl_ast_op_gt:
return fold_build2 (GT_EXPR, type, tree_lhs_expr, tree_rhs_expr);
default:
gcc_unreachable ();
}
}
/* Converts a ternary isl_ast_expr_op expression E to a GCC expression tree of
type TYPE. */
tree translate_isl_ast_to_gimple::
ternary_op_to_tree (tree type, __isl_take isl_ast_expr *expr, ivs_params &ip)
{
enum isl_ast_op_type t = isl_ast_expr_get_op_type (expr);
gcc_assert (t == isl_ast_op_cond || t == isl_ast_op_select);
isl_ast_expr *arg_expr = isl_ast_expr_get_op_arg (expr, 0);
tree a = gcc_expression_from_isl_expression (type, arg_expr, ip);
arg_expr = isl_ast_expr_get_op_arg (expr, 1);
tree b = gcc_expression_from_isl_expression (type, arg_expr, ip);
arg_expr = isl_ast_expr_get_op_arg (expr, 2);
tree c = gcc_expression_from_isl_expression (type, arg_expr, ip);
isl_ast_expr_free (expr);
if (codegen_error_p ())
return NULL_TREE;
return fold_build3 (COND_EXPR, type, a, b, c);
}
/* Converts a unary isl_ast_expr_op expression E to a GCC expression tree of
type TYPE. */
tree translate_isl_ast_to_gimple::
unary_op_to_tree (tree type, __isl_take isl_ast_expr *expr, ivs_params &ip)
{
gcc_assert (isl_ast_expr_get_op_type (expr) == isl_ast_op_minus);
isl_ast_expr *arg_expr = isl_ast_expr_get_op_arg (expr, 0);
tree tree_expr = gcc_expression_from_isl_expression (type, arg_expr, ip);
isl_ast_expr_free (expr);
return codegen_error_p () ? NULL_TREE
: fold_build1 (NEGATE_EXPR, type, tree_expr);
}
/* Converts an isl_ast_expr_op expression E with unknown number of arguments
to a GCC expression tree of type TYPE. */
tree translate_isl_ast_to_gimple::
nary_op_to_tree (tree type, __isl_take isl_ast_expr *expr, ivs_params &ip)
{
enum tree_code op_code;
switch (isl_ast_expr_get_op_type (expr))
{
case isl_ast_op_max:
op_code = MAX_EXPR;
break;
case isl_ast_op_min:
op_code = MIN_EXPR;
break;
default:
gcc_unreachable ();
}
isl_ast_expr *arg_expr = isl_ast_expr_get_op_arg (expr, 0);
tree res = gcc_expression_from_isl_expression (type, arg_expr, ip);
if (codegen_error_p ())
{
isl_ast_expr_free (expr);
return NULL_TREE;
}
int i;
for (i = 1; i < isl_ast_expr_get_op_n_arg (expr); i++)
{
arg_expr = isl_ast_expr_get_op_arg (expr, i);
tree t = gcc_expression_from_isl_expression (type, arg_expr, ip);
if (codegen_error_p ())
{
isl_ast_expr_free (expr);
return NULL_TREE;
}
res = fold_build2 (op_code, type, res, t);
}
isl_ast_expr_free (expr);
return res;
}
/* Converts an isl_ast_expr_op expression E to a GCC expression tree of
type TYPE. */
tree translate_isl_ast_to_gimple::
gcc_expression_from_isl_expr_op (tree type, __isl_take isl_ast_expr *expr,
ivs_params &ip)
{
if (codegen_error_p ())
{
isl_ast_expr_free (expr);
return NULL_TREE;
}
gcc_assert (isl_ast_expr_get_type (expr) == isl_ast_expr_op);
switch (isl_ast_expr_get_op_type (expr))
{
/* These isl ast expressions are not supported yet. */
case isl_ast_op_error:
case isl_ast_op_call:
case isl_ast_op_and_then:
case isl_ast_op_or_else:
gcc_unreachable ();
case isl_ast_op_max:
case isl_ast_op_min:
return nary_op_to_tree (type, expr, ip);
case isl_ast_op_add:
case isl_ast_op_sub:
case isl_ast_op_mul:
case isl_ast_op_div:
case isl_ast_op_pdiv_q:
case isl_ast_op_pdiv_r:
case isl_ast_op_fdiv_q:
#if HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
2015-12-17 19:50:05 +01:00
/* isl 0.15 or later. */
case isl_ast_op_zdiv_r:
#endif
case isl_ast_op_and:
case isl_ast_op_or:
case isl_ast_op_eq:
case isl_ast_op_le:
case isl_ast_op_lt:
case isl_ast_op_ge:
case isl_ast_op_gt:
return binary_op_to_tree (type, expr, ip);
case isl_ast_op_minus:
return unary_op_to_tree (type, expr, ip);
case isl_ast_op_cond:
case isl_ast_op_select:
return ternary_op_to_tree (type, expr, ip);
default:
gcc_unreachable ();
}
return NULL_TREE;
}
2015-12-17 19:50:05 +01:00
/* Converts an isl AST expression E back to a GCC expression tree of
type TYPE. */
tree translate_isl_ast_to_gimple::
gcc_expression_from_isl_expression (tree type, __isl_take isl_ast_expr *expr,
ivs_params &ip)
{
if (codegen_error_p ())
{
isl_ast_expr_free (expr);
return NULL_TREE;
}
switch (isl_ast_expr_get_type (expr))
{
case isl_ast_expr_id:
return gcc_expression_from_isl_ast_expr_id (type, expr, ip);
case isl_ast_expr_int:
return gcc_expression_from_isl_expr_int (type, expr);
case isl_ast_expr_op:
return gcc_expression_from_isl_expr_op (type, expr, ip);
default:
gcc_unreachable ();
}
return NULL_TREE;
}
/* Creates a new LOOP corresponding to isl_ast_node_for. Inserts an
induction variable for the new LOOP. New LOOP is attached to CFG
starting at ENTRY_EDGE. LOOP is inserted into the loop tree and
becomes the child loop of the OUTER_LOOP. NEWIVS_INDEX binds
2015-12-17 19:50:05 +01:00
isl's scattering name to the induction variable created for the
loop of STMT. The new induction variable is inserted in the NEWIVS
vector and is of type TYPE. */
struct loop *translate_isl_ast_to_gimple::
graphite_create_new_loop (edge entry_edge, __isl_keep isl_ast_node *node_for,
loop_p outer, tree type, tree lb, tree ub,
ivs_params &ip)
{
isl_ast_expr *for_inc = isl_ast_node_for_get_inc (node_for);
tree stride = gcc_expression_from_isl_expression (type, for_inc, ip);
/* To fail code generation, we generate wrong code until we discard it. */
if (codegen_error_p ())
stride = integer_zero_node;
tree ivvar = create_tmp_var (type, "graphite_IV");
tree iv, iv_after_increment;
loop_p loop = create_empty_loop_on_edge
(entry_edge, lb, stride, ub, ivvar, &iv, &iv_after_increment,
outer ? outer : entry_edge->src->loop_father);
isl_ast_expr *for_iterator = isl_ast_node_for_get_iterator (node_for);
isl_id *id = isl_ast_expr_get_id (for_iterator);
std::map<isl_id *, tree>::iterator res;
res = ip.find (id);
if (ip.count (id))
isl_id_free (res->first);
ip[id] = iv;
isl_ast_expr_free (for_iterator);
return loop;
}
/* Create the loop for a isl_ast_node_for.
- NEXT_E is the edge where new generated code should be attached. */
edge translate_isl_ast_to_gimple::
translate_isl_ast_for_loop (loop_p context_loop,
__isl_keep isl_ast_node *node_for, edge next_e,
tree type, tree lb, tree ub,
ivs_params &ip)
{
gcc_assert (isl_ast_node_get_type (node_for) == isl_ast_node_for);
struct loop *loop = graphite_create_new_loop (next_e, node_for, context_loop,
type, lb, ub, ip);
edge last_e = single_exit (loop);
edge to_body = single_succ_edge (loop->header);
basic_block after = to_body->dest;
/* Translate the body of the loop. */
isl_ast_node *for_body = isl_ast_node_for_get_body (node_for);
next_e = translate_isl_ast (loop, for_body, to_body, ip);
isl_ast_node_free (for_body);
Preserve the original program while using graphite. Earlier, graphite used to translate portions of the original program after scop-detection in order to represent the SCoP into polyhedral model. This was required because each basic block was represented as independent basic block in the polyhedral model. So all the cross-basic-block dependencies were translated out-of-ssa. With this patch those dependencies are also exposed to the ISL, so there is no need to modify the original structure of the program. After this patch we should be able to enable graphite at some default optimization level. Highlights: Remove cross bb scalar to array translation For reductions, add support for more than just INT_CST Early bailout on codegen. Verify loop-closed ssa structure during copy of renames The uses of exprs should come from bb which dominates the bb Collect the init value of close phi in loop-guard Do not follow vuses for close-phi, postpone loop-close phi until the corresponding loop-phi is processed Bail out if no bb found to place cond/loop -phis Move insertion of liveouts at the end of codegen Insert loop-phis in the loop-header. This patch passes regtest and bootstrap with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' 2015-11-11 Aditya Kumar <aditya.k7@samsung.com> Sebastian Pop <s.pop@samsung.com> * graphite-isl-ast-to-gimple.c (class translate_isl_ast_to_gimple): New member codegen_error (translate_isl_ast_for_loop): Remove call to single_succ_edge and early return. (translate_isl_ast_node_user): Early return in case of error. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_to_gimple::translate_pending_phi_nodes): New. (add_parameters_to_ivs_params): Remove macro. (graphite_regenerate_ast_isl): Add if_region pointer to region. * graphite-poly.c (new_poly_dr): Remove macro. (print_pdr): Same. (new_gimple_poly_bb): Same. (free_gimple_poly_bb): Same. (print_scop_params): Same. * graphite-poly.h (struct poly_dr): Same. (struct poly_bb): Add new_bb. (gbb_from_bb): Remove dead code. (pbb_from_bb): Same. * graphite-scop-detection.c (parameter_index_in_region_1): Same. (parameter_index_in_region): Same. (find_scop_parameters): Same. (build_cross_bb_scalars_def): New. (build_cross_bb_scalars_use): New. (graphite_find_cross_bb_scalar_vars): New (try_generate_gimple_bb): Reads and Writes. (build_alias_set): Move. (gather_bbs::before_dom_children): Gather bbs visited. (build_scops): call build_alias_set. * graphite-sese-to-poly.c (phi_arg_in_outermost_loop): Delete. (remove_simple_copy_phi): Delete. (remove_invariant_phi): Delete. (simple_copy_phi_p): Delete. (reduction_phi_p): Delete. (isl_id_for_dr): Remove unused param. (parameter_index_in_region_1): Remove macro usage. (set_scop_parameter_dim): Same. (add_param_constraints): Same. (add_conditions_to_constraints): Same (build_scop_iteration_domain): Same. (pdr_add_alias_set): Comment. (add_scalar_version_numbers): New. (build_poly_dr): ISL id. (build_scop_drs): Move. (build_poly_sr_1): Same. (insert_stmts): Remove. (build_poly_sr): New. (new_pbb_from_pbb): Delete. (insert_out_of_ssa_copy_on_edge): Delete. (create_zero_dim_array): Delete. (scalar_close_phi_node_p): Delete. (propagate_expr_outside_region): Delete. (rewrite_close_phi_out_of_ssa): Delete. (rewrite_phi_out_of_ssa): Delete. (rewrite_degenerate_phi): Delete. (rewrite_reductions_out_of_ssa): Delete. (rewrite_cross_bb_scalar_dependence): Delete. (handle_scalar_deps_crossing_scop_limits): (rewrite_cross_bb_scalar_deps): Delete. (build_poly_scop): Remove calls to out-of-ssa functions. * graphite.c (graphite_transform_loops): Early return in case of codegen error. * sese.c (debug_rename_map_1): Delete. (debug_rename_map): Delete. (sese_record_loop): Remove macro. (build_sese_loop_nests): Same. (new_sese_info): Same. (free_sese_info): Same. (sese_insert_phis_for_liveouts): (is_loop_closed_ssa_use): New. (number_of_phi_nodes): New. (bb_contains_loop_close_phi_nodes): New. (bb_contains_loop_phi_nodes): New. (phi_uses_name): New. (is_valid_rename): (get_rename): Add old_bb and loop_phi for more precise matching of exprs. (set_rename): Pass region. (later_of_the_two): New. (gsi_insert_earliest): New. (collect_all_ssa_names): New. (substitute_ssa_name): New. (rename_all_uses): New. (get_rename_from_scev): New. (rename_uses): Pass old_bb for more precise matching of exprs. (get_def_bb_for_const): New. (get_new_name): New. (get_loc): New. (get_edges): New. (copy_loop_phi_args): New. (copy_loop_phi_nodes): New. (get_loop_init_value): New. (find_init_value): New. (find_init_value_close_phi): New. (copy_loop_close_phi_args): New. (copy_loop_close_phi_nodes): New. (add_phi_arg_for_new_expr): New. (copy_cond_phi_args): New. (copy_cond_phi_nodes): New. (copy_phi_nodes): New. (should_copy_to_new_region): New. (set_rename_for_each_def): New. (graphite_copy_stmts_from_block): Early return in case of error. (copy_bb_and_scalar_dependences): Same. * sese.h (vec_find): New. (SESE_PARAMS): Delete. (SESE_LOOPS): Delete. (SESE_LOOP_NEST): Delete. (sese_contains_loop): Remove macro usage. (sese_nb_params): Same. (struct gimple_poly_bb): Added read_scalar_refs, write_scalar_refs. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r230200
2015-11-12 01:37:47 +01:00
/* Early return if we failed to translate loop body. */
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
if (!next_e || codegen_error_p ())
Preserve the original program while using graphite. Earlier, graphite used to translate portions of the original program after scop-detection in order to represent the SCoP into polyhedral model. This was required because each basic block was represented as independent basic block in the polyhedral model. So all the cross-basic-block dependencies were translated out-of-ssa. With this patch those dependencies are also exposed to the ISL, so there is no need to modify the original structure of the program. After this patch we should be able to enable graphite at some default optimization level. Highlights: Remove cross bb scalar to array translation For reductions, add support for more than just INT_CST Early bailout on codegen. Verify loop-closed ssa structure during copy of renames The uses of exprs should come from bb which dominates the bb Collect the init value of close phi in loop-guard Do not follow vuses for close-phi, postpone loop-close phi until the corresponding loop-phi is processed Bail out if no bb found to place cond/loop -phis Move insertion of liveouts at the end of codegen Insert loop-phis in the loop-header. This patch passes regtest and bootstrap with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' 2015-11-11 Aditya Kumar <aditya.k7@samsung.com> Sebastian Pop <s.pop@samsung.com> * graphite-isl-ast-to-gimple.c (class translate_isl_ast_to_gimple): New member codegen_error (translate_isl_ast_for_loop): Remove call to single_succ_edge and early return. (translate_isl_ast_node_user): Early return in case of error. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_to_gimple::translate_pending_phi_nodes): New. (add_parameters_to_ivs_params): Remove macro. (graphite_regenerate_ast_isl): Add if_region pointer to region. * graphite-poly.c (new_poly_dr): Remove macro. (print_pdr): Same. (new_gimple_poly_bb): Same. (free_gimple_poly_bb): Same. (print_scop_params): Same. * graphite-poly.h (struct poly_dr): Same. (struct poly_bb): Add new_bb. (gbb_from_bb): Remove dead code. (pbb_from_bb): Same. * graphite-scop-detection.c (parameter_index_in_region_1): Same. (parameter_index_in_region): Same. (find_scop_parameters): Same. (build_cross_bb_scalars_def): New. (build_cross_bb_scalars_use): New. (graphite_find_cross_bb_scalar_vars): New (try_generate_gimple_bb): Reads and Writes. (build_alias_set): Move. (gather_bbs::before_dom_children): Gather bbs visited. (build_scops): call build_alias_set. * graphite-sese-to-poly.c (phi_arg_in_outermost_loop): Delete. (remove_simple_copy_phi): Delete. (remove_invariant_phi): Delete. (simple_copy_phi_p): Delete. (reduction_phi_p): Delete. (isl_id_for_dr): Remove unused param. (parameter_index_in_region_1): Remove macro usage. (set_scop_parameter_dim): Same. (add_param_constraints): Same. (add_conditions_to_constraints): Same (build_scop_iteration_domain): Same. (pdr_add_alias_set): Comment. (add_scalar_version_numbers): New. (build_poly_dr): ISL id. (build_scop_drs): Move. (build_poly_sr_1): Same. (insert_stmts): Remove. (build_poly_sr): New. (new_pbb_from_pbb): Delete. (insert_out_of_ssa_copy_on_edge): Delete. (create_zero_dim_array): Delete. (scalar_close_phi_node_p): Delete. (propagate_expr_outside_region): Delete. (rewrite_close_phi_out_of_ssa): Delete. (rewrite_phi_out_of_ssa): Delete. (rewrite_degenerate_phi): Delete. (rewrite_reductions_out_of_ssa): Delete. (rewrite_cross_bb_scalar_dependence): Delete. (handle_scalar_deps_crossing_scop_limits): (rewrite_cross_bb_scalar_deps): Delete. (build_poly_scop): Remove calls to out-of-ssa functions. * graphite.c (graphite_transform_loops): Early return in case of codegen error. * sese.c (debug_rename_map_1): Delete. (debug_rename_map): Delete. (sese_record_loop): Remove macro. (build_sese_loop_nests): Same. (new_sese_info): Same. (free_sese_info): Same. (sese_insert_phis_for_liveouts): (is_loop_closed_ssa_use): New. (number_of_phi_nodes): New. (bb_contains_loop_close_phi_nodes): New. (bb_contains_loop_phi_nodes): New. (phi_uses_name): New. (is_valid_rename): (get_rename): Add old_bb and loop_phi for more precise matching of exprs. (set_rename): Pass region. (later_of_the_two): New. (gsi_insert_earliest): New. (collect_all_ssa_names): New. (substitute_ssa_name): New. (rename_all_uses): New. (get_rename_from_scev): New. (rename_uses): Pass old_bb for more precise matching of exprs. (get_def_bb_for_const): New. (get_new_name): New. (get_loc): New. (get_edges): New. (copy_loop_phi_args): New. (copy_loop_phi_nodes): New. (get_loop_init_value): New. (find_init_value): New. (find_init_value_close_phi): New. (copy_loop_close_phi_args): New. (copy_loop_close_phi_nodes): New. (add_phi_arg_for_new_expr): New. (copy_cond_phi_args): New. (copy_cond_phi_nodes): New. (copy_phi_nodes): New. (should_copy_to_new_region): New. (set_rename_for_each_def): New. (graphite_copy_stmts_from_block): Early return in case of error. (copy_bb_and_scalar_dependences): Same. * sese.h (vec_find): New. (SESE_PARAMS): Delete. (SESE_LOOPS): Delete. (SESE_LOOP_NEST): Delete. (sese_contains_loop): Remove macro usage. (sese_nb_params): Same. (struct gimple_poly_bb): Added read_scalar_refs, write_scalar_refs. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r230200
2015-11-12 01:37:47 +01:00
return NULL;
if (next_e->dest != after)
redirect_edge_succ_nodup (next_e, after);
set_immediate_dominator (CDI_DOMINATORS, next_e->dest, next_e->src);
if (flag_loop_parallelize_all)
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
{
isl_id *id = isl_ast_node_get_annotation (node_for);
gcc_assert (id);
ast_build_info *for_info = (ast_build_info *) isl_id_get_user (id);
loop->can_be_parallel = for_info->is_parallelizable;
free (for_info);
isl_id_free (id);
}
return last_e;
}
/* We use this function to get the upper bound because of the form,
which is used by isl to represent loops:
for (iterator = init; cond; iterator += inc)
{
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
...
}
The loop condition is an arbitrary expression, which contains the
current loop iterator.
(e.g. iterator + 3 < B && C > iterator + A)
We have to know the upper bound of the iterator to generate a loop
in Gimple form. It can be obtained from the special representation
of the loop condition, which is generated by isl,
if the ast_build_atomic_upper_bound option is set. In this case,
isl generates a loop condition that consists of the current loop
iterator, + an operator (< or <=) and an expression not involving
the iterator, which is processed and returned by this function.
(e.g iterator <= upper-bound-expression-without-iterator) */
static __isl_give isl_ast_expr *
get_upper_bound (__isl_keep isl_ast_node *node_for)
{
gcc_assert (isl_ast_node_get_type (node_for) == isl_ast_node_for);
isl_ast_expr *for_cond = isl_ast_node_for_get_cond (node_for);
gcc_assert (isl_ast_expr_get_type (for_cond) == isl_ast_expr_op);
isl_ast_expr *res;
switch (isl_ast_expr_get_op_type (for_cond))
{
case isl_ast_op_le:
res = isl_ast_expr_get_op_arg (for_cond, 1);
break;
case isl_ast_op_lt:
{
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
/* (iterator < ub) => (iterator <= ub - 1). */
isl_val *one =
isl_val_int_from_si (isl_ast_expr_get_ctx (for_cond), 1);
isl_ast_expr *ub = isl_ast_expr_get_op_arg (for_cond, 1);
res = isl_ast_expr_sub (ub, isl_ast_expr_from_val (one));
break;
}
default:
gcc_unreachable ();
}
isl_ast_expr_free (for_cond);
return res;
}
/* All loops generated by create_empty_loop_on_edge have the form of
a post-test loop:
do
{
body of the loop;
} while (lower bound < upper bound);
We create a new if region protecting the loop to be executed, if
the execution count is zero (lower bound > upper bound). */
edge translate_isl_ast_to_gimple::
graphite_create_new_loop_guard (edge entry_edge,
__isl_keep isl_ast_node *node_for, tree *type,
tree *lb, tree *ub, ivs_params &ip)
{
gcc_assert (isl_ast_node_get_type (node_for) == isl_ast_node_for);
tree cond_expr;
edge exit_edge;
*type =
build_nonstandard_integer_type (graphite_expression_type_precision, 0);
isl_ast_expr *for_init = isl_ast_node_for_get_init (node_for);
*lb = gcc_expression_from_isl_expression (*type, for_init, ip);
/* To fail code generation, we generate wrong code until we discard it. */
if (codegen_error_p ())
*lb = integer_zero_node;
isl_ast_expr *upper_bound = get_upper_bound (node_for);
*ub = gcc_expression_from_isl_expression (*type, upper_bound, ip);
/* To fail code generation, we generate wrong code until we discard it. */
if (codegen_error_p ())
*ub = integer_zero_node;
/* When ub is simply a constant or a parameter, use lb <= ub. */
if (TREE_CODE (*ub) == INTEGER_CST || TREE_CODE (*ub) == SSA_NAME)
cond_expr = fold_build2 (LE_EXPR, boolean_type_node, *lb, *ub);
else
{
tree one = (POINTER_TYPE_P (*type)
? convert_to_ptrofftype (integer_one_node)
: fold_convert (*type, integer_one_node));
/* Adding +1 and using LT_EXPR helps with loop latches that have a
loop iteration count of "PARAMETER - 1". For PARAMETER == 0 this
becomes 2^k-1 due to integer overflow, and the condition lb <= ub
is true, even if we do not want this. However lb < ub + 1 is false,
as expected. */
tree ub_one = fold_build2 (POINTER_TYPE_P (*type) ? POINTER_PLUS_EXPR
: PLUS_EXPR, *type, *ub, one);
cond_expr = fold_build2 (LT_EXPR, boolean_type_node, *lb, ub_one);
}
if (integer_onep (cond_expr))
exit_edge = entry_edge;
else
exit_edge = create_empty_if_region_on_edge (entry_edge,
unshare_expr (cond_expr));
return exit_edge;
}
/* Translates an isl_ast_node_for to Gimple. */
edge translate_isl_ast_to_gimple::
translate_isl_ast_node_for (loop_p context_loop, __isl_keep isl_ast_node *node,
edge next_e, ivs_params &ip)
{
gcc_assert (isl_ast_node_get_type (node) == isl_ast_node_for);
tree type, lb, ub;
edge last_e = graphite_create_new_loop_guard (next_e, node, &type,
&lb, &ub, ip);
if (last_e == next_e)
{
/* There was no guard generated. */
last_e = single_succ_edge (split_edge (last_e));
translate_isl_ast_for_loop (context_loop, node, next_e,
type, lb, ub, ip);
return last_e;
}
edge true_e = get_true_edge_from_guard_bb (next_e->dest);
merge_points.safe_push (last_e);
last_e = single_succ_edge (split_edge (last_e));
translate_isl_ast_for_loop (context_loop, node, true_e, type, lb, ub, ip);
return last_e;
}
/* Inserts in iv_map a tuple (OLD_LOOP->num, NEW_NAME) for the induction
variables of the loops around GBB in SESE.
FIXME: Instead of using a vec<tree> that maps each loop id to a possible
chrec, we could consider using a map<int, tree> that maps loop ids to the
corresponding tree expressions. */
void translate_isl_ast_to_gimple::
build_iv_mapping (vec<tree> iv_map, gimple_poly_bb_p gbb,
__isl_keep isl_ast_expr *user_expr, ivs_params &ip,
move graphite bookkeeping from sese to sese_info 2015-10-06 Aditya Kumar <aditya.k7@samsung.com> Sebastian Pop <s.pop@samsung.com> * graphite-isl-ast-to-gimple.c (translate_isl_ast_to_gimple): Use an sese_info_p. (copy_def): Same. (copy_internal_parameters): Same. (translate_isl_ast_to_gimple): Use an sese_l. (build_iv_mapping): Same. * graphite-poly.c (new_sese): Rename new_sese_info. (free_sese): Rename free_sese_info. * graphite-poly.h (struct scop): Use an sese_info_p. (scop_set_region): Same. * graphite-scop-detection.c (struct sese_l): Moved... (get_entry_bb): Moved... (get_exit_bb): Moved... (parameter_index_in_region_1): Use an sese_info_p. (parameter_index_in_region): Same. (scan_tree_for_params): Same. (find_params_in_bb): Same. (sese_dom_walker): Use an sese_l. * graphite-sese-to-poly.c (remove_invariant_phi): Same. (reduction_phi_p): Same. (parameter_index_in_region_1): Use an sese_info_p. (propagate_expr_outside_region): Use an sese_l. * graphite.c: Replace uses of SCOP_REGION. * sese.c (sese_record_loop): Use an sese_info_p. (build_sese_loop_nests): Same. (sese_build_liveouts_use): Same. (sese_build_liveouts_bb): Same. (sese_build_liveouts_bb): Same. (sese_bad_liveouts_use): Same. (sese_reset_debug_liveouts_bb): Same. (sese_build_liveouts): Same. (new_sese): Renamed new_sese_info. (free_sese): Renamed free_sese_info. (set_rename): Use an sese_info_p. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (outermost_loop_in_sese_1): Use an sese_l. (outermost_loop_in_sese): Same. (if_region_set_false_region): Use an sese_info_p. (move_sese_in_condition): Same. (scalar_evolution_in_region): Use an sese_l. * sese.h (struct sese_l): ... here. (SESE_ENTRY): Remove. (SESE_ENTRY_BB): Remove. (SESE_EXIT): Remove. (SESE_EXIT_BB): Remove. (sese_contains_loop): Use an sese_info_p. (sese_nb_params): Same. (bb_in_sese_p): Use an sese_l. (stmt_in_sese_p): Same. (defined_in_sese_p): Same. (loop_in_sese_p): Same. (sese_loop_depth): Same. (struct ifsese_s): Use an sese_info_p. (gbb_loop_at_index): Use an sese_l. (nb_common_loops): Same. (scev_analyzable_p): Same. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r228572
2015-10-07 17:40:17 +02:00
sese_l &region)
{
gcc_assert (isl_ast_expr_get_type (user_expr) == isl_ast_expr_op &&
isl_ast_expr_get_op_type (user_expr) == isl_ast_op_call);
int i;
isl_ast_expr *arg_expr;
for (i = 1; i < isl_ast_expr_get_op_n_arg (user_expr); i++)
{
arg_expr = isl_ast_expr_get_op_arg (user_expr, i);
tree type =
build_nonstandard_integer_type (graphite_expression_type_precision, 0);
tree t = gcc_expression_from_isl_expression (type, arg_expr, ip);
/* To fail code generation, we generate wrong code until we discard it. */
if (codegen_error_p ())
t = integer_zero_node;
loop_p old_loop = gbb_loop_at_index (gbb, region, i - 1);
iv_map[old_loop->num] = t;
}
}
/* Translates an isl_ast_node_user to Gimple.
FIXME: We should remove iv_map.create (loop->num + 1), if it is possible. */
edge translate_isl_ast_to_gimple::
translate_isl_ast_node_user (__isl_keep isl_ast_node *node,
edge next_e, ivs_params &ip)
{
gcc_assert (isl_ast_node_get_type (node) == isl_ast_node_user);
Preserve the original program while using graphite. Earlier, graphite used to translate portions of the original program after scop-detection in order to represent the SCoP into polyhedral model. This was required because each basic block was represented as independent basic block in the polyhedral model. So all the cross-basic-block dependencies were translated out-of-ssa. With this patch those dependencies are also exposed to the ISL, so there is no need to modify the original structure of the program. After this patch we should be able to enable graphite at some default optimization level. Highlights: Remove cross bb scalar to array translation For reductions, add support for more than just INT_CST Early bailout on codegen. Verify loop-closed ssa structure during copy of renames The uses of exprs should come from bb which dominates the bb Collect the init value of close phi in loop-guard Do not follow vuses for close-phi, postpone loop-close phi until the corresponding loop-phi is processed Bail out if no bb found to place cond/loop -phis Move insertion of liveouts at the end of codegen Insert loop-phis in the loop-header. This patch passes regtest and bootstrap with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' 2015-11-11 Aditya Kumar <aditya.k7@samsung.com> Sebastian Pop <s.pop@samsung.com> * graphite-isl-ast-to-gimple.c (class translate_isl_ast_to_gimple): New member codegen_error (translate_isl_ast_for_loop): Remove call to single_succ_edge and early return. (translate_isl_ast_node_user): Early return in case of error. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_to_gimple::translate_pending_phi_nodes): New. (add_parameters_to_ivs_params): Remove macro. (graphite_regenerate_ast_isl): Add if_region pointer to region. * graphite-poly.c (new_poly_dr): Remove macro. (print_pdr): Same. (new_gimple_poly_bb): Same. (free_gimple_poly_bb): Same. (print_scop_params): Same. * graphite-poly.h (struct poly_dr): Same. (struct poly_bb): Add new_bb. (gbb_from_bb): Remove dead code. (pbb_from_bb): Same. * graphite-scop-detection.c (parameter_index_in_region_1): Same. (parameter_index_in_region): Same. (find_scop_parameters): Same. (build_cross_bb_scalars_def): New. (build_cross_bb_scalars_use): New. (graphite_find_cross_bb_scalar_vars): New (try_generate_gimple_bb): Reads and Writes. (build_alias_set): Move. (gather_bbs::before_dom_children): Gather bbs visited. (build_scops): call build_alias_set. * graphite-sese-to-poly.c (phi_arg_in_outermost_loop): Delete. (remove_simple_copy_phi): Delete. (remove_invariant_phi): Delete. (simple_copy_phi_p): Delete. (reduction_phi_p): Delete. (isl_id_for_dr): Remove unused param. (parameter_index_in_region_1): Remove macro usage. (set_scop_parameter_dim): Same. (add_param_constraints): Same. (add_conditions_to_constraints): Same (build_scop_iteration_domain): Same. (pdr_add_alias_set): Comment. (add_scalar_version_numbers): New. (build_poly_dr): ISL id. (build_scop_drs): Move. (build_poly_sr_1): Same. (insert_stmts): Remove. (build_poly_sr): New. (new_pbb_from_pbb): Delete. (insert_out_of_ssa_copy_on_edge): Delete. (create_zero_dim_array): Delete. (scalar_close_phi_node_p): Delete. (propagate_expr_outside_region): Delete. (rewrite_close_phi_out_of_ssa): Delete. (rewrite_phi_out_of_ssa): Delete. (rewrite_degenerate_phi): Delete. (rewrite_reductions_out_of_ssa): Delete. (rewrite_cross_bb_scalar_dependence): Delete. (handle_scalar_deps_crossing_scop_limits): (rewrite_cross_bb_scalar_deps): Delete. (build_poly_scop): Remove calls to out-of-ssa functions. * graphite.c (graphite_transform_loops): Early return in case of codegen error. * sese.c (debug_rename_map_1): Delete. (debug_rename_map): Delete. (sese_record_loop): Remove macro. (build_sese_loop_nests): Same. (new_sese_info): Same. (free_sese_info): Same. (sese_insert_phis_for_liveouts): (is_loop_closed_ssa_use): New. (number_of_phi_nodes): New. (bb_contains_loop_close_phi_nodes): New. (bb_contains_loop_phi_nodes): New. (phi_uses_name): New. (is_valid_rename): (get_rename): Add old_bb and loop_phi for more precise matching of exprs. (set_rename): Pass region. (later_of_the_two): New. (gsi_insert_earliest): New. (collect_all_ssa_names): New. (substitute_ssa_name): New. (rename_all_uses): New. (get_rename_from_scev): New. (rename_uses): Pass old_bb for more precise matching of exprs. (get_def_bb_for_const): New. (get_new_name): New. (get_loc): New. (get_edges): New. (copy_loop_phi_args): New. (copy_loop_phi_nodes): New. (get_loop_init_value): New. (find_init_value): New. (find_init_value_close_phi): New. (copy_loop_close_phi_args): New. (copy_loop_close_phi_nodes): New. (add_phi_arg_for_new_expr): New. (copy_cond_phi_args): New. (copy_cond_phi_nodes): New. (copy_phi_nodes): New. (should_copy_to_new_region): New. (set_rename_for_each_def): New. (graphite_copy_stmts_from_block): Early return in case of error. (copy_bb_and_scalar_dependences): Same. * sese.h (vec_find): New. (SESE_PARAMS): Delete. (SESE_LOOPS): Delete. (SESE_LOOP_NEST): Delete. (sese_contains_loop): Remove macro usage. (sese_nb_params): Same. (struct gimple_poly_bb): Added read_scalar_refs, write_scalar_refs. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r230200
2015-11-12 01:37:47 +01:00
isl_ast_expr *user_expr = isl_ast_node_user_get_expr (node);
isl_ast_expr *name_expr = isl_ast_expr_get_op_arg (user_expr, 0);
gcc_assert (isl_ast_expr_get_type (name_expr) == isl_ast_expr_id);
Preserve the original program while using graphite. Earlier, graphite used to translate portions of the original program after scop-detection in order to represent the SCoP into polyhedral model. This was required because each basic block was represented as independent basic block in the polyhedral model. So all the cross-basic-block dependencies were translated out-of-ssa. With this patch those dependencies are also exposed to the ISL, so there is no need to modify the original structure of the program. After this patch we should be able to enable graphite at some default optimization level. Highlights: Remove cross bb scalar to array translation For reductions, add support for more than just INT_CST Early bailout on codegen. Verify loop-closed ssa structure during copy of renames The uses of exprs should come from bb which dominates the bb Collect the init value of close phi in loop-guard Do not follow vuses for close-phi, postpone loop-close phi until the corresponding loop-phi is processed Bail out if no bb found to place cond/loop -phis Move insertion of liveouts at the end of codegen Insert loop-phis in the loop-header. This patch passes regtest and bootstrap with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' 2015-11-11 Aditya Kumar <aditya.k7@samsung.com> Sebastian Pop <s.pop@samsung.com> * graphite-isl-ast-to-gimple.c (class translate_isl_ast_to_gimple): New member codegen_error (translate_isl_ast_for_loop): Remove call to single_succ_edge and early return. (translate_isl_ast_node_user): Early return in case of error. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_to_gimple::translate_pending_phi_nodes): New. (add_parameters_to_ivs_params): Remove macro. (graphite_regenerate_ast_isl): Add if_region pointer to region. * graphite-poly.c (new_poly_dr): Remove macro. (print_pdr): Same. (new_gimple_poly_bb): Same. (free_gimple_poly_bb): Same. (print_scop_params): Same. * graphite-poly.h (struct poly_dr): Same. (struct poly_bb): Add new_bb. (gbb_from_bb): Remove dead code. (pbb_from_bb): Same. * graphite-scop-detection.c (parameter_index_in_region_1): Same. (parameter_index_in_region): Same. (find_scop_parameters): Same. (build_cross_bb_scalars_def): New. (build_cross_bb_scalars_use): New. (graphite_find_cross_bb_scalar_vars): New (try_generate_gimple_bb): Reads and Writes. (build_alias_set): Move. (gather_bbs::before_dom_children): Gather bbs visited. (build_scops): call build_alias_set. * graphite-sese-to-poly.c (phi_arg_in_outermost_loop): Delete. (remove_simple_copy_phi): Delete. (remove_invariant_phi): Delete. (simple_copy_phi_p): Delete. (reduction_phi_p): Delete. (isl_id_for_dr): Remove unused param. (parameter_index_in_region_1): Remove macro usage. (set_scop_parameter_dim): Same. (add_param_constraints): Same. (add_conditions_to_constraints): Same (build_scop_iteration_domain): Same. (pdr_add_alias_set): Comment. (add_scalar_version_numbers): New. (build_poly_dr): ISL id. (build_scop_drs): Move. (build_poly_sr_1): Same. (insert_stmts): Remove. (build_poly_sr): New. (new_pbb_from_pbb): Delete. (insert_out_of_ssa_copy_on_edge): Delete. (create_zero_dim_array): Delete. (scalar_close_phi_node_p): Delete. (propagate_expr_outside_region): Delete. (rewrite_close_phi_out_of_ssa): Delete. (rewrite_phi_out_of_ssa): Delete. (rewrite_degenerate_phi): Delete. (rewrite_reductions_out_of_ssa): Delete. (rewrite_cross_bb_scalar_dependence): Delete. (handle_scalar_deps_crossing_scop_limits): (rewrite_cross_bb_scalar_deps): Delete. (build_poly_scop): Remove calls to out-of-ssa functions. * graphite.c (graphite_transform_loops): Early return in case of codegen error. * sese.c (debug_rename_map_1): Delete. (debug_rename_map): Delete. (sese_record_loop): Remove macro. (build_sese_loop_nests): Same. (new_sese_info): Same. (free_sese_info): Same. (sese_insert_phis_for_liveouts): (is_loop_closed_ssa_use): New. (number_of_phi_nodes): New. (bb_contains_loop_close_phi_nodes): New. (bb_contains_loop_phi_nodes): New. (phi_uses_name): New. (is_valid_rename): (get_rename): Add old_bb and loop_phi for more precise matching of exprs. (set_rename): Pass region. (later_of_the_two): New. (gsi_insert_earliest): New. (collect_all_ssa_names): New. (substitute_ssa_name): New. (rename_all_uses): New. (get_rename_from_scev): New. (rename_uses): Pass old_bb for more precise matching of exprs. (get_def_bb_for_const): New. (get_new_name): New. (get_loc): New. (get_edges): New. (copy_loop_phi_args): New. (copy_loop_phi_nodes): New. (get_loop_init_value): New. (find_init_value): New. (find_init_value_close_phi): New. (copy_loop_close_phi_args): New. (copy_loop_close_phi_nodes): New. (add_phi_arg_for_new_expr): New. (copy_cond_phi_args): New. (copy_cond_phi_nodes): New. (copy_phi_nodes): New. (should_copy_to_new_region): New. (set_rename_for_each_def): New. (graphite_copy_stmts_from_block): Early return in case of error. (copy_bb_and_scalar_dependences): Same. * sese.h (vec_find): New. (SESE_PARAMS): Delete. (SESE_LOOPS): Delete. (SESE_LOOP_NEST): Delete. (sese_contains_loop): Remove macro usage. (sese_nb_params): Same. (struct gimple_poly_bb): Added read_scalar_refs, write_scalar_refs. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r230200
2015-11-12 01:37:47 +01:00
isl_id *name_id = isl_ast_expr_get_id (name_expr);
poly_bb_p pbb = (poly_bb_p) isl_id_get_user (name_id);
gcc_assert (pbb);
Preserve the original program while using graphite. Earlier, graphite used to translate portions of the original program after scop-detection in order to represent the SCoP into polyhedral model. This was required because each basic block was represented as independent basic block in the polyhedral model. So all the cross-basic-block dependencies were translated out-of-ssa. With this patch those dependencies are also exposed to the ISL, so there is no need to modify the original structure of the program. After this patch we should be able to enable graphite at some default optimization level. Highlights: Remove cross bb scalar to array translation For reductions, add support for more than just INT_CST Early bailout on codegen. Verify loop-closed ssa structure during copy of renames The uses of exprs should come from bb which dominates the bb Collect the init value of close phi in loop-guard Do not follow vuses for close-phi, postpone loop-close phi until the corresponding loop-phi is processed Bail out if no bb found to place cond/loop -phis Move insertion of liveouts at the end of codegen Insert loop-phis in the loop-header. This patch passes regtest and bootstrap with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' 2015-11-11 Aditya Kumar <aditya.k7@samsung.com> Sebastian Pop <s.pop@samsung.com> * graphite-isl-ast-to-gimple.c (class translate_isl_ast_to_gimple): New member codegen_error (translate_isl_ast_for_loop): Remove call to single_succ_edge and early return. (translate_isl_ast_node_user): Early return in case of error. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_to_gimple::translate_pending_phi_nodes): New. (add_parameters_to_ivs_params): Remove macro. (graphite_regenerate_ast_isl): Add if_region pointer to region. * graphite-poly.c (new_poly_dr): Remove macro. (print_pdr): Same. (new_gimple_poly_bb): Same. (free_gimple_poly_bb): Same. (print_scop_params): Same. * graphite-poly.h (struct poly_dr): Same. (struct poly_bb): Add new_bb. (gbb_from_bb): Remove dead code. (pbb_from_bb): Same. * graphite-scop-detection.c (parameter_index_in_region_1): Same. (parameter_index_in_region): Same. (find_scop_parameters): Same. (build_cross_bb_scalars_def): New. (build_cross_bb_scalars_use): New. (graphite_find_cross_bb_scalar_vars): New (try_generate_gimple_bb): Reads and Writes. (build_alias_set): Move. (gather_bbs::before_dom_children): Gather bbs visited. (build_scops): call build_alias_set. * graphite-sese-to-poly.c (phi_arg_in_outermost_loop): Delete. (remove_simple_copy_phi): Delete. (remove_invariant_phi): Delete. (simple_copy_phi_p): Delete. (reduction_phi_p): Delete. (isl_id_for_dr): Remove unused param. (parameter_index_in_region_1): Remove macro usage. (set_scop_parameter_dim): Same. (add_param_constraints): Same. (add_conditions_to_constraints): Same (build_scop_iteration_domain): Same. (pdr_add_alias_set): Comment. (add_scalar_version_numbers): New. (build_poly_dr): ISL id. (build_scop_drs): Move. (build_poly_sr_1): Same. (insert_stmts): Remove. (build_poly_sr): New. (new_pbb_from_pbb): Delete. (insert_out_of_ssa_copy_on_edge): Delete. (create_zero_dim_array): Delete. (scalar_close_phi_node_p): Delete. (propagate_expr_outside_region): Delete. (rewrite_close_phi_out_of_ssa): Delete. (rewrite_phi_out_of_ssa): Delete. (rewrite_degenerate_phi): Delete. (rewrite_reductions_out_of_ssa): Delete. (rewrite_cross_bb_scalar_dependence): Delete. (handle_scalar_deps_crossing_scop_limits): (rewrite_cross_bb_scalar_deps): Delete. (build_poly_scop): Remove calls to out-of-ssa functions. * graphite.c (graphite_transform_loops): Early return in case of codegen error. * sese.c (debug_rename_map_1): Delete. (debug_rename_map): Delete. (sese_record_loop): Remove macro. (build_sese_loop_nests): Same. (new_sese_info): Same. (free_sese_info): Same. (sese_insert_phis_for_liveouts): (is_loop_closed_ssa_use): New. (number_of_phi_nodes): New. (bb_contains_loop_close_phi_nodes): New. (bb_contains_loop_phi_nodes): New. (phi_uses_name): New. (is_valid_rename): (get_rename): Add old_bb and loop_phi for more precise matching of exprs. (set_rename): Pass region. (later_of_the_two): New. (gsi_insert_earliest): New. (collect_all_ssa_names): New. (substitute_ssa_name): New. (rename_all_uses): New. (get_rename_from_scev): New. (rename_uses): Pass old_bb for more precise matching of exprs. (get_def_bb_for_const): New. (get_new_name): New. (get_loc): New. (get_edges): New. (copy_loop_phi_args): New. (copy_loop_phi_nodes): New. (get_loop_init_value): New. (find_init_value): New. (find_init_value_close_phi): New. (copy_loop_close_phi_args): New. (copy_loop_close_phi_nodes): New. (add_phi_arg_for_new_expr): New. (copy_cond_phi_args): New. (copy_cond_phi_nodes): New. (copy_phi_nodes): New. (should_copy_to_new_region): New. (set_rename_for_each_def): New. (graphite_copy_stmts_from_block): Early return in case of error. (copy_bb_and_scalar_dependences): Same. * sese.h (vec_find): New. (SESE_PARAMS): Delete. (SESE_LOOPS): Delete. (SESE_LOOP_NEST): Delete. (sese_contains_loop): Remove macro usage. (sese_nb_params): Same. (struct gimple_poly_bb): Added read_scalar_refs, write_scalar_refs. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r230200
2015-11-12 01:37:47 +01:00
gimple_poly_bb_p gbb = PBB_BLACK_BOX (pbb);
Preserve the original program while using graphite. Earlier, graphite used to translate portions of the original program after scop-detection in order to represent the SCoP into polyhedral model. This was required because each basic block was represented as independent basic block in the polyhedral model. So all the cross-basic-block dependencies were translated out-of-ssa. With this patch those dependencies are also exposed to the ISL, so there is no need to modify the original structure of the program. After this patch we should be able to enable graphite at some default optimization level. Highlights: Remove cross bb scalar to array translation For reductions, add support for more than just INT_CST Early bailout on codegen. Verify loop-closed ssa structure during copy of renames The uses of exprs should come from bb which dominates the bb Collect the init value of close phi in loop-guard Do not follow vuses for close-phi, postpone loop-close phi until the corresponding loop-phi is processed Bail out if no bb found to place cond/loop -phis Move insertion of liveouts at the end of codegen Insert loop-phis in the loop-header. This patch passes regtest and bootstrap with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' 2015-11-11 Aditya Kumar <aditya.k7@samsung.com> Sebastian Pop <s.pop@samsung.com> * graphite-isl-ast-to-gimple.c (class translate_isl_ast_to_gimple): New member codegen_error (translate_isl_ast_for_loop): Remove call to single_succ_edge and early return. (translate_isl_ast_node_user): Early return in case of error. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_to_gimple::translate_pending_phi_nodes): New. (add_parameters_to_ivs_params): Remove macro. (graphite_regenerate_ast_isl): Add if_region pointer to region. * graphite-poly.c (new_poly_dr): Remove macro. (print_pdr): Same. (new_gimple_poly_bb): Same. (free_gimple_poly_bb): Same. (print_scop_params): Same. * graphite-poly.h (struct poly_dr): Same. (struct poly_bb): Add new_bb. (gbb_from_bb): Remove dead code. (pbb_from_bb): Same. * graphite-scop-detection.c (parameter_index_in_region_1): Same. (parameter_index_in_region): Same. (find_scop_parameters): Same. (build_cross_bb_scalars_def): New. (build_cross_bb_scalars_use): New. (graphite_find_cross_bb_scalar_vars): New (try_generate_gimple_bb): Reads and Writes. (build_alias_set): Move. (gather_bbs::before_dom_children): Gather bbs visited. (build_scops): call build_alias_set. * graphite-sese-to-poly.c (phi_arg_in_outermost_loop): Delete. (remove_simple_copy_phi): Delete. (remove_invariant_phi): Delete. (simple_copy_phi_p): Delete. (reduction_phi_p): Delete. (isl_id_for_dr): Remove unused param. (parameter_index_in_region_1): Remove macro usage. (set_scop_parameter_dim): Same. (add_param_constraints): Same. (add_conditions_to_constraints): Same (build_scop_iteration_domain): Same. (pdr_add_alias_set): Comment. (add_scalar_version_numbers): New. (build_poly_dr): ISL id. (build_scop_drs): Move. (build_poly_sr_1): Same. (insert_stmts): Remove. (build_poly_sr): New. (new_pbb_from_pbb): Delete. (insert_out_of_ssa_copy_on_edge): Delete. (create_zero_dim_array): Delete. (scalar_close_phi_node_p): Delete. (propagate_expr_outside_region): Delete. (rewrite_close_phi_out_of_ssa): Delete. (rewrite_phi_out_of_ssa): Delete. (rewrite_degenerate_phi): Delete. (rewrite_reductions_out_of_ssa): Delete. (rewrite_cross_bb_scalar_dependence): Delete. (handle_scalar_deps_crossing_scop_limits): (rewrite_cross_bb_scalar_deps): Delete. (build_poly_scop): Remove calls to out-of-ssa functions. * graphite.c (graphite_transform_loops): Early return in case of codegen error. * sese.c (debug_rename_map_1): Delete. (debug_rename_map): Delete. (sese_record_loop): Remove macro. (build_sese_loop_nests): Same. (new_sese_info): Same. (free_sese_info): Same. (sese_insert_phis_for_liveouts): (is_loop_closed_ssa_use): New. (number_of_phi_nodes): New. (bb_contains_loop_close_phi_nodes): New. (bb_contains_loop_phi_nodes): New. (phi_uses_name): New. (is_valid_rename): (get_rename): Add old_bb and loop_phi for more precise matching of exprs. (set_rename): Pass region. (later_of_the_two): New. (gsi_insert_earliest): New. (collect_all_ssa_names): New. (substitute_ssa_name): New. (rename_all_uses): New. (get_rename_from_scev): New. (rename_uses): Pass old_bb for more precise matching of exprs. (get_def_bb_for_const): New. (get_new_name): New. (get_loc): New. (get_edges): New. (copy_loop_phi_args): New. (copy_loop_phi_nodes): New. (get_loop_init_value): New. (find_init_value): New. (find_init_value_close_phi): New. (copy_loop_close_phi_args): New. (copy_loop_close_phi_nodes): New. (add_phi_arg_for_new_expr): New. (copy_cond_phi_args): New. (copy_cond_phi_nodes): New. (copy_phi_nodes): New. (should_copy_to_new_region): New. (set_rename_for_each_def): New. (graphite_copy_stmts_from_block): Early return in case of error. (copy_bb_and_scalar_dependences): Same. * sese.h (vec_find): New. (SESE_PARAMS): Delete. (SESE_LOOPS): Delete. (SESE_LOOP_NEST): Delete. (sese_contains_loop): Remove macro usage. (sese_nb_params): Same. (struct gimple_poly_bb): Added read_scalar_refs, write_scalar_refs. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r230200
2015-11-12 01:37:47 +01:00
isl_ast_expr_free (name_expr);
isl_id_free (name_id);
gcc_assert (GBB_BB (gbb) != ENTRY_BLOCK_PTR_FOR_FN (cfun) &&
"The entry block should not even appear within a scop");
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
const int nb_loops = number_of_loops (cfun);
Preserve the original program while using graphite. Earlier, graphite used to translate portions of the original program after scop-detection in order to represent the SCoP into polyhedral model. This was required because each basic block was represented as independent basic block in the polyhedral model. So all the cross-basic-block dependencies were translated out-of-ssa. With this patch those dependencies are also exposed to the ISL, so there is no need to modify the original structure of the program. After this patch we should be able to enable graphite at some default optimization level. Highlights: Remove cross bb scalar to array translation For reductions, add support for more than just INT_CST Early bailout on codegen. Verify loop-closed ssa structure during copy of renames The uses of exprs should come from bb which dominates the bb Collect the init value of close phi in loop-guard Do not follow vuses for close-phi, postpone loop-close phi until the corresponding loop-phi is processed Bail out if no bb found to place cond/loop -phis Move insertion of liveouts at the end of codegen Insert loop-phis in the loop-header. This patch passes regtest and bootstrap with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' 2015-11-11 Aditya Kumar <aditya.k7@samsung.com> Sebastian Pop <s.pop@samsung.com> * graphite-isl-ast-to-gimple.c (class translate_isl_ast_to_gimple): New member codegen_error (translate_isl_ast_for_loop): Remove call to single_succ_edge and early return. (translate_isl_ast_node_user): Early return in case of error. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_to_gimple::translate_pending_phi_nodes): New. (add_parameters_to_ivs_params): Remove macro. (graphite_regenerate_ast_isl): Add if_region pointer to region. * graphite-poly.c (new_poly_dr): Remove macro. (print_pdr): Same. (new_gimple_poly_bb): Same. (free_gimple_poly_bb): Same. (print_scop_params): Same. * graphite-poly.h (struct poly_dr): Same. (struct poly_bb): Add new_bb. (gbb_from_bb): Remove dead code. (pbb_from_bb): Same. * graphite-scop-detection.c (parameter_index_in_region_1): Same. (parameter_index_in_region): Same. (find_scop_parameters): Same. (build_cross_bb_scalars_def): New. (build_cross_bb_scalars_use): New. (graphite_find_cross_bb_scalar_vars): New (try_generate_gimple_bb): Reads and Writes. (build_alias_set): Move. (gather_bbs::before_dom_children): Gather bbs visited. (build_scops): call build_alias_set. * graphite-sese-to-poly.c (phi_arg_in_outermost_loop): Delete. (remove_simple_copy_phi): Delete. (remove_invariant_phi): Delete. (simple_copy_phi_p): Delete. (reduction_phi_p): Delete. (isl_id_for_dr): Remove unused param. (parameter_index_in_region_1): Remove macro usage. (set_scop_parameter_dim): Same. (add_param_constraints): Same. (add_conditions_to_constraints): Same (build_scop_iteration_domain): Same. (pdr_add_alias_set): Comment. (add_scalar_version_numbers): New. (build_poly_dr): ISL id. (build_scop_drs): Move. (build_poly_sr_1): Same. (insert_stmts): Remove. (build_poly_sr): New. (new_pbb_from_pbb): Delete. (insert_out_of_ssa_copy_on_edge): Delete. (create_zero_dim_array): Delete. (scalar_close_phi_node_p): Delete. (propagate_expr_outside_region): Delete. (rewrite_close_phi_out_of_ssa): Delete. (rewrite_phi_out_of_ssa): Delete. (rewrite_degenerate_phi): Delete. (rewrite_reductions_out_of_ssa): Delete. (rewrite_cross_bb_scalar_dependence): Delete. (handle_scalar_deps_crossing_scop_limits): (rewrite_cross_bb_scalar_deps): Delete. (build_poly_scop): Remove calls to out-of-ssa functions. * graphite.c (graphite_transform_loops): Early return in case of codegen error. * sese.c (debug_rename_map_1): Delete. (debug_rename_map): Delete. (sese_record_loop): Remove macro. (build_sese_loop_nests): Same. (new_sese_info): Same. (free_sese_info): Same. (sese_insert_phis_for_liveouts): (is_loop_closed_ssa_use): New. (number_of_phi_nodes): New. (bb_contains_loop_close_phi_nodes): New. (bb_contains_loop_phi_nodes): New. (phi_uses_name): New. (is_valid_rename): (get_rename): Add old_bb and loop_phi for more precise matching of exprs. (set_rename): Pass region. (later_of_the_two): New. (gsi_insert_earliest): New. (collect_all_ssa_names): New. (substitute_ssa_name): New. (rename_all_uses): New. (get_rename_from_scev): New. (rename_uses): Pass old_bb for more precise matching of exprs. (get_def_bb_for_const): New. (get_new_name): New. (get_loc): New. (get_edges): New. (copy_loop_phi_args): New. (copy_loop_phi_nodes): New. (get_loop_init_value): New. (find_init_value): New. (find_init_value_close_phi): New. (copy_loop_close_phi_args): New. (copy_loop_close_phi_nodes): New. (add_phi_arg_for_new_expr): New. (copy_cond_phi_args): New. (copy_cond_phi_nodes): New. (copy_phi_nodes): New. (should_copy_to_new_region): New. (set_rename_for_each_def): New. (graphite_copy_stmts_from_block): Early return in case of error. (copy_bb_and_scalar_dependences): Same. * sese.h (vec_find): New. (SESE_PARAMS): Delete. (SESE_LOOPS): Delete. (SESE_LOOP_NEST): Delete. (sese_contains_loop): Remove macro usage. (sese_nb_params): Same. (struct gimple_poly_bb): Added read_scalar_refs, write_scalar_refs. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r230200
2015-11-12 01:37:47 +01:00
vec<tree> iv_map;
iv_map.create (nb_loops);
iv_map.safe_grow_cleared (nb_loops);
Refactoring sese.h and graphite-poly.h Rename scop->region to scop->scop_info Removed conversion constructors for sese_l and dr_info. Removed macros. No functional changed intended. Passes regtest and bootstrap. gcc/ChangeLog: 2015-19-10 Aditya Kumar <aditya.k7@samsung.com> * graphite-poly.h (struct dr_info): Removed conversion constructor. (struct scop): Renamed scop::region to scop::scop_info (scop_set_region): Same. (SCOP_REGION): Removed (SCOP_CONTEXT): Removed. (POLY_SCOP_P): Removed. * graphite-isl-ast-to-gimple.c (translate_isl_ast_node_user): Rename scop->region to scop->scop_info. (add_parameters_to_ivs_params): Same. (graphite_regenerate_ast_isl): Same. * graphite-poly.c (new_scop): Same. (free_scop): Same. (print_scop_params): Same. * graphite-scop-detection.c (scop_detection::remove_subscops): Same. (scop_detection::remove_intersecting_scops): Use pointer to sese_l. (dot_all_scops_1): Rename scop->region to scop->scop_info. (scop_detection::nb_pbbs_in_loops): Same. (find_scop_parameters): Same. (try_generate_gimple_bb): Same. (gather_bbs::before_dom_children): Same. (gather_bbs::after_dom_children): Same. (build_scops): Same. * graphite-sese-to-poly.c (build_scop_scattering): Same. (extract_affine_chrec): Same. (extract_affine): Same. (set_scop_parameter_dim): Same. (build_loop_iteration_domains): Same. (create_pw_aff_from_tree): Same. (add_param_constraints): Same. (build_scop_iteration_domain): Same. (build_scop_drs): Same. (analyze_drs_in_stmts): Same. (insert_out_of_ssa_copy_on_edge): Same. (rewrite_close_phi_out_of_ssa):Same. (rewrite_reductions_out_of_ssa):Same. (handle_scalar_deps_crossing_scop_limits):Same. (rewrite_cross_bb_scalar_deps):Same. (rewrite_cross_bb_scalar_deps_out_of_ssa):Same. (build_poly_scop):Same. (build_alias_set): Use pointer to dr_info. * graphite.c (print_graphite_scop_statistics): (graphite_transform_loops): * sese.h (struct sese_l): Remove conversion constructor. From-SVN: r229135
2015-10-21 20:53:17 +02:00
build_iv_mapping (iv_map, gbb, user_expr, ip, pbb->scop->scop_info->region);
isl_ast_expr_free (user_expr);
basic_block old_bb = GBB_BB (gbb);
if (dump_file)
{
fprintf (dump_file,
"[codegen] copying from bb_%d on edge (bb_%d, bb_%d)\n",
old_bb->index, next_e->src->index, next_e->dest->index);
print_loops_bb (dump_file, GBB_BB (gbb), 0, 3);
}
next_e = copy_bb_and_scalar_dependences (old_bb, next_e, iv_map);
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
iv_map.release ();
if (codegen_error_p ())
Preserve the original program while using graphite. Earlier, graphite used to translate portions of the original program after scop-detection in order to represent the SCoP into polyhedral model. This was required because each basic block was represented as independent basic block in the polyhedral model. So all the cross-basic-block dependencies were translated out-of-ssa. With this patch those dependencies are also exposed to the ISL, so there is no need to modify the original structure of the program. After this patch we should be able to enable graphite at some default optimization level. Highlights: Remove cross bb scalar to array translation For reductions, add support for more than just INT_CST Early bailout on codegen. Verify loop-closed ssa structure during copy of renames The uses of exprs should come from bb which dominates the bb Collect the init value of close phi in loop-guard Do not follow vuses for close-phi, postpone loop-close phi until the corresponding loop-phi is processed Bail out if no bb found to place cond/loop -phis Move insertion of liveouts at the end of codegen Insert loop-phis in the loop-header. This patch passes regtest and bootstrap with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' 2015-11-11 Aditya Kumar <aditya.k7@samsung.com> Sebastian Pop <s.pop@samsung.com> * graphite-isl-ast-to-gimple.c (class translate_isl_ast_to_gimple): New member codegen_error (translate_isl_ast_for_loop): Remove call to single_succ_edge and early return. (translate_isl_ast_node_user): Early return in case of error. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_to_gimple::translate_pending_phi_nodes): New. (add_parameters_to_ivs_params): Remove macro. (graphite_regenerate_ast_isl): Add if_region pointer to region. * graphite-poly.c (new_poly_dr): Remove macro. (print_pdr): Same. (new_gimple_poly_bb): Same. (free_gimple_poly_bb): Same. (print_scop_params): Same. * graphite-poly.h (struct poly_dr): Same. (struct poly_bb): Add new_bb. (gbb_from_bb): Remove dead code. (pbb_from_bb): Same. * graphite-scop-detection.c (parameter_index_in_region_1): Same. (parameter_index_in_region): Same. (find_scop_parameters): Same. (build_cross_bb_scalars_def): New. (build_cross_bb_scalars_use): New. (graphite_find_cross_bb_scalar_vars): New (try_generate_gimple_bb): Reads and Writes. (build_alias_set): Move. (gather_bbs::before_dom_children): Gather bbs visited. (build_scops): call build_alias_set. * graphite-sese-to-poly.c (phi_arg_in_outermost_loop): Delete. (remove_simple_copy_phi): Delete. (remove_invariant_phi): Delete. (simple_copy_phi_p): Delete. (reduction_phi_p): Delete. (isl_id_for_dr): Remove unused param. (parameter_index_in_region_1): Remove macro usage. (set_scop_parameter_dim): Same. (add_param_constraints): Same. (add_conditions_to_constraints): Same (build_scop_iteration_domain): Same. (pdr_add_alias_set): Comment. (add_scalar_version_numbers): New. (build_poly_dr): ISL id. (build_scop_drs): Move. (build_poly_sr_1): Same. (insert_stmts): Remove. (build_poly_sr): New. (new_pbb_from_pbb): Delete. (insert_out_of_ssa_copy_on_edge): Delete. (create_zero_dim_array): Delete. (scalar_close_phi_node_p): Delete. (propagate_expr_outside_region): Delete. (rewrite_close_phi_out_of_ssa): Delete. (rewrite_phi_out_of_ssa): Delete. (rewrite_degenerate_phi): Delete. (rewrite_reductions_out_of_ssa): Delete. (rewrite_cross_bb_scalar_dependence): Delete. (handle_scalar_deps_crossing_scop_limits): (rewrite_cross_bb_scalar_deps): Delete. (build_poly_scop): Remove calls to out-of-ssa functions. * graphite.c (graphite_transform_loops): Early return in case of codegen error. * sese.c (debug_rename_map_1): Delete. (debug_rename_map): Delete. (sese_record_loop): Remove macro. (build_sese_loop_nests): Same. (new_sese_info): Same. (free_sese_info): Same. (sese_insert_phis_for_liveouts): (is_loop_closed_ssa_use): New. (number_of_phi_nodes): New. (bb_contains_loop_close_phi_nodes): New. (bb_contains_loop_phi_nodes): New. (phi_uses_name): New. (is_valid_rename): (get_rename): Add old_bb and loop_phi for more precise matching of exprs. (set_rename): Pass region. (later_of_the_two): New. (gsi_insert_earliest): New. (collect_all_ssa_names): New. (substitute_ssa_name): New. (rename_all_uses): New. (get_rename_from_scev): New. (rename_uses): Pass old_bb for more precise matching of exprs. (get_def_bb_for_const): New. (get_new_name): New. (get_loc): New. (get_edges): New. (copy_loop_phi_args): New. (copy_loop_phi_nodes): New. (get_loop_init_value): New. (find_init_value): New. (find_init_value_close_phi): New. (copy_loop_close_phi_args): New. (copy_loop_close_phi_nodes): New. (add_phi_arg_for_new_expr): New. (copy_cond_phi_args): New. (copy_cond_phi_nodes): New. (copy_phi_nodes): New. (should_copy_to_new_region): New. (set_rename_for_each_def): New. (graphite_copy_stmts_from_block): Early return in case of error. (copy_bb_and_scalar_dependences): Same. * sese.h (vec_find): New. (SESE_PARAMS): Delete. (SESE_LOOPS): Delete. (SESE_LOOP_NEST): Delete. (sese_contains_loop): Remove macro usage. (sese_nb_params): Same. (struct gimple_poly_bb): Added read_scalar_refs, write_scalar_refs. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r230200
2015-11-12 01:37:47 +01:00
return NULL;
if (dump_file)
{
fprintf (dump_file, "[codegen] (after copy) new basic block\n");
print_loops_bb (dump_file, next_e->src, 0, 3);
}
return next_e;
}
/* Translates an isl_ast_node_block to Gimple. */
edge translate_isl_ast_to_gimple::
translate_isl_ast_node_block (loop_p context_loop,
__isl_keep isl_ast_node *node,
edge next_e, ivs_params &ip)
{
gcc_assert (isl_ast_node_get_type (node) == isl_ast_node_block);
isl_ast_node_list *node_list = isl_ast_node_block_get_children (node);
int i;
for (i = 0; i < isl_ast_node_list_n_ast_node (node_list); i++)
{
isl_ast_node *tmp_node = isl_ast_node_list_get_ast_node (node_list, i);
next_e = translate_isl_ast (context_loop, tmp_node, next_e, ip);
isl_ast_node_free (tmp_node);
}
isl_ast_node_list_free (node_list);
return next_e;
}
2015-12-17 19:50:05 +01:00
/* Creates a new if region corresponding to isl's cond. */
edge translate_isl_ast_to_gimple::
graphite_create_new_guard (edge entry_edge, __isl_take isl_ast_expr *if_cond,
ivs_params &ip)
{
tree type =
build_nonstandard_integer_type (graphite_expression_type_precision, 0);
tree cond_expr = gcc_expression_from_isl_expression (type, if_cond, ip);
/* To fail code generation, we generate wrong code until we discard it. */
if (codegen_error_p ())
cond_expr = integer_zero_node;
edge exit_edge = create_empty_if_region_on_edge (entry_edge, cond_expr);
return exit_edge;
}
/* Translates an isl_ast_node_if to Gimple. */
edge translate_isl_ast_to_gimple::
translate_isl_ast_node_if (loop_p context_loop,
__isl_keep isl_ast_node *node,
edge next_e, ivs_params &ip)
{
gcc_assert (isl_ast_node_get_type (node) == isl_ast_node_if);
isl_ast_expr *if_cond = isl_ast_node_if_get_cond (node);
edge last_e = graphite_create_new_guard (next_e, if_cond, ip);
edge true_e = get_true_edge_from_guard_bb (next_e->dest);
merge_points.safe_push (last_e);
isl_ast_node *then_node = isl_ast_node_if_get_then (node);
translate_isl_ast (context_loop, then_node, true_e, ip);
isl_ast_node_free (then_node);
edge false_e = get_false_edge_from_guard_bb (next_e->dest);
isl_ast_node *else_node = isl_ast_node_if_get_else (node);
if (isl_ast_node_get_type (else_node) != isl_ast_node_error)
translate_isl_ast (context_loop, else_node, false_e, ip);
isl_ast_node_free (else_node);
return last_e;
}
2015-12-17 19:50:05 +01:00
/* Translates an isl AST node NODE to GCC representation in the
context of a SESE. */
edge translate_isl_ast_to_gimple::
translate_isl_ast (loop_p context_loop, __isl_keep isl_ast_node *node,
edge next_e, ivs_params &ip)
{
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
if (codegen_error_p ())
Preserve the original program while using graphite. Earlier, graphite used to translate portions of the original program after scop-detection in order to represent the SCoP into polyhedral model. This was required because each basic block was represented as independent basic block in the polyhedral model. So all the cross-basic-block dependencies were translated out-of-ssa. With this patch those dependencies are also exposed to the ISL, so there is no need to modify the original structure of the program. After this patch we should be able to enable graphite at some default optimization level. Highlights: Remove cross bb scalar to array translation For reductions, add support for more than just INT_CST Early bailout on codegen. Verify loop-closed ssa structure during copy of renames The uses of exprs should come from bb which dominates the bb Collect the init value of close phi in loop-guard Do not follow vuses for close-phi, postpone loop-close phi until the corresponding loop-phi is processed Bail out if no bb found to place cond/loop -phis Move insertion of liveouts at the end of codegen Insert loop-phis in the loop-header. This patch passes regtest and bootstrap with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' 2015-11-11 Aditya Kumar <aditya.k7@samsung.com> Sebastian Pop <s.pop@samsung.com> * graphite-isl-ast-to-gimple.c (class translate_isl_ast_to_gimple): New member codegen_error (translate_isl_ast_for_loop): Remove call to single_succ_edge and early return. (translate_isl_ast_node_user): Early return in case of error. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_to_gimple::translate_pending_phi_nodes): New. (add_parameters_to_ivs_params): Remove macro. (graphite_regenerate_ast_isl): Add if_region pointer to region. * graphite-poly.c (new_poly_dr): Remove macro. (print_pdr): Same. (new_gimple_poly_bb): Same. (free_gimple_poly_bb): Same. (print_scop_params): Same. * graphite-poly.h (struct poly_dr): Same. (struct poly_bb): Add new_bb. (gbb_from_bb): Remove dead code. (pbb_from_bb): Same. * graphite-scop-detection.c (parameter_index_in_region_1): Same. (parameter_index_in_region): Same. (find_scop_parameters): Same. (build_cross_bb_scalars_def): New. (build_cross_bb_scalars_use): New. (graphite_find_cross_bb_scalar_vars): New (try_generate_gimple_bb): Reads and Writes. (build_alias_set): Move. (gather_bbs::before_dom_children): Gather bbs visited. (build_scops): call build_alias_set. * graphite-sese-to-poly.c (phi_arg_in_outermost_loop): Delete. (remove_simple_copy_phi): Delete. (remove_invariant_phi): Delete. (simple_copy_phi_p): Delete. (reduction_phi_p): Delete. (isl_id_for_dr): Remove unused param. (parameter_index_in_region_1): Remove macro usage. (set_scop_parameter_dim): Same. (add_param_constraints): Same. (add_conditions_to_constraints): Same (build_scop_iteration_domain): Same. (pdr_add_alias_set): Comment. (add_scalar_version_numbers): New. (build_poly_dr): ISL id. (build_scop_drs): Move. (build_poly_sr_1): Same. (insert_stmts): Remove. (build_poly_sr): New. (new_pbb_from_pbb): Delete. (insert_out_of_ssa_copy_on_edge): Delete. (create_zero_dim_array): Delete. (scalar_close_phi_node_p): Delete. (propagate_expr_outside_region): Delete. (rewrite_close_phi_out_of_ssa): Delete. (rewrite_phi_out_of_ssa): Delete. (rewrite_degenerate_phi): Delete. (rewrite_reductions_out_of_ssa): Delete. (rewrite_cross_bb_scalar_dependence): Delete. (handle_scalar_deps_crossing_scop_limits): (rewrite_cross_bb_scalar_deps): Delete. (build_poly_scop): Remove calls to out-of-ssa functions. * graphite.c (graphite_transform_loops): Early return in case of codegen error. * sese.c (debug_rename_map_1): Delete. (debug_rename_map): Delete. (sese_record_loop): Remove macro. (build_sese_loop_nests): Same. (new_sese_info): Same. (free_sese_info): Same. (sese_insert_phis_for_liveouts): (is_loop_closed_ssa_use): New. (number_of_phi_nodes): New. (bb_contains_loop_close_phi_nodes): New. (bb_contains_loop_phi_nodes): New. (phi_uses_name): New. (is_valid_rename): (get_rename): Add old_bb and loop_phi for more precise matching of exprs. (set_rename): Pass region. (later_of_the_two): New. (gsi_insert_earliest): New. (collect_all_ssa_names): New. (substitute_ssa_name): New. (rename_all_uses): New. (get_rename_from_scev): New. (rename_uses): Pass old_bb for more precise matching of exprs. (get_def_bb_for_const): New. (get_new_name): New. (get_loc): New. (get_edges): New. (copy_loop_phi_args): New. (copy_loop_phi_nodes): New. (get_loop_init_value): New. (find_init_value): New. (find_init_value_close_phi): New. (copy_loop_close_phi_args): New. (copy_loop_close_phi_nodes): New. (add_phi_arg_for_new_expr): New. (copy_cond_phi_args): New. (copy_cond_phi_nodes): New. (copy_phi_nodes): New. (should_copy_to_new_region): New. (set_rename_for_each_def): New. (graphite_copy_stmts_from_block): Early return in case of error. (copy_bb_and_scalar_dependences): Same. * sese.h (vec_find): New. (SESE_PARAMS): Delete. (SESE_LOOPS): Delete. (SESE_LOOP_NEST): Delete. (sese_contains_loop): Remove macro usage. (sese_nb_params): Same. (struct gimple_poly_bb): Added read_scalar_refs, write_scalar_refs. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r230200
2015-11-12 01:37:47 +01:00
return NULL;
switch (isl_ast_node_get_type (node))
{
case isl_ast_node_error:
gcc_unreachable ();
case isl_ast_node_for:
return translate_isl_ast_node_for (context_loop, node,
next_e, ip);
case isl_ast_node_if:
return translate_isl_ast_node_if (context_loop, node,
next_e, ip);
case isl_ast_node_user:
return translate_isl_ast_node_user (node, next_e, ip);
case isl_ast_node_block:
return translate_isl_ast_node_block (context_loop, node,
next_e, ip);
#ifdef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
case isl_ast_node_mark:
{
isl_ast_node *n = isl_ast_node_mark_get_node (node);
edge e = translate_isl_ast (context_loop, n, next_e, ip);
isl_ast_node_free (n);
return e;
}
#endif
default:
gcc_unreachable ();
}
}
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
/* Return true when BB contains loop close phi nodes. A loop close phi node is
at the exit of loop which takes one argument that is the last value of the
variable being used out of the loop. */
static bool
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
bb_contains_loop_close_phi_nodes (basic_block bb)
{
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
return single_pred_p (bb)
&& bb->loop_father != single_pred_edge (bb)->src->loop_father;
}
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
/* Return true when BB contains loop phi nodes. A loop phi node is the loop
header containing phi nodes which has one init-edge and one back-edge. */
static bool
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
bb_contains_loop_phi_nodes (basic_block bb)
{
if (EDGE_COUNT (bb->preds) != 2)
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
return false;
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
unsigned depth = loop_depth (bb->loop_father);
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
edge preds[2] = { (*bb->preds)[0], (*bb->preds)[1] };
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
if (depth > loop_depth (preds[0]->src->loop_father)
|| depth > loop_depth (preds[1]->src->loop_father))
return true;
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
/* When one of the edges correspond to the same loop father and other
doesn't. */
if (bb->loop_father != preds[0]->src->loop_father
&& bb->loop_father == preds[1]->src->loop_father)
return true;
if (bb->loop_father != preds[1]->src->loop_father
&& bb->loop_father == preds[0]->src->loop_father)
return true;
return false;
}
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
/* Check if USE is defined in a basic block from where the definition of USE can
propagate from all the paths. FIXME: Verify checks for virtual operands. */
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
static bool
is_loop_closed_ssa_use (basic_block bb, tree use)
{
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
if (TREE_CODE (use) != SSA_NAME || virtual_operand_p (use))
return true;
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
/* For close-phi nodes def always comes from a loop which has a back-edge. */
if (bb_contains_loop_close_phi_nodes (bb))
return true;
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
gimple *def = SSA_NAME_DEF_STMT (use);
basic_block def_bb = gimple_bb (def);
return (!def_bb
|| flow_bb_inside_loop_p (def_bb->loop_father, bb));
}
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
/* Return the number of phi nodes in BB. */
static int
number_of_phi_nodes (basic_block bb)
{
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
int num_phis = 0;
for (gphi_iterator psi = gsi_start_phis (bb); !gsi_end_p (psi);
gsi_next (&psi))
num_phis++;
return num_phis;
}
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
/* Returns true if BB uses name in one of its PHIs. */
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
static bool
phi_uses_name (basic_block bb, tree name)
{
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
for (gphi_iterator psi = gsi_start_phis (bb); !gsi_end_p (psi);
gsi_next (&psi))
{
gphi *phi = psi.phi ();
for (unsigned i = 0; i < gimple_phi_num_args (phi); i++)
{
tree use_arg = gimple_phi_arg_def (phi, i);
if (use_arg == name)
return true;
}
}
return false;
}
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
/* Return true if RENAME (defined in BB) is a valid use in NEW_BB. The
definition should flow into use, and the use should respect the loop-closed
SSA form. */
bool translate_isl_ast_to_gimple::
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
is_valid_rename (tree rename, basic_block def_bb, basic_block use_bb,
phi_node_kind phi_kind, tree old_name, basic_block old_bb) const
{
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
/* The def of the rename must either dominate the uses or come from a
back-edge. Also the def must respect the loop closed ssa form. */
if (!is_loop_closed_ssa_use (use_bb, rename))
{
if (dump_file)
{
new scop schedule for isl-0.15 Keep unchanged the implementation for isl-0.14. * graphite-poly.c (apply_poly_transforms): Simplify. (print_isl_set): Use more readable format: ISL_YAML_STYLE_BLOCK. (print_isl_map): Same. (print_isl_union_map): Same. (print_isl_schedule): New. (debug_isl_schedule): New. * graphite-dependences.c (scop_get_reads): Do not call isl_union_map_add_map that is undocumented isl functionality. (scop_get_must_writes): Same. (scop_get_may_writes): Same. (scop_get_original_schedule): Remove. (scop_get_dependences): Do not call isl_union_map_compute_flow that is deprecated in isl 0.15. Instead, use isl_union_access_* interface. (compute_deps): Remove. * graphite-isl-ast-to-gimple.c (print_schedule_ast): New. (debug_schedule_ast): New. (translate_isl_ast_to_gimple::scop_to_isl_ast): Call set_separate_option. (graphite_regenerate_ast_isl): Add dump. (translate_isl_ast_to_gimple::scop_to_isl_ast): Generate code from scop->transformed_schedule. (graphite_regenerate_ast_isl): Add more dump. * graphite-optimize-isl.c (optimize_isl): Set scop->transformed_schedule. Check whether schedules are equal. (apply_poly_transforms): Move here. * graphite-poly.c (apply_poly_transforms): ... from here. (free_poly_bb): Static. (free_scop): Static. (pbb_number_of_iterations_at_time): Remove. (print_isl_ast): New. (debug_isl_ast): New. (debug_scop_pbb): New. * graphite-scop-detection.c (print_edge): Move. (print_sese): Move. * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons): Remove. (build_scop_scattering): Remove. (create_pw_aff_from_tree): Assert instead of bailing out. (add_condition_to_pbb): Remove unused code, do not fail. (add_conditions_to_domain): Same. (add_conditions_to_constraints): Remove. (build_scop_context): New. (add_iter_domain_dimension): New. (build_iteration_domains): Initialize pbb->iterators. Call add_conditions_to_domain. (nested_in): New. (loop_at): New. (index_outermost_in_loop): New. (index_pbb_in_loop): New. (outermost_pbb_in): New. (add_in_sequence): New. (add_outer_projection): New. (outer_projection_mupa): New. (add_loop_schedule): New. (build_schedule_pbb): New. (build_schedule_loop): New. (embed_in_surrounding_loops): New. (build_schedule_loop_nest): New. (build_original_schedule): New. (build_poly_scop): Call build_original_schedule. * graphite.h: Declare print_isl_schedule and debug_isl_schedule. (free_poly_dr): Remove. (struct poly_bb): Add iterators. Remove schedule, transformed, saved. (free_poly_bb): Remove. (debug_loop_vec): Remove. (print_isl_ast): Declare. (debug_isl_ast): Declare. (scop_do_interchange): Remove. (scop_do_strip_mine): Remove. (scop_do_block): Remove. (flatten_all_loops): Remove. (optimize_isl): Remove. (pbb_number_of_iterations_at_time): Remove. (debug_scop_pbb): Declare. (print_schedule_ast): Declare. (debug_schedule_ast): Declare. (struct scop): Remove schedule. Add original_schedule, transformed_schedule. (free_gimple_poly_bb): Remove. (print_generated_program): Remove. (debug_generated_program): Remove. (unify_scattering_dimensions): Remove. * sese.c (print_edge): ... here. (print_sese): ... here. (debug_edge): ... here. (debug_sese): ... here. * sese.h (print_edge): Declare. (print_sese): Declare. (dump_edge): Declare. (dump_sese): Declare. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r232812
2016-01-26 01:19:20 +01:00
fprintf (dump_file, "[codegen] rename not in loop closed ssa: ");
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
print_generic_expr (dump_file, rename, 0);
fprintf (dump_file, "\n");
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
}
return false;
}
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
if (dominated_by_p (CDI_DOMINATORS, use_bb, def_bb))
return true;
if (bb_contains_loop_phi_nodes (use_bb) && phi_kind == loop_phi)
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
{
/* The loop-header dominates the loop-body. */
if (!dominated_by_p (CDI_DOMINATORS, def_bb, use_bb))
return false;
/* RENAME would be used in loop-phi. */
gcc_assert (number_of_phi_nodes (use_bb));
/* For definitions coming from back edges, we should check that
old_name is used in a loop PHI node.
FIXME: Verify if this is true. */
if (phi_uses_name (old_bb, old_name))
return true;
}
return false;
}
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
/* Returns the expression associated to OLD_NAME (which is used in OLD_BB), in
NEW_BB from RENAME_MAP. PHI_KIND determines the kind of phi node. */
tree translate_isl_ast_to_gimple::
get_rename (basic_block new_bb, tree old_name, basic_block old_bb,
phi_node_kind phi_kind) const
{
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
gcc_assert (TREE_CODE (old_name) == SSA_NAME);
vec <tree> *renames = region->rename_map->get (old_name);
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
if (!renames || renames->is_empty ())
return NULL_TREE;
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
if (1 == renames->length ())
{
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
tree rename = (*renames)[0];
if (TREE_CODE (rename) == SSA_NAME)
{
basic_block bb = gimple_bb (SSA_NAME_DEF_STMT (rename));
if (is_valid_rename (rename, bb, new_bb, phi_kind, old_name, old_bb)
&& (phi_kind == close_phi
|| flow_bb_inside_loop_p (bb->loop_father, new_bb)))
return rename;
return NULL_TREE;
}
if (is_constant (rename))
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
return rename;
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
return NULL_TREE;
}
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
/* More than one renames corresponding to the old_name. Find the rename for
which the definition flows into usage at new_bb. */
int i;
tree t1 = NULL_TREE, t2;
basic_block t1_bb = NULL;
FOR_EACH_VEC_ELT (*renames, i, t2)
{
basic_block t2_bb = gimple_bb (SSA_NAME_DEF_STMT (t2));
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
/* Defined in the same basic block as used. */
if (t2_bb == new_bb)
return t2;
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
/* NEW_BB and T2_BB are in two unrelated if-clauses. */
if (!dominated_by_p (CDI_DOMINATORS, new_bb, t2_bb))
continue;
if (!flow_bb_inside_loop_p (t2_bb->loop_father, new_bb))
continue;
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
/* Compute the nearest dominator. */
if (!t1 || dominated_by_p (CDI_DOMINATORS, t2_bb, t1_bb))
{
t1_bb = t2_bb;
t1 = t2;
}
}
return t1;
}
/* Register in RENAME_MAP the rename tuple (OLD_NAME, EXPR).
When OLD_NAME and EXPR are the same we assert. */
void translate_isl_ast_to_gimple::
set_rename (tree old_name, tree expr)
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
{
if (dump_file)
{
fprintf (dump_file, "[codegen] setting rename: old_name = ");
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
print_generic_expr (dump_file, old_name, 0);
fprintf (dump_file, ", new_name = ");
print_generic_expr (dump_file, expr, 0);
fprintf (dump_file, "\n");
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
}
if (old_name == expr)
return;
vec <tree> *renames = region->rename_map->get (old_name);
if (renames)
renames->safe_push (expr);
else
{
vec<tree> r;
r.create (2);
r.safe_push (expr);
region->rename_map->put (old_name, r);
}
tree t;
int i;
/* For a parameter of a scop we don't want to rename it. */
FOR_EACH_VEC_ELT (region->params, i, t)
if (old_name == t)
region->parameter_rename_map->put(old_name, expr);
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
}
/* Return an iterator to the instructions comes last in the execution order.
Either GSI1 and GSI2 should belong to the same basic block or one of their
respective basic blocks should dominate the other. */
gimple_stmt_iterator
later_of_the_two (gimple_stmt_iterator gsi1, gimple_stmt_iterator gsi2)
{
basic_block bb1 = gsi_bb (gsi1);
basic_block bb2 = gsi_bb (gsi2);
/* Find the iterator which is the latest. */
if (bb1 == bb2)
{
gimple *stmt1 = gsi_stmt (gsi1);
gimple *stmt2 = gsi_stmt (gsi2);
if (stmt1 != NULL && stmt2 != NULL)
{
bool is_phi1 = gimple_code (stmt1) == GIMPLE_PHI;
bool is_phi2 = gimple_code (stmt2) == GIMPLE_PHI;
if (is_phi1 != is_phi2)
return is_phi1 ? gsi2 : gsi1;
}
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
/* For empty basic blocks gsis point to the end of the sequence. Since
there is no operator== defined for gimple_stmt_iterator and for gsis
not pointing to a valid statement gsi_next would assert. */
gimple_stmt_iterator gsi = gsi1;
do {
if (gsi_stmt (gsi) == gsi_stmt (gsi2))
return gsi2;
gsi_next (&gsi);
} while (!gsi_end_p (gsi));
return gsi1;
}
/* Find the basic block closest to the basic block which defines stmt. */
if (dominated_by_p (CDI_DOMINATORS, bb1, bb2))
return gsi1;
gcc_assert (dominated_by_p (CDI_DOMINATORS, bb2, bb1));
return gsi2;
}
/* Insert each statement from SEQ at its earliest insertion p. */
void translate_isl_ast_to_gimple::
gsi_insert_earliest (gimple_seq seq)
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
{
update_modified_stmts (seq);
sese_l &codegen_region = region->if_region->true_region->region;
basic_block begin_bb = get_entry_bb (codegen_region);
/* Inserting the gimple statements in a vector because gimple_seq behave
in strage ways when inserting the stmts from it into different basic
blocks one at a time. */
auto_vec<gimple *, 3> stmts;
for (gimple_stmt_iterator gsi = gsi_start (seq); !gsi_end_p (gsi);
gsi_next (&gsi))
stmts.safe_push (gsi_stmt (gsi));
int i;
gimple *use_stmt;
FOR_EACH_VEC_ELT (stmts, i, use_stmt)
{
gcc_assert (gimple_code (use_stmt) != GIMPLE_PHI);
gimple_stmt_iterator gsi_def_stmt = gsi_start_bb_nondebug (begin_bb);
use_operand_p use_p;
ssa_op_iter op_iter;
FOR_EACH_SSA_USE_OPERAND (use_p, use_stmt, op_iter, SSA_OP_USE)
{
/* Iterator to the current def of use_p. For function parameters or
anything where def is not found, insert at the beginning of the
generated region. */
gimple_stmt_iterator gsi_stmt = gsi_def_stmt;
tree op = USE_FROM_PTR (use_p);
gimple *stmt = SSA_NAME_DEF_STMT (op);
if (stmt && (gimple_code (stmt) != GIMPLE_NOP))
gsi_stmt = gsi_for_stmt (stmt);
/* For region parameters, insert at the beginning of the generated
region. */
if (!bb_in_sese_p (gsi_bb (gsi_stmt), codegen_region))
gsi_stmt = gsi_def_stmt;
gsi_def_stmt = later_of_the_two (gsi_stmt, gsi_def_stmt);
}
if (!gsi_stmt (gsi_def_stmt))
{
gimple_stmt_iterator gsi = gsi_after_labels (gsi_bb (gsi_def_stmt));
gsi_insert_before (&gsi, use_stmt, GSI_NEW_STMT);
}
else if (gimple_code (gsi_stmt (gsi_def_stmt)) == GIMPLE_PHI)
{
gimple_stmt_iterator bsi
= gsi_start_bb_nondebug (gsi_bb (gsi_def_stmt));
/* Insert right after the PHI statements. */
gsi_insert_before (&bsi, use_stmt, GSI_NEW_STMT);
}
else
gsi_insert_after (&gsi_def_stmt, use_stmt, GSI_NEW_STMT);
if (dump_file)
{
fprintf (dump_file, "[codegen] inserting statement: ");
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
print_gimple_stmt (dump_file, use_stmt, 0, TDF_VOPS | TDF_MEMSYMS);
print_loops_bb (dump_file, gimple_bb (use_stmt), 0, 3);
}
}
}
/* Collect all the operands of NEW_EXPR by recursively visiting each
operand. */
void translate_isl_ast_to_gimple::
collect_all_ssa_names (tree new_expr, vec<tree> *vec_ssa)
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
{
if (new_expr == NULL_TREE)
return;
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
/* Rename all uses in new_expr. */
if (TREE_CODE (new_expr) == SSA_NAME)
{
vec_ssa->safe_push (new_expr);
return;
}
/* Iterate over SSA_NAMES in NEW_EXPR. */
for (int i = 0; i < (TREE_CODE_LENGTH (TREE_CODE (new_expr))); i++)
{
tree op = TREE_OPERAND (new_expr, i);
collect_all_ssa_names (op, vec_ssa);
}
}
/* This is abridged version of the function copied from:
tree.c:substitute_in_expr (tree exp, tree f, tree r). */
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
static tree
substitute_ssa_name (tree exp, tree f, tree r)
{
enum tree_code code = TREE_CODE (exp);
tree op0, op1, op2, op3;
tree new_tree;
/* We handle TREE_LIST and COMPONENT_REF separately. */
if (code == TREE_LIST)
{
op0 = substitute_ssa_name (TREE_CHAIN (exp), f, r);
op1 = substitute_ssa_name (TREE_VALUE (exp), f, r);
if (op0 == TREE_CHAIN (exp) && op1 == TREE_VALUE (exp))
return exp;
return tree_cons (TREE_PURPOSE (exp), op1, op0);
}
else if (code == COMPONENT_REF)
{
tree inner;
/* If this expression is getting a value from a PLACEHOLDER_EXPR
and it is the right field, replace it with R. */
for (inner = TREE_OPERAND (exp, 0);
REFERENCE_CLASS_P (inner);
inner = TREE_OPERAND (inner, 0))
;
/* The field. */
op1 = TREE_OPERAND (exp, 1);
if (TREE_CODE (inner) == PLACEHOLDER_EXPR && op1 == f)
return r;
/* If this expression hasn't been completed let, leave it alone. */
if (TREE_CODE (inner) == PLACEHOLDER_EXPR && !TREE_TYPE (inner))
return exp;
op0 = substitute_ssa_name (TREE_OPERAND (exp, 0), f, r);
if (op0 == TREE_OPERAND (exp, 0))
return exp;
new_tree
= fold_build3 (COMPONENT_REF, TREE_TYPE (exp), op0, op1, NULL_TREE);
}
else
switch (TREE_CODE_CLASS (code))
{
case tcc_constant:
return exp;
case tcc_declaration:
if (exp == f)
return r;
else
return exp;
case tcc_expression:
if (exp == f)
return r;
re PR c/7652 (-Wswitch-break : Warn if a switch case falls through) PR c/7652 gcc/ * alias.c (find_base_value): Adjust fall through comment. * cfgexpand.c (expand_debug_expr): Likewise. * combine.c (find_split_point): Likewise. (expand_compound_operation): Likewise. Add FALLTHRU. (make_compound_operation): Adjust fall through comment. (canon_reg_for_combine): Add FALLTHRU. (force_to_mode): Adjust fall through comment. (simplify_shift_const_1): Likewise. (simplify_comparison): Likewise. * config/aarch64/aarch64-builtins.c (aarch64_simd_expand_args): Add FALLTHRU. * config/aarch64/predicates.md: Likewise. * config/i386/i386.c (function_arg_advance_32): Likewise. (ix86_gimplify_va_arg): Likewise. (print_reg): Likewise. (ix86_print_operand): Likewise. (ix86_build_const_vector): Likewise. (ix86_expand_branch): Likewise. (ix86_sched_init_global): Adjust fall through comment. (ix86_expand_args_builtin): Add FALLTHRU. (ix86_expand_builtin): Likewise. (ix86_expand_vector_init_one_var): Likewise. * config/rs6000/rs6000.c (rs6000_emit_vector_compare_inner): Likewise. (rs6000_adjust_cost): Likewise. (insn_must_be_first_in_group): Likewise. * config/rs6000/rs6000.md: Likewise. Adjust fall through comment. * dbxout.c (dbxout_symbol): Adjust fall through comment. * df-scan.c (df_uses_record): Likewise. * dojump.c (do_jump): Add FALLTHRU. * dwarf2out.c (mem_loc_descriptor): Likewise. Adjust fall through comment. (resolve_args_picking_1): Adjust fall through comment. (loc_list_from_tree_1): Likewise. * expmed.c (make_tree): Likewise. * expr.c (expand_expr_real_2): Add FALLTHRU. (expand_expr_real_1): Likewise. Adjust fall through comment. * fold-const.c (const_binop): Adjust fall through comment. (fold_truth_not_expr): Likewise. (fold_cond_expr_with_comparison): Add FALLTHRU. (fold_binary_loc): Likewise. (contains_label_1): Adjust fall through comment. (multiple_of_p): Likewise. * gcov-tool.c (process_args): Add FALLTHRU. * genattrtab.c (check_attr_test): Likewise. (write_test_expr): Likewise. * genconfig.c (walk_insn_part): Likewise. * genpreds.c (validate_exp): Adjust fall through comment. (needs_variable): Likewise. * gensupport.c (get_alternatives_number): Add FALLTHRU. (subst_dup): Likewise. * gimple-pretty-print.c (dump_gimple_assign): Likewise. * gimplify.c (gimplify_addr_expr): Adjust fall through comment. (gimplify_scan_omp_clauses): Add FALLTHRU. (goa_stabilize_expr): Likewise. * graphite-isl-ast-to-gimple.c (substitute_ssa_name): Adjust fall through comment. * hsa-gen.c (get_address_from_value): Likewise. * ipa-icf.c (sem_function::hash_stmt): Likewise. * ira.c (ira_setup_alts): Add FALLTHRU. * lra-eliminations.c (lra_eliminate_regs_1): Adjust fall through comment. * lto-streamer-out.c (lto_output_tree_ref): Add FALLTHRU. * opts.c (common_handle_option): Likewise. * read-rtl.c (read_rtx_code): Likewise. * real.c (round_for_format): Likewise. * recog.c (asm_operand_ok): Likewise. * reginfo.c (reg_scan_mark_refs): Adjust fall through comment. * reload1.c (set_label_offsets): Likewise. (eliminate_regs_1): Likewise. (reload_reg_reaches_end_p): Likewise. * rtlanal.c (commutative_operand_precedence): Add FALLTHRU. (rtx_cost): Likewise. * sched-rgn.c (is_exception_free): Likewise. * simplify-rtx.c (simplify_rtx): Adjust fall through comment. * stor-layout.c (int_mode_for_mode): Likewise. * toplev.c (print_to_asm_out_file): Likewise. (print_to_stderr): Likewise. * tree-cfg.c (gimple_verify_flow_info): Likewise. * tree-chrec.c (chrec_fold_plus_1): Add FALLTHRU. (chrec_fold_multiply): Likewise. (evolution_function_is_invariant_rec_p): Likewise. (for_each_scev_op): Likewise. * tree-data-ref.c (siv_subscript_p): Likewise. (get_references_in_stmt): Likewise. * tree.c (find_placeholder_in_expr): Adjust fall through comment. (substitute_in_expr): Likewise. (type_cache_hasher::equal): Likewise. (walk_type_fields): Likewise. * var-tracking.c (adjust_mems): Add FALLTHRU. (set_dv_changed): Adjust fall through comment. * varasm.c (default_function_section): Add FALLTHRU. gcc/c-family/ * c-common.c (scalar_to_vector): Adjust fall through comment. * c-opts.c (c_common_handle_option): Likewise. * c-pragma.c (handle_pragma_pack): Add FALLTHRU. * c-pretty-print.c (c_pretty_printer::postfix_expression): Adjust fall through comment. * cilk.c (extract_free_variables): Add FALLTHRU. gcc/c/ * c-parser.c (c_parser_external_declaration): Add FALLTHRU. (c_parser_postfix_expression): Likewise. * c-typeck.c (build_unary_op): Adjust fall through comment. (c_mark_addressable): Likewise. gcc/cp/ * call.c (add_builtin_candidate): Add FALLTHRU. (build_integral_nontype_arg_conv): Adjust fall through comment. (build_new_op_1): Add FALLTHRU. (convert_like_real): Adjust fall through comment. * class.c (fixed_type_or_null): Likewise. * constexpr.c (cxx_eval_constant_expression): Likewise. (potential_constant_expression_1): Likewise. Add FALLTHRU. * cp-gimplify.c (cp_gimplify_expr): Adjust fall through comment. (cp_fold): Add FALLTHRU. * cvt.c (build_expr_type_conversion): Adjust fall through comment. * cxx-pretty-print.c (pp_cxx_unqualified_id): Add FALLTHRU. (pp_cxx_qualified_id): Likewise. (cxx_pretty_printer::constant): Adjust fall through comment. (cxx_pretty_printer::primary_expression): Add FALLTHRU. (pp_cxx_pm_expression): Adjust fall through comment. (cxx_pretty_printer::expression): Add FALLTHRU. (cxx_pretty_printer::declaration_specifiers): Reformat code. (pp_cxx_type_specifier_seq): Adjust fall through comment. (pp_cxx_ptr_operator): Likewise. Add FALLTHRU. * error.c (dump_type): Adjust fall through comment. (dump_decl): Likewise. * mangle.c (write_type): Likewise. * method.c (synthesized_method_walk): Add FALLTHRU. * name-lookup.c (arg_assoc_type): Likewise. * parser.c (cp_lexer_print_token): Adjust fall through comment. (cp_parser_primary_expression): Add FALLTHRU. (cp_parser_operator): Likewise. * pt.c (find_parameter_packs_r): Likewise. (tsubst_aggr_type): Adjust fall through comment. * semantics.c (finish_omp_clauses): Add FALLTHRU. * tree.c (lvalue_kind): Likewise. gcc/fortran/ * decl.c (match_attr_spec): Add FALLTHRU. * primary.c (match_arg_list_function): Likewise. * resolve.c (resolve_operator): Adjust fall through comment. (fixup_charlen): Add FALLTHRU. (resolve_allocate_expr): Adjust fall through comment. * trans-array.c (gfc_conv_ss_startstride): Add FALLTHRU. * trans-intrinsic.c (gfc_conv_intrinsic_len): Adjust fall through comment. gcc/java/ * expr.c (java_truthvalue_conversion): Adjust fall through comment. * jcf-io.c (verify_constant_pool): Likewise. * typeck.c (promote_type): Likewise. gcc/objc/ * objc-encoding.c (encode_type): Add FALLTHRU. libcpp/ * lex.c (search_line_fast): Add FALLTHRU. (_cpp_lex_direct): Likewise. (cpp_token_val_index): Adjust fall through comment. * macro.c (parse_params): Add FALLTHRU. * pch.c (count_defs): Adjust fall through comment. (write_defs): Likewise. libiberty/ * cp-demangle.c (d_print_mod): Add FALLTHRU. From-SVN: r239410
2016-08-12 12:30:47 +02:00
/* Fall through. */
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
case tcc_exceptional:
case tcc_unary:
case tcc_binary:
case tcc_comparison:
case tcc_reference:
switch (TREE_CODE_LENGTH (code))
{
case 0:
if (exp == f)
return r;
return exp;
case 1:
op0 = substitute_ssa_name (TREE_OPERAND (exp, 0), f, r);
if (op0 == TREE_OPERAND (exp, 0))
return exp;
new_tree = fold_build1 (code, TREE_TYPE (exp), op0);
break;
case 2:
op0 = substitute_ssa_name (TREE_OPERAND (exp, 0), f, r);
op1 = substitute_ssa_name (TREE_OPERAND (exp, 1), f, r);
if (op0 == TREE_OPERAND (exp, 0) && op1 == TREE_OPERAND (exp, 1))
return exp;
new_tree = fold_build2 (code, TREE_TYPE (exp), op0, op1);
break;
case 3:
op0 = substitute_ssa_name (TREE_OPERAND (exp, 0), f, r);
op1 = substitute_ssa_name (TREE_OPERAND (exp, 1), f, r);
op2 = substitute_ssa_name (TREE_OPERAND (exp, 2), f, r);
if (op0 == TREE_OPERAND (exp, 0) && op1 == TREE_OPERAND (exp, 1)
&& op2 == TREE_OPERAND (exp, 2))
return exp;
new_tree = fold_build3 (code, TREE_TYPE (exp), op0, op1, op2);
break;
case 4:
op0 = substitute_ssa_name (TREE_OPERAND (exp, 0), f, r);
op1 = substitute_ssa_name (TREE_OPERAND (exp, 1), f, r);
op2 = substitute_ssa_name (TREE_OPERAND (exp, 2), f, r);
op3 = substitute_ssa_name (TREE_OPERAND (exp, 3), f, r);
if (op0 == TREE_OPERAND (exp, 0) && op1 == TREE_OPERAND (exp, 1)
&& op2 == TREE_OPERAND (exp, 2)
&& op3 == TREE_OPERAND (exp, 3))
return exp;
new_tree
= fold (build4 (code, TREE_TYPE (exp), op0, op1, op2, op3));
break;
default:
gcc_unreachable ();
}
break;
case tcc_vl_exp:
default:
gcc_unreachable ();
}
TREE_READONLY (new_tree) |= TREE_READONLY (exp);
if (code == INDIRECT_REF || code == ARRAY_REF || code == ARRAY_RANGE_REF)
TREE_THIS_NOTRAP (new_tree) |= TREE_THIS_NOTRAP (exp);
return new_tree;
}
/* Rename all the operands of NEW_EXPR by recursively visiting each operand. */
tree translate_isl_ast_to_gimple::
rename_all_uses (tree new_expr, basic_block new_bb, basic_block old_bb)
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
{
auto_vec<tree, 2> ssa_names;
collect_all_ssa_names (new_expr, &ssa_names);
tree t;
int i;
FOR_EACH_VEC_ELT (ssa_names, i, t)
if (tree r = get_rename (new_bb, t, old_bb, unknown_phi))
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
new_expr = substitute_ssa_name (new_expr, t, r);
return new_expr;
}
/* For ops which are scev_analyzeable, we can regenerate a new name from its
scalar evolution around LOOP. */
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
tree translate_isl_ast_to_gimple::
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
get_rename_from_scev (tree old_name, gimple_seq *stmts, loop_p loop,
basic_block new_bb, basic_block old_bb,
vec<tree> iv_map)
{
tree scev = scalar_evolution_in_region (region->region, loop, old_name);
/* At this point we should know the exact scev for each
scalar SSA_NAME used in the scop: all the other scalar
SSA_NAMEs should have been translated out of SSA using
arrays with one element. */
tree new_expr;
if (chrec_contains_undetermined (scev))
{
codegen_error = true;
return build_zero_cst (TREE_TYPE (old_name));
}
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
new_expr = chrec_apply_map (scev, iv_map);
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
/* The apply should produce an expression tree containing
the uses of the new induction variables. We should be
able to use new_expr instead of the old_name in the newly
generated loop nest. */
if (chrec_contains_undetermined (new_expr)
|| tree_contains_chrecs (new_expr, NULL))
{
codegen_error = true;
return build_zero_cst (TREE_TYPE (old_name));
}
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
if (TREE_CODE (new_expr) == SSA_NAME)
{
basic_block bb = gimple_bb (SSA_NAME_DEF_STMT (new_expr));
if (bb && !dominated_by_p (CDI_DOMINATORS, new_bb, bb))
{
codegen_error = true;
return build_zero_cst (TREE_TYPE (old_name));
}
}
new_expr = rename_all_uses (new_expr, new_bb, old_bb);
/* We check all the operands and all of them should dominate the use at
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
new_expr. */
auto_vec <tree, 2> new_ssa_names;
collect_all_ssa_names (new_expr, &new_ssa_names);
int i;
tree new_ssa_name;
FOR_EACH_VEC_ELT (new_ssa_names, i, new_ssa_name)
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
{
if (TREE_CODE (new_ssa_name) == SSA_NAME)
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
{
basic_block bb = gimple_bb (SSA_NAME_DEF_STMT (new_ssa_name));
if (bb && !dominated_by_p (CDI_DOMINATORS, new_bb, bb))
{
codegen_error = true;
return build_zero_cst (TREE_TYPE (old_name));
}
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
}
}
/* Replace the old_name with the new_expr. */
return force_gimple_operand (unshare_expr (new_expr), stmts,
true, NULL_TREE);
}
/* Renames the scalar uses of the statement COPY, using the
substitution map RENAME_MAP, inserting the gimplification code at
GSI_TGT, for the translation REGION, with the original copied
statement in LOOP, and using the induction variable renaming map
IV_MAP. Returns true when something has been renamed. */
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
bool translate_isl_ast_to_gimple::
rename_uses (gimple *copy, gimple_stmt_iterator *gsi_tgt, basic_block old_bb,
loop_p loop, vec<tree> iv_map)
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
{
bool changed = false;
if (is_gimple_debug (copy))
{
if (gimple_debug_bind_p (copy))
gimple_debug_bind_reset_value (copy);
else if (gimple_debug_source_bind_p (copy))
return false;
else
gcc_unreachable ();
return false;
}
if (dump_file)
{
fprintf (dump_file, "[codegen] renaming uses of stmt: ");
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
print_gimple_stmt (dump_file, copy, 0, 0);
}
use_operand_p use_p;
ssa_op_iter op_iter;
FOR_EACH_SSA_USE_OPERAND (use_p, copy, op_iter, SSA_OP_USE)
{
tree old_name = USE_FROM_PTR (use_p);
if (dump_file)
{
fprintf (dump_file, "[codegen] renaming old_name = ");
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
print_generic_expr (dump_file, old_name, 0);
fprintf (dump_file, "\n");
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
}
if (TREE_CODE (old_name) != SSA_NAME
|| SSA_NAME_IS_DEFAULT_DEF (old_name))
continue;
changed = true;
tree new_expr = get_rename (gsi_tgt->bb, old_name,
old_bb, unknown_phi);
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
if (new_expr)
{
tree type_old_name = TREE_TYPE (old_name);
tree type_new_expr = TREE_TYPE (new_expr);
if (dump_file)
{
fprintf (dump_file, "[codegen] from rename_map: new_name = ");
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
print_generic_expr (dump_file, new_expr, 0);
fprintf (dump_file, "\n");
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
}
if (type_old_name != type_new_expr
|| TREE_CODE (new_expr) != SSA_NAME)
{
tree var = create_tmp_var (type_old_name, "var");
if (!useless_type_conversion_p (type_old_name, type_new_expr))
new_expr = fold_convert (type_old_name, new_expr);
gimple_seq stmts;
new_expr = force_gimple_operand (new_expr, &stmts, true, var);
gsi_insert_earliest (stmts);
}
replace_exp (use_p, new_expr);
continue;
}
gimple_seq stmts;
new_expr = get_rename_from_scev (old_name, &stmts, loop, gimple_bb (copy),
old_bb, iv_map);
if (!new_expr || codegen_error_p ())
return false;
if (dump_file)
{
fprintf (dump_file, "[codegen] not in rename map, scev: ");
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
print_generic_expr (dump_file, new_expr, 0);
fprintf (dump_file, "\n");
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
}
gsi_insert_earliest (stmts);
replace_exp (use_p, new_expr);
if (TREE_CODE (new_expr) == INTEGER_CST
&& is_gimple_assign (copy))
{
tree rhs = gimple_assign_rhs1 (copy);
if (TREE_CODE (rhs) == ADDR_EXPR)
recompute_tree_invariant_for_addr_expr (rhs);
}
set_rename (old_name, new_expr);
}
return changed;
}
/* Returns a basic block that could correspond to where a constant was defined
in the original code. In the original code OLD_BB had the definition, we
need to find which basic block out of the copies of old_bb, in the new
region, should a definition correspond to if it has to reach BB. */
basic_block translate_isl_ast_to_gimple::
get_def_bb_for_const (basic_block bb, basic_block old_bb) const
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
{
vec <basic_block> *bbs = region->copied_bb_map->get (old_bb);
if (!bbs || bbs->is_empty ())
return NULL;
if (1 == bbs->length ())
return (*bbs)[0];
int i;
basic_block b1 = NULL, b2;
FOR_EACH_VEC_ELT (*bbs, i, b2)
{
if (b2 == bb)
return bb;
/* BB and B2 are in two unrelated if-clauses. */
if (!dominated_by_p (CDI_DOMINATORS, bb, b2))
continue;
/* Compute the nearest dominator. */
if (!b1 || dominated_by_p (CDI_DOMINATORS, b2, b1))
b1 = b2;
}
return b1;
}
/* Get the new name of OP (from OLD_BB) to be used in NEW_BB. PHI_KIND
determines the kind of phi node. */
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
tree translate_isl_ast_to_gimple::
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
get_new_name (basic_block new_bb, tree op,
basic_block old_bb, phi_node_kind phi_kind) const
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
{
/* For constants the names are the same. */
if (TREE_CODE (op) != SSA_NAME)
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
return op;
return get_rename (new_bb, op, old_bb, phi_kind);
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
}
/* Return a debug location for OP. */
static location_t
get_loc (tree op)
{
location_t loc = UNKNOWN_LOCATION;
if (TREE_CODE (op) == SSA_NAME)
loc = gimple_location (SSA_NAME_DEF_STMT (op));
return loc;
}
/* Returns the incoming edges of basic_block BB in the pair. The first edge is
the init edge (from outside the loop) and the second one is the back edge
from the same loop. */
std::pair<edge, edge>
get_edges (basic_block bb)
{
std::pair<edge, edge> edges;
edge e;
edge_iterator ei;
FOR_EACH_EDGE (e, ei, bb->preds)
if (bb->loop_father != e->src->loop_father)
edges.first = e;
else
edges.second = e;
return edges;
}
/* Copy the PHI arguments from OLD_PHI to the NEW_PHI. The arguments to NEW_PHI
must be found unless they can be POSTPONEd for later. */
bool translate_isl_ast_to_gimple::
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
copy_loop_phi_args (gphi *old_phi, init_back_edge_pair_t &ibp_old_bb,
gphi *new_phi, init_back_edge_pair_t &ibp_new_bb,
bool postpone)
{
gcc_assert (gimple_phi_num_args (old_phi) == gimple_phi_num_args (new_phi));
basic_block new_bb = gimple_bb (new_phi);
for (unsigned i = 0; i < gimple_phi_num_args (old_phi); i++)
{
edge e;
if (gimple_phi_arg_edge (old_phi, i) == ibp_old_bb.first)
e = ibp_new_bb.first;
else
e = ibp_new_bb.second;
tree old_name = gimple_phi_arg_def (old_phi, i);
tree new_name = get_new_name (new_bb, old_name,
gimple_bb (old_phi), loop_phi);
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
if (new_name)
{
add_phi_arg (new_phi, new_name, e, get_loc (old_name));
continue;
}
gimple *old_def_stmt = SSA_NAME_DEF_STMT (old_name);
if (!old_def_stmt || gimple_code (old_def_stmt) == GIMPLE_NOP)
/* If the phi arg was a function arg, or wasn't defined, just use the
old name. */
add_phi_arg (new_phi, old_name, e, get_loc (old_name));
else if (postpone)
{
/* Postpone code gen for later for those back-edges we don't have the
names yet. */
region->incomplete_phis.safe_push (std::make_pair (old_phi, new_phi));
if (dump_file)
fprintf (dump_file, "[codegen] postpone loop phi nodes.\n");
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
}
else
/* Either we should add the arg to phi or, we should postpone. */
return false;
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
}
return true;
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
}
/* Copy loop phi nodes from BB to NEW_BB. */
bool translate_isl_ast_to_gimple::
copy_loop_phi_nodes (basic_block bb, basic_block new_bb)
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
{
if (dump_file)
fprintf (dump_file, "[codegen] copying loop phi nodes in bb_%d.\n",
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
new_bb->index);
/* Loop phi nodes should have only two arguments. */
gcc_assert (2 == EDGE_COUNT (bb->preds));
/* First edge is the init edge and second is the back edge. */
init_back_edge_pair_t ibp_old_bb = get_edges (bb);
/* First edge is the init edge and second is the back edge. */
init_back_edge_pair_t ibp_new_bb = get_edges (new_bb);
for (gphi_iterator psi = gsi_start_phis (bb); !gsi_end_p (psi);
gsi_next (&psi))
{
gphi *phi = psi.phi ();
tree res = gimple_phi_result (phi);
if (virtual_operand_p (res))
continue;
if (is_gimple_reg (res) && scev_analyzable_p (res, region->region))
continue;
gphi *new_phi = create_phi_node (SSA_NAME_VAR (res), new_bb);
tree new_res = create_new_def_for (res, new_phi,
gimple_phi_result_ptr (new_phi));
set_rename (res, new_res);
codegen_error = !copy_loop_phi_args (phi, ibp_old_bb, new_phi,
ibp_new_bb, true);
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
update_stmt (new_phi);
if (dump_file)
{
fprintf (dump_file, "[codegen] creating loop-phi node: ");
print_gimple_stmt (dump_file, new_phi, 0, 0);
}
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
}
return true;
}
/* Return the init value of PHI, the value coming from outside the loop. */
static tree
get_loop_init_value (gphi *phi)
{
loop_p loop = gimple_bb (phi)->loop_father;
edge e;
edge_iterator ei;
FOR_EACH_EDGE (e, ei, gimple_bb (phi)->preds)
if (e->src->loop_father != loop)
return gimple_phi_arg_def (phi, e->dest_idx);
return NULL_TREE;
}
/* Find the init value (the value which comes from outside the loop), of one of
the operands of DEF which is defined by a loop phi. */
static tree
find_init_value (gimple *def)
{
if (gimple_code (def) == GIMPLE_PHI)
return get_loop_init_value (as_a <gphi*> (def));
if (gimple_vuse (def))
return NULL_TREE;
ssa_op_iter iter;
use_operand_p use_p;
FOR_EACH_SSA_USE_OPERAND (use_p, def, iter, SSA_OP_USE)
{
tree use = USE_FROM_PTR (use_p);
if (TREE_CODE (use) == SSA_NAME)
{
if (tree res = find_init_value (SSA_NAME_DEF_STMT (use)))
return res;
}
}
return NULL_TREE;
}
/* Return the init value, the value coming from outside the loop. */
static tree
find_init_value_close_phi (gphi *phi)
{
gcc_assert (gimple_phi_num_args (phi) == 1);
tree use_arg = gimple_phi_arg_def (phi, 0);
gimple *def = SSA_NAME_DEF_STMT (use_arg);
return find_init_value (def);
}
tree translate_isl_ast_to_gimple::
add_close_phis_to_outer_loops (tree last_merge_name, edge last_e,
gimple *old_close_phi)
{
sese_l &codegen_region = region->if_region->true_region->region;
gimple *stmt = SSA_NAME_DEF_STMT (last_merge_name);
basic_block bb = gimple_bb (stmt);
if (!bb_in_sese_p (bb, codegen_region))
return last_merge_name;
loop_p loop = bb->loop_father;
if (!loop_in_sese_p (loop, codegen_region))
return last_merge_name;
edge e = single_exit (loop);
if (dominated_by_p (CDI_DOMINATORS, e->dest, last_e->src))
return last_merge_name;
tree old_name = gimple_phi_arg_def (old_close_phi, 0);
tree old_close_phi_name = gimple_phi_result (old_close_phi);
bb = e->dest;
if (!bb_contains_loop_close_phi_nodes (bb) || !single_succ_p (bb))
bb = split_edge (e);
gphi *close_phi = create_phi_node (SSA_NAME_VAR (last_merge_name), bb);
tree res = create_new_def_for (last_merge_name, close_phi,
gimple_phi_result_ptr (close_phi));
set_rename (old_close_phi_name, res);
add_phi_arg (close_phi, last_merge_name, e, get_loc (old_name));
last_merge_name = res;
return add_close_phis_to_outer_loops (last_merge_name, last_e, old_close_phi);
}
/* Add phi nodes to all merge points of all the diamonds enclosing the loop of
the close phi node PHI. */
bool translate_isl_ast_to_gimple::
add_close_phis_to_merge_points (gphi *old_close_phi, gphi *new_close_phi,
tree default_value)
{
sese_l &codegen_region = region->if_region->true_region->region;
basic_block default_value_bb = get_entry_bb (codegen_region);
if (SSA_NAME == TREE_CODE (default_value))
{
gimple *stmt = SSA_NAME_DEF_STMT (default_value);
if (!stmt || gimple_code (stmt) == GIMPLE_NOP)
return false;
default_value_bb = gimple_bb (stmt);
}
basic_block new_close_phi_bb = gimple_bb (new_close_phi);
tree old_close_phi_name = gimple_phi_result (old_close_phi);
tree new_close_phi_name = gimple_phi_result (new_close_phi);
tree last_merge_name = new_close_phi_name;
tree old_name = gimple_phi_arg_def (old_close_phi, 0);
int i;
edge merge_e;
FOR_EACH_VEC_ELT_REVERSE (merge_points, i, merge_e)
{
basic_block new_merge_bb = merge_e->src;
if (!dominated_by_p (CDI_DOMINATORS, new_merge_bb, default_value_bb))
continue;
last_merge_name = add_close_phis_to_outer_loops (last_merge_name, merge_e,
old_close_phi);
gphi *merge_phi = create_phi_node (SSA_NAME_VAR (old_close_phi_name), new_merge_bb);
tree merge_res = create_new_def_for (old_close_phi_name, merge_phi,
gimple_phi_result_ptr (merge_phi));
set_rename (old_close_phi_name, merge_res);
edge from_loop = NULL, from_default_value = NULL;
edge e;
edge_iterator ei;
FOR_EACH_EDGE (e, ei, new_merge_bb->preds)
if (dominated_by_p (CDI_DOMINATORS, e->src, new_close_phi_bb))
from_loop = e;
else
from_default_value = e;
/* Because CDI_POST_DOMINATORS are not updated, we only rely on
CDI_DOMINATORS, which may not handle all cases where new_close_phi_bb
is contained in another condition. */
if (!from_default_value || !from_loop)
return false;
add_phi_arg (merge_phi, last_merge_name, from_loop, get_loc (old_name));
add_phi_arg (merge_phi, default_value, from_default_value, get_loc (old_name));
if (dump_file)
{
fprintf (dump_file, "[codegen] Adding guard-phi: ");
print_gimple_stmt (dump_file, merge_phi, 0, 0);
}
update_stmt (merge_phi);
last_merge_name = merge_res;
}
return true;
}
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
/* Copy all the loop-close phi args from BB to NEW_BB. */
bool translate_isl_ast_to_gimple::
copy_loop_close_phi_args (basic_block old_bb, basic_block new_bb, bool postpone)
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
{
for (gphi_iterator psi = gsi_start_phis (old_bb); !gsi_end_p (psi);
gsi_next (&psi))
{
gphi *old_close_phi = psi.phi ();
tree res = gimple_phi_result (old_close_phi);
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
if (virtual_operand_p (res))
continue;
if (is_gimple_reg (res) && scev_analyzable_p (res, region->region))
/* Loop close phi nodes should not be scev_analyzable_p. */
gcc_unreachable ();
gphi *new_close_phi = create_phi_node (SSA_NAME_VAR (res), new_bb);
tree new_res = create_new_def_for (res, new_close_phi,
gimple_phi_result_ptr (new_close_phi));
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
set_rename (res, new_res);
tree old_name = gimple_phi_arg_def (old_close_phi, 0);
tree new_name = get_new_name (new_bb, old_name, old_bb, close_phi);
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
/* Predecessor basic blocks of a loop close phi should have been code
generated before. FIXME: This is fixable by merging PHIs from inner
loops as well. See: gfortran.dg/graphite/interchange-3.f90. */
if (!new_name)
return false;
add_phi_arg (new_close_phi, new_name, single_pred_edge (new_bb),
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
get_loc (old_name));
if (dump_file)
{
fprintf (dump_file, "[codegen] Adding loop close phi: ");
print_gimple_stmt (dump_file, new_close_phi, 0, 0);
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
}
update_stmt (new_close_phi);
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
/* When there is no loop guard around this codegenerated loop, there is no
need to collect the close-phi arg. */
if (merge_points.is_empty ())
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
continue;
/* Add a PHI in the succ_new_bb for each close phi of the loop. */
tree default_value = find_init_value_close_phi (new_close_phi);
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
/* A close phi must come from a loop-phi having a default value. */
if (!default_value)
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
{
if (!postpone)
return false;
region->incomplete_phis.safe_push (std::make_pair (old_close_phi,
new_close_phi));
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
if (dump_file)
{
fprintf (dump_file, "[codegen] postpone close phi nodes: ");
print_gimple_stmt (dump_file, new_close_phi, 0, 0);
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
}
continue;
}
if (!add_close_phis_to_merge_points (old_close_phi, new_close_phi,
default_value))
return false;
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
}
return true;
}
/* Copy loop close phi nodes from BB to NEW_BB. */
bool translate_isl_ast_to_gimple::
copy_loop_close_phi_nodes (basic_block old_bb, basic_block new_bb)
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
{
if (dump_file)
fprintf (dump_file, "[codegen] copying loop close phi nodes in bb_%d.\n",
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
new_bb->index);
/* Loop close phi nodes should have only one argument. */
gcc_assert (1 == EDGE_COUNT (old_bb->preds));
return copy_loop_close_phi_args (old_bb, new_bb, true);
}
/* Add NEW_NAME as the ARGNUM-th arg of NEW_PHI which is in NEW_BB.
DOMINATING_PRED is the predecessor basic block of OLD_BB which dominates the
other pred of OLD_BB as well. If no such basic block exists then it is NULL.
NON_DOMINATING_PRED is a pred which does not dominate OLD_BB, it cannot be
NULL.
Case1: OLD_BB->preds {BB1, BB2} and BB1 does not dominate BB2 and vice versa.
In this case DOMINATING_PRED = NULL.
Case2: OLD_BB->preds {BB1, BB2} and BB1 dominates BB2.
Returns true on successful copy of the args, false otherwise. */
bool translate_isl_ast_to_gimple::
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
add_phi_arg_for_new_expr (tree old_phi_args[2], tree new_phi_args[2],
edge old_bb_dominating_edge,
edge old_bb_non_dominating_edge,
gphi *phi, gphi *new_phi,
basic_block new_bb)
{
basic_block def_pred[2] = { NULL, NULL };
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
int not_found_bb_index = -1;
for (int i = 0; i < 2; i++)
{
/* If the corresponding def_bb could not be found the entry will be
NULL. */
if (TREE_CODE (old_phi_args[i]) == INTEGER_CST)
def_pred[i] = get_def_bb_for_const (new_bb,
gimple_phi_arg_edge (phi, i)->src);
else if (new_phi_args[i] && (TREE_CODE (new_phi_args[i]) == SSA_NAME))
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
def_pred[i] = gimple_bb (SSA_NAME_DEF_STMT (new_phi_args[i]));
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
if (!def_pred[i])
{
/* When non are available bail out. */
if (not_found_bb_index != -1)
return false;
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
not_found_bb_index = i;
}
}
/* Here we are pattern matching on the structure of CFG w.r.t. old one. */
if (old_bb_dominating_edge)
{
if (not_found_bb_index != -1)
return false;
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
basic_block new_pred1 = (*new_bb->preds)[0]->src;
basic_block new_pred2 = (*new_bb->preds)[1]->src;
vec <basic_block> *bbs
= region->copied_bb_map->get (old_bb_non_dominating_edge->src);
/* Could not find a mapping. */
if (!bbs)
return false;
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
basic_block new_pred = NULL;
basic_block b;
int i;
FOR_EACH_VEC_ELT (*bbs, i, b)
{
if (dominated_by_p (CDI_DOMINATORS, new_pred1, b))
{
/* FIXME: If we have already found new_pred then we have to
disambiguate, bail out for now. */
if (new_pred)
return false;
new_pred = new_pred1;
}
if (dominated_by_p (CDI_DOMINATORS, new_pred2, b))
{
/* FIXME: If we have already found new_pred then we have to either
it dominates both or we have to disambiguate, bail out. */
if (new_pred)
return false;
new_pred = new_pred2;
}
}
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
if (!new_pred)
return false;
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
edge new_non_dominating_edge = find_edge (new_pred, new_bb);
gcc_assert (new_non_dominating_edge);
/* FIXME: Validate each args just like in loop-phis. */
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
/* By the process of elimination we first insert insert phi-edge for
non-dominating pred which is computed above and then we insert the
remaining one. */
int inserted_edge = 0;
for (; inserted_edge < 2; inserted_edge++)
{
edge new_bb_pred_edge = gimple_phi_arg_edge (new_phi, inserted_edge);
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
if (new_non_dominating_edge == new_bb_pred_edge)
{
add_phi_arg (new_phi, new_phi_args[inserted_edge],
new_non_dominating_edge,
get_loc (old_phi_args[inserted_edge]));
break;
}
}
if (inserted_edge == 2)
return false;
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
int edge_dominating = inserted_edge == 0 ? 1 : 0;
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
edge new_dominating_edge = NULL;
for (inserted_edge = 0; inserted_edge < 2; inserted_edge++)
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
{
edge e = gimple_phi_arg_edge (new_phi, inserted_edge);
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
if (e != new_non_dominating_edge)
{
new_dominating_edge = e;
add_phi_arg (new_phi, new_phi_args[edge_dominating],
new_dominating_edge,
get_loc (old_phi_args[inserted_edge]));
break;
}
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
}
gcc_assert (new_dominating_edge);
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
}
else
{
/* Classic diamond structure: both edges are non-dominating. We need to
find one unique edge then the other can be found be elimination. If
any definition (def_pred) dominates both the preds of new_bb then we
bail out. Entries of def_pred maybe NULL, in that case we must
uniquely find pred with help of only one entry. */
edge new_e[2] = { NULL, NULL };
for (int i = 0; i < 2; i++)
{
edge e;
edge_iterator ei;
FOR_EACH_EDGE (e, ei, new_bb->preds)
if (def_pred[i]
&& dominated_by_p (CDI_DOMINATORS, e->src, def_pred[i]))
{
if (new_e[i])
/* We do not know how to handle the case when def_pred
dominates more than a predecessor. */
return false;
new_e[i] = e;
}
}
gcc_assert (new_e[0] || new_e[1]);
/* Find the other edge by process of elimination. */
if (not_found_bb_index != -1)
{
gcc_assert (!new_e[not_found_bb_index]);
int found_bb_index = not_found_bb_index == 1 ? 0 : 1;
edge e;
edge_iterator ei;
FOR_EACH_EDGE (e, ei, new_bb->preds)
{
if (new_e[found_bb_index] == e)
continue;
new_e[not_found_bb_index] = e;
}
}
/* Add edges to phi args. */
for (int i = 0; i < 2; i++)
add_phi_arg (new_phi, new_phi_args[i], new_e[i],
get_loc (old_phi_args[i]));
}
return true;
}
/* Copy the arguments of cond-phi node PHI, to NEW_PHI in the codegenerated
region. If postpone is true and it isn't possible to copy any arg of PHI,
the PHI is added to the REGION->INCOMPLETE_PHIS to be codegenerated later.
Returns false if the copying was unsuccessful. */
bool translate_isl_ast_to_gimple::
copy_cond_phi_args (gphi *phi, gphi *new_phi, vec<tree> iv_map, bool postpone)
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
{
if (dump_file)
fprintf (dump_file, "[codegen] copying cond phi args.\n");
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
gcc_assert (2 == gimple_phi_num_args (phi));
basic_block new_bb = gimple_bb (new_phi);
loop_p loop = gimple_bb (phi)->loop_father;
basic_block old_bb = gimple_bb (phi);
edge old_bb_non_dominating_edge = NULL, old_bb_dominating_edge = NULL;
edge e;
edge_iterator ei;
FOR_EACH_EDGE (e, ei, old_bb->preds)
if (!dominated_by_p (CDI_DOMINATORS, old_bb, e->src))
old_bb_non_dominating_edge = e;
else
old_bb_dominating_edge = e;
gcc_assert (!dominated_by_p (CDI_DOMINATORS, old_bb,
old_bb_non_dominating_edge->src));
tree new_phi_args[2];
tree old_phi_args[2];
for (unsigned i = 0; i < gimple_phi_num_args (phi); i++)
{
tree old_name = gimple_phi_arg_def (phi, i);
tree new_name = get_new_name (new_bb, old_name, old_bb, cond_phi);
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
old_phi_args[i] = old_name;
if (new_name)
{
new_phi_args [i] = new_name;
continue;
}
/* If the phi-arg was a parameter. */
if (vec_find (region->params, old_name) != -1)
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
{
new_phi_args [i] = old_name;
if (dump_file)
{
fprintf (dump_file,
"[codegen] parameter argument to phi, new_expr: ");
print_generic_expr (dump_file, new_phi_args[i], 0);
fprintf (dump_file, "\n");
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
}
continue;
}
gimple *old_def_stmt = SSA_NAME_DEF_STMT (old_name);
if (!old_def_stmt || gimple_code (old_def_stmt) == GIMPLE_NOP)
/* FIXME: If the phi arg was a function arg, or wasn't defined, just use
the old name. */
return false;
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
if (postpone)
{
/* If the phi-arg is scev-analyzeable but only in the first stage. */
if (is_gimple_reg (old_name)
&& scev_analyzable_p (old_name, region->region))
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
{
gimple_seq stmts;
tree new_expr = get_rename_from_scev (old_name, &stmts, loop,
new_bb, old_bb, iv_map);
if (codegen_error_p ())
return false;
gcc_assert (new_expr);
if (dump_file)
{
fprintf (dump_file,
"[codegen] scev analyzeable, new_expr: ");
print_generic_expr (dump_file, new_expr, 0);
fprintf (dump_file, "\n");
}
gsi_insert_earliest (stmts);
new_phi_args[i] = new_expr;
continue;
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
}
/* Postpone code gen for later for back-edges. */
region->incomplete_phis.safe_push (std::make_pair (phi, new_phi));
if (dump_file)
{
fprintf (dump_file, "[codegen] postpone cond phi nodes: ");
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
print_gimple_stmt (dump_file, new_phi, 0, 0);
}
new_phi_args [i] = NULL_TREE;
continue;
}
else
/* Either we should add the arg to phi or, we should postpone. */
return false;
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
}
/* If none of the args have been determined in the first stage then wait until
later. */
if (postpone && !new_phi_args[0] && !new_phi_args[1])
return true;
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
return add_phi_arg_for_new_expr (old_phi_args, new_phi_args,
old_bb_dominating_edge,
old_bb_non_dominating_edge,
phi, new_phi, new_bb);
}
/* Copy cond phi nodes from BB to NEW_BB. A cond-phi node is a basic block
containing phi nodes coming from two predecessors, and none of them are back
edges. */
bool translate_isl_ast_to_gimple::
copy_cond_phi_nodes (basic_block bb, basic_block new_bb, vec<tree> iv_map)
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
{
gcc_assert (!bb_contains_loop_close_phi_nodes (bb));
/* TODO: Handle cond phi nodes with more than 2 predecessors. */
if (EDGE_COUNT (bb->preds) != 2)
return false;
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
if (dump_file)
fprintf (dump_file, "[codegen] copying cond phi nodes in bb_%d.\n",
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
new_bb->index);
for (gphi_iterator psi = gsi_start_phis (bb); !gsi_end_p (psi);
gsi_next (&psi))
{
gphi *phi = psi.phi ();
tree res = gimple_phi_result (phi);
if (virtual_operand_p (res))
continue;
if (is_gimple_reg (res) && scev_analyzable_p (res, region->region))
/* Cond phi nodes should not be scev_analyzable_p. */
gcc_unreachable ();
gphi *new_phi = create_phi_node (SSA_NAME_VAR (res), new_bb);
tree new_res = create_new_def_for (res, new_phi,
gimple_phi_result_ptr (new_phi));
set_rename (res, new_res);
if (!copy_cond_phi_args (phi, new_phi, iv_map, true))
return false;
update_stmt (new_phi);
}
return true;
}
/* Return true if STMT should be copied from region to the new code-generated
region. LABELs, CONDITIONS, induction-variables and region parameters need
not be copied. */
static bool
should_copy_to_new_region (gimple *stmt, sese_info_p region)
{
/* Do not copy labels or conditions. */
if (gimple_code (stmt) == GIMPLE_LABEL
|| gimple_code (stmt) == GIMPLE_COND)
return false;
tree lhs;
/* Do not copy induction variables. */
if (is_gimple_assign (stmt)
&& (lhs = gimple_assign_lhs (stmt))
&& TREE_CODE (lhs) == SSA_NAME
&& is_gimple_reg (lhs)
&& scev_analyzable_p (lhs, region->region))
return false;
/* Do not copy parameters that have been generated in the header of the
scop. */
if (is_gimple_assign (stmt)
&& (lhs = gimple_assign_lhs (stmt))
&& TREE_CODE (lhs) == SSA_NAME
&& region->parameter_rename_map->get(lhs))
return false;
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
return true;
}
/* Create new names for all the definitions created by COPY and add replacement
mappings for each new name. */
void translate_isl_ast_to_gimple::
set_rename_for_each_def (gimple *stmt)
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
{
def_operand_p def_p;
ssa_op_iter op_iter;
FOR_EACH_SSA_DEF_OPERAND (def_p, stmt, op_iter, SSA_OP_ALL_DEFS)
{
tree old_name = DEF_FROM_PTR (def_p);
tree new_name = create_new_def_for (old_name, stmt, def_p);
set_rename (old_name, new_name);
}
}
/* Duplicates the statements of basic block BB into basic block NEW_BB
and compute the new induction variables according to the IV_MAP. */
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
bool translate_isl_ast_to_gimple::
graphite_copy_stmts_from_block (basic_block bb, basic_block new_bb,
vec<tree> iv_map)
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
{
/* Iterator poining to the place where new statement (s) will be inserted. */
gimple_stmt_iterator gsi_tgt = gsi_last_bb (new_bb);
for (gimple_stmt_iterator gsi = gsi_start_bb (bb); !gsi_end_p (gsi);
gsi_next (&gsi))
{
gimple *stmt = gsi_stmt (gsi);
if (!should_copy_to_new_region (stmt, region))
continue;
/* Create a new copy of STMT and duplicate STMT's virtual
operands. */
gimple *copy = gimple_copy (stmt);
gsi_insert_after (&gsi_tgt, copy, GSI_NEW_STMT);
if (dump_file)
{
fprintf (dump_file, "[codegen] inserting statement: ");
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
print_gimple_stmt (dump_file, copy, 0, 0);
}
maybe_duplicate_eh_stmt (copy, stmt);
gimple_duplicate_stmt_histograms (cfun, copy, cfun, stmt);
/* Crete new names for each def in the copied stmt. */
set_rename_for_each_def (copy);
loop_p loop = bb->loop_father;
if (rename_uses (copy, &gsi_tgt, bb, loop, iv_map))
{
fold_stmt_inplace (&gsi_tgt);
gcc_assert (gsi_stmt (gsi_tgt) == copy);
}
if (codegen_error_p ())
return false;
/* For each SSA_NAME in the parameter_rename_map rename their usage. */
ssa_op_iter iter;
use_operand_p use_p;
if (!is_gimple_debug (copy))
FOR_EACH_SSA_USE_OPERAND (use_p, copy, iter, SSA_OP_USE)
{
tree old_name = USE_FROM_PTR (use_p);
if (TREE_CODE (old_name) != SSA_NAME
|| SSA_NAME_IS_DEFAULT_DEF (old_name))
continue;
tree *new_expr = region->parameter_rename_map->get (old_name);
if (!new_expr)
continue;
replace_exp (use_p, *new_expr);
}
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
update_stmt (copy);
}
return true;
}
/* Given a basic block containing close-phi it returns the new basic block where
to insert a copy of the close-phi nodes. All the uses in close phis should
come from a single loop otherwise it returns NULL. */
edge translate_isl_ast_to_gimple::
edge_for_new_close_phis (basic_block bb)
{
/* Make sure that NEW_BB is the new_loop->exit->dest. We find the definition
of close phi in the original code and then find the mapping of basic block
defining that variable. If there are multiple close-phis and they are
defined in different loops (in the original or in the new code) because of
loop splitting, then we bail out. */
loop_p new_loop = NULL;
for (gphi_iterator psi = gsi_start_phis (bb); !gsi_end_p (psi);
gsi_next (&psi))
{
gphi *phi = psi.phi ();
tree name = gimple_phi_arg_def (phi, 0);
basic_block old_loop_bb = gimple_bb (SSA_NAME_DEF_STMT (name));
vec <basic_block> *bbs = region->copied_bb_map->get (old_loop_bb);
if (!bbs || bbs->length () != 1)
/* This is one of the places which shows preserving original structure
is not always possible, as we may need to insert close PHI for a loop
where the latch does not have any mapping, or the mapping is
ambiguous. */
return NULL;
if (!new_loop)
new_loop = (*bbs)[0]->loop_father;
else if (new_loop != (*bbs)[0]->loop_father)
return NULL;
}
if (!new_loop)
return NULL;
return single_exit (new_loop);
}
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
/* Copies BB and includes in the copied BB all the statements that can
be reached following the use-def chains from the memory accesses,
and returns the next edge following this new block. */
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
edge translate_isl_ast_to_gimple::
copy_bb_and_scalar_dependences (basic_block bb, edge next_e, vec<tree> iv_map)
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
{
int num_phis = number_of_phi_nodes (bb);
if (region->copied_bb_map->get (bb))
{
/* FIXME: we should be able to handle phi nodes with args coming from
outside the region. */
if (num_phis)
{
codegen_error = true;
return NULL;
}
}
basic_block new_bb = NULL;
if (bb_contains_loop_close_phi_nodes (bb))
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
{
if (dump_file)
fprintf (dump_file, "[codegen] bb_%d contains close phi nodes.\n",
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
bb->index);
edge e = edge_for_new_close_phis (bb);
if (!e)
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
{
codegen_error = true;
return NULL;
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
}
basic_block phi_bb = e->dest;
if (!bb_contains_loop_close_phi_nodes (phi_bb) || !single_succ_p (phi_bb))
phi_bb = split_edge (e);
gcc_assert (single_pred_edge (phi_bb)->src->loop_father
!= single_pred_edge (phi_bb)->dest->loop_father);
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
if (!copy_loop_close_phi_nodes (bb, phi_bb))
{
codegen_error = true;
return NULL;
}
if (e == next_e)
new_bb = phi_bb;
else
new_bb = split_edge (next_e);
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
}
else
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
{
new_bb = split_edge (next_e);
if (num_phis > 0 && bb_contains_loop_phi_nodes (bb))
{
basic_block phi_bb = next_e->dest->loop_father->header;
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
/* At this point we are unable to codegenerate by still preserving the SSA
structure because maybe the loop is completely unrolled and the PHIs
and cross-bb scalar dependencies are untrackable w.r.t. the original
code. See gfortran.dg/graphite/pr29832.f90. */
if (EDGE_COUNT (bb->preds) != EDGE_COUNT (phi_bb->preds))
{
codegen_error = true;
return NULL;
}
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
2015-12-17 19:50:05 +01:00
/* In case isl did some loop peeling, like this:
S_8(0);
for (int c1 = 1; c1 <= 5; c1 += 1) {
S_8(c1);
}
S_8(6);
there should be no loop-phi nodes in S_8(0).
FIXME: We need to reason about dynamic instances of S_8, i.e., the
values of all scalar variables: for the moment we instantiate only
SCEV analyzable expressions on the iteration domain, and we need to
extend that to reductions that cannot be analyzed by SCEV. */
if (!bb_in_sese_p (phi_bb, region->if_region->true_region->region))
{
codegen_error = true;
return NULL;
}
if (dump_file)
fprintf (dump_file, "[codegen] bb_%d contains loop phi nodes.\n",
bb->index);
if (!copy_loop_phi_nodes (bb, phi_bb))
{
codegen_error = true;
return NULL;
}
}
else if (num_phis > 0)
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
{
if (dump_file)
fprintf (dump_file, "[codegen] bb_%d contains cond phi nodes.\n",
bb->index);
basic_block phi_bb = single_pred (new_bb);
loop_p loop_father = new_bb->loop_father;
/* Move back until we find the block with two predecessors. */
while (single_pred_p (phi_bb))
phi_bb = single_pred_edge (phi_bb)->src;
/* If a corresponding merge-point was not found, then abort codegen. */
if (phi_bb->loop_father != loop_father
|| !bb_in_sese_p (phi_bb, region->if_region->true_region->region)
|| !copy_cond_phi_nodes (bb, phi_bb, iv_map))
{
codegen_error = true;
return NULL;
}
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
}
}
if (dump_file)
fprintf (dump_file, "[codegen] copying from bb_%d to bb_%d.\n",
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
bb->index, new_bb->index);
vec <basic_block> *copied_bbs = region->copied_bb_map->get (bb);
if (copied_bbs)
copied_bbs->safe_push (new_bb);
else
{
vec<basic_block> bbs;
bbs.create (2);
bbs.safe_push (new_bb);
region->copied_bb_map->put (bb, bbs);
}
if (!graphite_copy_stmts_from_block (bb, new_bb, iv_map))
{
codegen_error = true;
return NULL;
}
return single_succ_edge (new_bb);
}
/* Patch the missing arguments of the phi nodes. */
void translate_isl_ast_to_gimple::
translate_pending_phi_nodes ()
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
{
int i;
phi_rename *rename;
FOR_EACH_VEC_ELT (region->incomplete_phis, i, rename)
{
gphi *old_phi = rename->first;
gphi *new_phi = rename->second;
basic_block old_bb = gimple_bb (old_phi);
basic_block new_bb = gimple_bb (new_phi);
/* First edge is the init edge and second is the back edge. */
init_back_edge_pair_t ibp_old_bb = get_edges (old_bb);
init_back_edge_pair_t ibp_new_bb = get_edges (new_bb);
if (dump_file)
{
fprintf (dump_file, "[codegen] translating pending old-phi: ");
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
print_gimple_stmt (dump_file, old_phi, 0, 0);
}
auto_vec <tree, 1> iv_map;
if (bb_contains_loop_phi_nodes (new_bb))
codegen_error = !copy_loop_phi_args (old_phi, ibp_old_bb, new_phi,
ibp_new_bb, false);
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
else if (bb_contains_loop_close_phi_nodes (new_bb))
codegen_error = !copy_loop_close_phi_args (old_bb, new_bb, false);
else
codegen_error = !copy_cond_phi_args (old_phi, new_phi, iv_map, false);
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
if (dump_file)
{
fprintf (dump_file, "[codegen] to new-phi: ");
print_gimple_stmt (dump_file, new_phi, 0, 0);
}
if (codegen_error_p ())
return;
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
}
}
2015-12-17 19:50:05 +01:00
/* Add isl's parameter identifiers and corresponding trees to ivs_params. */
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
void translate_isl_ast_to_gimple::
add_parameters_to_ivs_params (scop_p scop, ivs_params &ip)
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
{
sese_info_p region = scop->scop_info;
unsigned nb_parameters = isl_set_dim (scop->param_context, isl_dim_param);
gcc_assert (nb_parameters == region->params.length ());
unsigned i;
for (i = 0; i < nb_parameters; i++)
{
isl_id *tmp_id = isl_set_get_dim_id (scop->param_context,
isl_dim_param, i);
ip[tmp_id] = region->params[i];
}
}
/* Generates a build, which specifies the constraints on the parameters. */
__isl_give isl_ast_build *translate_isl_ast_to_gimple::
generate_isl_context (scop_p scop)
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
{
isl_set *context_isl = isl_set_params (isl_set_copy (scop->param_context));
return isl_ast_build_from_context (context_isl);
}
new scop schedule for isl-0.15 Keep unchanged the implementation for isl-0.14. * graphite-poly.c (apply_poly_transforms): Simplify. (print_isl_set): Use more readable format: ISL_YAML_STYLE_BLOCK. (print_isl_map): Same. (print_isl_union_map): Same. (print_isl_schedule): New. (debug_isl_schedule): New. * graphite-dependences.c (scop_get_reads): Do not call isl_union_map_add_map that is undocumented isl functionality. (scop_get_must_writes): Same. (scop_get_may_writes): Same. (scop_get_original_schedule): Remove. (scop_get_dependences): Do not call isl_union_map_compute_flow that is deprecated in isl 0.15. Instead, use isl_union_access_* interface. (compute_deps): Remove. * graphite-isl-ast-to-gimple.c (print_schedule_ast): New. (debug_schedule_ast): New. (translate_isl_ast_to_gimple::scop_to_isl_ast): Call set_separate_option. (graphite_regenerate_ast_isl): Add dump. (translate_isl_ast_to_gimple::scop_to_isl_ast): Generate code from scop->transformed_schedule. (graphite_regenerate_ast_isl): Add more dump. * graphite-optimize-isl.c (optimize_isl): Set scop->transformed_schedule. Check whether schedules are equal. (apply_poly_transforms): Move here. * graphite-poly.c (apply_poly_transforms): ... from here. (free_poly_bb): Static. (free_scop): Static. (pbb_number_of_iterations_at_time): Remove. (print_isl_ast): New. (debug_isl_ast): New. (debug_scop_pbb): New. * graphite-scop-detection.c (print_edge): Move. (print_sese): Move. * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons): Remove. (build_scop_scattering): Remove. (create_pw_aff_from_tree): Assert instead of bailing out. (add_condition_to_pbb): Remove unused code, do not fail. (add_conditions_to_domain): Same. (add_conditions_to_constraints): Remove. (build_scop_context): New. (add_iter_domain_dimension): New. (build_iteration_domains): Initialize pbb->iterators. Call add_conditions_to_domain. (nested_in): New. (loop_at): New. (index_outermost_in_loop): New. (index_pbb_in_loop): New. (outermost_pbb_in): New. (add_in_sequence): New. (add_outer_projection): New. (outer_projection_mupa): New. (add_loop_schedule): New. (build_schedule_pbb): New. (build_schedule_loop): New. (embed_in_surrounding_loops): New. (build_schedule_loop_nest): New. (build_original_schedule): New. (build_poly_scop): Call build_original_schedule. * graphite.h: Declare print_isl_schedule and debug_isl_schedule. (free_poly_dr): Remove. (struct poly_bb): Add iterators. Remove schedule, transformed, saved. (free_poly_bb): Remove. (debug_loop_vec): Remove. (print_isl_ast): Declare. (debug_isl_ast): Declare. (scop_do_interchange): Remove. (scop_do_strip_mine): Remove. (scop_do_block): Remove. (flatten_all_loops): Remove. (optimize_isl): Remove. (pbb_number_of_iterations_at_time): Remove. (debug_scop_pbb): Declare. (print_schedule_ast): Declare. (debug_schedule_ast): Declare. (struct scop): Remove schedule. Add original_schedule, transformed_schedule. (free_gimple_poly_bb): Remove. (print_generated_program): Remove. (debug_generated_program): Remove. (unify_scattering_dimensions): Remove. * sese.c (print_edge): ... here. (print_sese): ... here. (debug_edge): ... here. (debug_sese): ... here. * sese.h (print_edge): Declare. (print_sese): Declare. (dump_edge): Declare. (dump_sese): Declare. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r232812
2016-01-26 01:19:20 +01:00
/* This method is executed before the construction of a for node. */
__isl_give isl_id *
ast_build_before_for (__isl_keep isl_ast_build *build, void *user)
{
isl_union_map *dependences = (isl_union_map *) user;
ast_build_info *for_info = XNEW (struct ast_build_info);
isl_union_map *schedule = isl_ast_build_get_schedule (build);
isl_space *schedule_space = isl_ast_build_get_schedule_space (build);
int dimension = isl_space_dim (schedule_space, isl_dim_out);
for_info->is_parallelizable =
!carries_deps (schedule, dependences, dimension);
isl_union_map_free (schedule);
isl_space_free (schedule_space);
isl_id *id = isl_id_alloc (isl_ast_build_get_ctx (build), "", for_info);
return id;
}
#ifdef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
/* Generate isl AST from schedule of SCOP. */
__isl_give isl_ast_node *translate_isl_ast_to_gimple::
scop_to_isl_ast (scop_p scop)
new scop schedule for isl-0.15 Keep unchanged the implementation for isl-0.14. * graphite-poly.c (apply_poly_transforms): Simplify. (print_isl_set): Use more readable format: ISL_YAML_STYLE_BLOCK. (print_isl_map): Same. (print_isl_union_map): Same. (print_isl_schedule): New. (debug_isl_schedule): New. * graphite-dependences.c (scop_get_reads): Do not call isl_union_map_add_map that is undocumented isl functionality. (scop_get_must_writes): Same. (scop_get_may_writes): Same. (scop_get_original_schedule): Remove. (scop_get_dependences): Do not call isl_union_map_compute_flow that is deprecated in isl 0.15. Instead, use isl_union_access_* interface. (compute_deps): Remove. * graphite-isl-ast-to-gimple.c (print_schedule_ast): New. (debug_schedule_ast): New. (translate_isl_ast_to_gimple::scop_to_isl_ast): Call set_separate_option. (graphite_regenerate_ast_isl): Add dump. (translate_isl_ast_to_gimple::scop_to_isl_ast): Generate code from scop->transformed_schedule. (graphite_regenerate_ast_isl): Add more dump. * graphite-optimize-isl.c (optimize_isl): Set scop->transformed_schedule. Check whether schedules are equal. (apply_poly_transforms): Move here. * graphite-poly.c (apply_poly_transforms): ... from here. (free_poly_bb): Static. (free_scop): Static. (pbb_number_of_iterations_at_time): Remove. (print_isl_ast): New. (debug_isl_ast): New. (debug_scop_pbb): New. * graphite-scop-detection.c (print_edge): Move. (print_sese): Move. * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons): Remove. (build_scop_scattering): Remove. (create_pw_aff_from_tree): Assert instead of bailing out. (add_condition_to_pbb): Remove unused code, do not fail. (add_conditions_to_domain): Same. (add_conditions_to_constraints): Remove. (build_scop_context): New. (add_iter_domain_dimension): New. (build_iteration_domains): Initialize pbb->iterators. Call add_conditions_to_domain. (nested_in): New. (loop_at): New. (index_outermost_in_loop): New. (index_pbb_in_loop): New. (outermost_pbb_in): New. (add_in_sequence): New. (add_outer_projection): New. (outer_projection_mupa): New. (add_loop_schedule): New. (build_schedule_pbb): New. (build_schedule_loop): New. (embed_in_surrounding_loops): New. (build_schedule_loop_nest): New. (build_original_schedule): New. (build_poly_scop): Call build_original_schedule. * graphite.h: Declare print_isl_schedule and debug_isl_schedule. (free_poly_dr): Remove. (struct poly_bb): Add iterators. Remove schedule, transformed, saved. (free_poly_bb): Remove. (debug_loop_vec): Remove. (print_isl_ast): Declare. (debug_isl_ast): Declare. (scop_do_interchange): Remove. (scop_do_strip_mine): Remove. (scop_do_block): Remove. (flatten_all_loops): Remove. (optimize_isl): Remove. (pbb_number_of_iterations_at_time): Remove. (debug_scop_pbb): Declare. (print_schedule_ast): Declare. (debug_schedule_ast): Declare. (struct scop): Remove schedule. Add original_schedule, transformed_schedule. (free_gimple_poly_bb): Remove. (print_generated_program): Remove. (debug_generated_program): Remove. (unify_scattering_dimensions): Remove. * sese.c (print_edge): ... here. (print_sese): ... here. (debug_edge): ... here. (debug_sese): ... here. * sese.h (print_edge): Declare. (print_sese): Declare. (dump_edge): Declare. (dump_sese): Declare. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r232812
2016-01-26 01:19:20 +01:00
{
gcc_assert (scop->transformed_schedule);
/* Set the separate option to reduce control flow overhead. */
isl_schedule *schedule = isl_schedule_map_schedule_node_bottom_up
(isl_schedule_copy (scop->transformed_schedule), set_separate_option, NULL);
isl_ast_build *context_isl = generate_isl_context (scop);
if (flag_loop_parallelize_all)
{
scop_get_dependences (scop);
context_isl =
isl_ast_build_set_before_each_for (context_isl, ast_build_before_for,
scop->dependence);
}
isl_ast_node *ast_isl = isl_ast_build_node_from_schedule
(context_isl, schedule);
isl_ast_build_free (context_isl);
return ast_isl;
}
#else
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
/* Get the maximal number of schedule dimensions in the scop SCOP. */
int translate_isl_ast_to_gimple::
get_max_schedule_dimensions (scop_p scop)
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
{
int i;
poly_bb_p pbb;
int schedule_dims = 0;
FOR_EACH_VEC_ELT (scop->pbbs, i, pbb)
{
int pbb_schedule_dims = isl_map_dim (pbb->transformed, isl_dim_out);
if (pbb_schedule_dims > schedule_dims)
schedule_dims = pbb_schedule_dims;
}
return schedule_dims;
}
/* Extend the schedule to NB_SCHEDULE_DIMS schedule dimensions.
For schedules with different dimensionality, the isl AST generator can not
define an order and will just randomly choose an order. The solution to this
problem is to extend all schedules to the maximal number of schedule
dimensions (using '0's for the remaining values). */
__isl_give isl_map *translate_isl_ast_to_gimple::
extend_schedule (__isl_take isl_map *schedule, int nb_schedule_dims)
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
{
int tmp_dims = isl_map_dim (schedule, isl_dim_out);
schedule =
isl_map_add_dims (schedule, isl_dim_out, nb_schedule_dims - tmp_dims);
isl_val *zero =
isl_val_int_from_si (isl_map_get_ctx (schedule), 0);
int i;
for (i = tmp_dims; i < nb_schedule_dims; i++)
{
schedule
= isl_map_fix_val (schedule, isl_dim_out, i, isl_val_copy (zero));
}
isl_val_free (zero);
return schedule;
}
/* Generates a schedule, which specifies an order used to
visit elements in a domain. */
__isl_give isl_union_map *translate_isl_ast_to_gimple::
generate_isl_schedule (scop_p scop)
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
{
int nb_schedule_dims = get_max_schedule_dimensions (scop);
int i;
poly_bb_p pbb;
isl_union_map *schedule_isl =
isl_union_map_empty (isl_set_get_space (scop->param_context));
FOR_EACH_VEC_ELT (scop->pbbs, i, pbb)
{
/* Dead code elimination: when the domain of a PBB is empty,
don't generate code for the PBB. */
if (isl_set_is_empty (pbb->domain))
continue;
isl_map *bb_schedule = isl_map_copy (pbb->transformed);
bb_schedule = isl_map_intersect_domain (bb_schedule,
isl_set_copy (pbb->domain));
bb_schedule = extend_schedule (bb_schedule, nb_schedule_dims);
bb_schedule = isl_map_coalesce (bb_schedule);
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
schedule_isl
= isl_union_map_union (schedule_isl,
isl_union_map_from_map (bb_schedule));
schedule_isl = isl_union_map_coalesce (schedule_isl);
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
}
return schedule_isl;
}
/* Set the separate option for all dimensions.
This helps to reduce control overhead. */
__isl_give isl_ast_build *translate_isl_ast_to_gimple::
set_options (__isl_take isl_ast_build *control,
__isl_keep isl_union_map *schedule)
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
{
isl_ctx *ctx = isl_union_map_get_ctx (schedule);
isl_space *range_space = isl_space_set_alloc (ctx, 0, 1);
range_space =
isl_space_set_tuple_name (range_space, isl_dim_set, "separate");
isl_union_set *range =
isl_union_set_from_set (isl_set_universe (range_space));
isl_union_set *domain = isl_union_map_range (isl_union_map_copy (schedule));
domain = isl_union_set_universe (domain);
isl_union_map *options = isl_union_map_from_domain_and_range (domain, range);
return isl_ast_build_set_options (control, options);
}
/* Generate isl AST from schedule of SCOP. Also, collects IVS_PARAMS in IP. */
__isl_give isl_ast_node *translate_isl_ast_to_gimple::
scop_to_isl_ast (scop_p scop, ivs_params &ip)
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
{
/* Generate loop upper bounds that consist of the current loop iterator, an
operator (< or <=) and an expression not involving the iterator. If this
option is not set, then the current loop iterator may appear several times
in the upper bound. See the isl manual for more details. */
isl_options_set_ast_build_atomic_upper_bound (scop->isl_context, true);
add_parameters_to_ivs_params (scop, ip);
isl_union_map *schedule_isl = generate_isl_schedule (scop);
isl_ast_build *context_isl = generate_isl_context (scop);
context_isl = set_options (context_isl, schedule_isl);
if (flag_loop_parallelize_all)
{
isl_union_map *dependence = scop_get_dependences (scop);
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
context_isl =
isl_ast_build_set_before_each_for (context_isl, ast_build_before_for,
dependence);
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
}
new scop schedule for isl-0.15 Keep unchanged the implementation for isl-0.14. * graphite-poly.c (apply_poly_transforms): Simplify. (print_isl_set): Use more readable format: ISL_YAML_STYLE_BLOCK. (print_isl_map): Same. (print_isl_union_map): Same. (print_isl_schedule): New. (debug_isl_schedule): New. * graphite-dependences.c (scop_get_reads): Do not call isl_union_map_add_map that is undocumented isl functionality. (scop_get_must_writes): Same. (scop_get_may_writes): Same. (scop_get_original_schedule): Remove. (scop_get_dependences): Do not call isl_union_map_compute_flow that is deprecated in isl 0.15. Instead, use isl_union_access_* interface. (compute_deps): Remove. * graphite-isl-ast-to-gimple.c (print_schedule_ast): New. (debug_schedule_ast): New. (translate_isl_ast_to_gimple::scop_to_isl_ast): Call set_separate_option. (graphite_regenerate_ast_isl): Add dump. (translate_isl_ast_to_gimple::scop_to_isl_ast): Generate code from scop->transformed_schedule. (graphite_regenerate_ast_isl): Add more dump. * graphite-optimize-isl.c (optimize_isl): Set scop->transformed_schedule. Check whether schedules are equal. (apply_poly_transforms): Move here. * graphite-poly.c (apply_poly_transforms): ... from here. (free_poly_bb): Static. (free_scop): Static. (pbb_number_of_iterations_at_time): Remove. (print_isl_ast): New. (debug_isl_ast): New. (debug_scop_pbb): New. * graphite-scop-detection.c (print_edge): Move. (print_sese): Move. * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons): Remove. (build_scop_scattering): Remove. (create_pw_aff_from_tree): Assert instead of bailing out. (add_condition_to_pbb): Remove unused code, do not fail. (add_conditions_to_domain): Same. (add_conditions_to_constraints): Remove. (build_scop_context): New. (add_iter_domain_dimension): New. (build_iteration_domains): Initialize pbb->iterators. Call add_conditions_to_domain. (nested_in): New. (loop_at): New. (index_outermost_in_loop): New. (index_pbb_in_loop): New. (outermost_pbb_in): New. (add_in_sequence): New. (add_outer_projection): New. (outer_projection_mupa): New. (add_loop_schedule): New. (build_schedule_pbb): New. (build_schedule_loop): New. (embed_in_surrounding_loops): New. (build_schedule_loop_nest): New. (build_original_schedule): New. (build_poly_scop): Call build_original_schedule. * graphite.h: Declare print_isl_schedule and debug_isl_schedule. (free_poly_dr): Remove. (struct poly_bb): Add iterators. Remove schedule, transformed, saved. (free_poly_bb): Remove. (debug_loop_vec): Remove. (print_isl_ast): Declare. (debug_isl_ast): Declare. (scop_do_interchange): Remove. (scop_do_strip_mine): Remove. (scop_do_block): Remove. (flatten_all_loops): Remove. (optimize_isl): Remove. (pbb_number_of_iterations_at_time): Remove. (debug_scop_pbb): Declare. (print_schedule_ast): Declare. (debug_schedule_ast): Declare. (struct scop): Remove schedule. Add original_schedule, transformed_schedule. (free_gimple_poly_bb): Remove. (print_generated_program): Remove. (debug_generated_program): Remove. (unify_scattering_dimensions): Remove. * sese.c (print_edge): ... here. (print_sese): ... here. (debug_edge): ... here. (debug_sese): ... here. * sese.h (print_edge): Declare. (print_sese): Declare. (dump_edge): Declare. (dump_sese): Declare. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r232812
2016-01-26 01:19:20 +01:00
isl_ast_node *ast_isl = isl_ast_build_ast_from_schedule (context_isl,
schedule_isl);
if (scop->schedule)
{
new scop schedule for isl-0.15 Keep unchanged the implementation for isl-0.14. * graphite-poly.c (apply_poly_transforms): Simplify. (print_isl_set): Use more readable format: ISL_YAML_STYLE_BLOCK. (print_isl_map): Same. (print_isl_union_map): Same. (print_isl_schedule): New. (debug_isl_schedule): New. * graphite-dependences.c (scop_get_reads): Do not call isl_union_map_add_map that is undocumented isl functionality. (scop_get_must_writes): Same. (scop_get_may_writes): Same. (scop_get_original_schedule): Remove. (scop_get_dependences): Do not call isl_union_map_compute_flow that is deprecated in isl 0.15. Instead, use isl_union_access_* interface. (compute_deps): Remove. * graphite-isl-ast-to-gimple.c (print_schedule_ast): New. (debug_schedule_ast): New. (translate_isl_ast_to_gimple::scop_to_isl_ast): Call set_separate_option. (graphite_regenerate_ast_isl): Add dump. (translate_isl_ast_to_gimple::scop_to_isl_ast): Generate code from scop->transformed_schedule. (graphite_regenerate_ast_isl): Add more dump. * graphite-optimize-isl.c (optimize_isl): Set scop->transformed_schedule. Check whether schedules are equal. (apply_poly_transforms): Move here. * graphite-poly.c (apply_poly_transforms): ... from here. (free_poly_bb): Static. (free_scop): Static. (pbb_number_of_iterations_at_time): Remove. (print_isl_ast): New. (debug_isl_ast): New. (debug_scop_pbb): New. * graphite-scop-detection.c (print_edge): Move. (print_sese): Move. * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons): Remove. (build_scop_scattering): Remove. (create_pw_aff_from_tree): Assert instead of bailing out. (add_condition_to_pbb): Remove unused code, do not fail. (add_conditions_to_domain): Same. (add_conditions_to_constraints): Remove. (build_scop_context): New. (add_iter_domain_dimension): New. (build_iteration_domains): Initialize pbb->iterators. Call add_conditions_to_domain. (nested_in): New. (loop_at): New. (index_outermost_in_loop): New. (index_pbb_in_loop): New. (outermost_pbb_in): New. (add_in_sequence): New. (add_outer_projection): New. (outer_projection_mupa): New. (add_loop_schedule): New. (build_schedule_pbb): New. (build_schedule_loop): New. (embed_in_surrounding_loops): New. (build_schedule_loop_nest): New. (build_original_schedule): New. (build_poly_scop): Call build_original_schedule. * graphite.h: Declare print_isl_schedule and debug_isl_schedule. (free_poly_dr): Remove. (struct poly_bb): Add iterators. Remove schedule, transformed, saved. (free_poly_bb): Remove. (debug_loop_vec): Remove. (print_isl_ast): Declare. (debug_isl_ast): Declare. (scop_do_interchange): Remove. (scop_do_strip_mine): Remove. (scop_do_block): Remove. (flatten_all_loops): Remove. (optimize_isl): Remove. (pbb_number_of_iterations_at_time): Remove. (debug_scop_pbb): Declare. (print_schedule_ast): Declare. (debug_schedule_ast): Declare. (struct scop): Remove schedule. Add original_schedule, transformed_schedule. (free_gimple_poly_bb): Remove. (print_generated_program): Remove. (debug_generated_program): Remove. (unify_scattering_dimensions): Remove. * sese.c (print_edge): ... here. (print_sese): ... here. (debug_edge): ... here. (debug_sese): ... here. * sese.h (print_edge): Declare. (print_sese): Declare. (dump_edge): Declare. (dump_sese): Declare. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r232812
2016-01-26 01:19:20 +01:00
isl_schedule_free (scop->schedule);
scop->schedule = NULL;
}
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
isl_ast_build_free (context_isl);
return ast_isl;
}
new scop schedule for isl-0.15 Keep unchanged the implementation for isl-0.14. * graphite-poly.c (apply_poly_transforms): Simplify. (print_isl_set): Use more readable format: ISL_YAML_STYLE_BLOCK. (print_isl_map): Same. (print_isl_union_map): Same. (print_isl_schedule): New. (debug_isl_schedule): New. * graphite-dependences.c (scop_get_reads): Do not call isl_union_map_add_map that is undocumented isl functionality. (scop_get_must_writes): Same. (scop_get_may_writes): Same. (scop_get_original_schedule): Remove. (scop_get_dependences): Do not call isl_union_map_compute_flow that is deprecated in isl 0.15. Instead, use isl_union_access_* interface. (compute_deps): Remove. * graphite-isl-ast-to-gimple.c (print_schedule_ast): New. (debug_schedule_ast): New. (translate_isl_ast_to_gimple::scop_to_isl_ast): Call set_separate_option. (graphite_regenerate_ast_isl): Add dump. (translate_isl_ast_to_gimple::scop_to_isl_ast): Generate code from scop->transformed_schedule. (graphite_regenerate_ast_isl): Add more dump. * graphite-optimize-isl.c (optimize_isl): Set scop->transformed_schedule. Check whether schedules are equal. (apply_poly_transforms): Move here. * graphite-poly.c (apply_poly_transforms): ... from here. (free_poly_bb): Static. (free_scop): Static. (pbb_number_of_iterations_at_time): Remove. (print_isl_ast): New. (debug_isl_ast): New. (debug_scop_pbb): New. * graphite-scop-detection.c (print_edge): Move. (print_sese): Move. * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons): Remove. (build_scop_scattering): Remove. (create_pw_aff_from_tree): Assert instead of bailing out. (add_condition_to_pbb): Remove unused code, do not fail. (add_conditions_to_domain): Same. (add_conditions_to_constraints): Remove. (build_scop_context): New. (add_iter_domain_dimension): New. (build_iteration_domains): Initialize pbb->iterators. Call add_conditions_to_domain. (nested_in): New. (loop_at): New. (index_outermost_in_loop): New. (index_pbb_in_loop): New. (outermost_pbb_in): New. (add_in_sequence): New. (add_outer_projection): New. (outer_projection_mupa): New. (add_loop_schedule): New. (build_schedule_pbb): New. (build_schedule_loop): New. (embed_in_surrounding_loops): New. (build_schedule_loop_nest): New. (build_original_schedule): New. (build_poly_scop): Call build_original_schedule. * graphite.h: Declare print_isl_schedule and debug_isl_schedule. (free_poly_dr): Remove. (struct poly_bb): Add iterators. Remove schedule, transformed, saved. (free_poly_bb): Remove. (debug_loop_vec): Remove. (print_isl_ast): Declare. (debug_isl_ast): Declare. (scop_do_interchange): Remove. (scop_do_strip_mine): Remove. (scop_do_block): Remove. (flatten_all_loops): Remove. (optimize_isl): Remove. (pbb_number_of_iterations_at_time): Remove. (debug_scop_pbb): Declare. (print_schedule_ast): Declare. (debug_schedule_ast): Declare. (struct scop): Remove schedule. Add original_schedule, transformed_schedule. (free_gimple_poly_bb): Remove. (print_generated_program): Remove. (debug_generated_program): Remove. (unify_scattering_dimensions): Remove. * sese.c (print_edge): ... here. (print_sese): ... here. (debug_edge): ... here. (debug_sese): ... here. * sese.h (print_edge): Declare. (print_sese): Declare. (dump_edge): Declare. (dump_sese): Declare. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r232812
2016-01-26 01:19:20 +01:00
#endif
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
/* Copy def from sese REGION to the newly created TO_REGION. TR is defined by
DEF_STMT. GSI points to entry basic block of the TO_REGION. */
static void
copy_def (tree tr, gimple *def_stmt, sese_info_p region, sese_info_p to_region,
gimple_stmt_iterator *gsi)
{
if (!defined_in_sese_p (tr, region->region))
return;
ssa_op_iter iter;
use_operand_p use_p;
FOR_EACH_SSA_USE_OPERAND (use_p, def_stmt, iter, SSA_OP_USE)
{
tree use_tr = USE_FROM_PTR (use_p);
/* Do not copy parameters that have been generated in the header of the
scop. */
if (region->parameter_rename_map->get(use_tr))
continue;
gimple *def_of_use = SSA_NAME_DEF_STMT (use_tr);
if (!def_of_use)
continue;
copy_def (use_tr, def_of_use, region, to_region, gsi);
}
gimple *copy = gimple_copy (def_stmt);
gsi_insert_after (gsi, copy, GSI_NEW_STMT);
/* Create new names for all the definitions created by COPY and
add replacement mappings for each new name. */
def_operand_p def_p;
ssa_op_iter op_iter;
FOR_EACH_SSA_DEF_OPERAND (def_p, copy, op_iter, SSA_OP_ALL_DEFS)
{
tree old_name = DEF_FROM_PTR (def_p);
tree new_name = create_new_def_for (old_name, copy, def_p);
region->parameter_rename_map->put(old_name, new_name);
}
update_stmt (copy);
}
static void
copy_internal_parameters (sese_info_p region, sese_info_p to_region)
{
/* For all the parameters which definitino is in the if_region->false_region,
insert code on true_region (if_region->true_region->entry). */
int i;
tree tr;
gimple_stmt_iterator gsi = gsi_start_bb(to_region->region.entry->dest);
FOR_EACH_VEC_ELT (region->params, i, tr)
{
// If def is not in region.
gimple *def_stmt = SSA_NAME_DEF_STMT (tr);
if (def_stmt)
copy_def (tr, def_stmt, region, to_region, &gsi);
}
}
/* GIMPLE Loop Generator: generates loops in GIMPLE form for the given SCOP.
Return true if code generation succeeded. */
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
bool
graphite_regenerate_ast_isl (scop_p scop)
{
sese_info_p region = scop->scop_info;
translate_isl_ast_to_gimple t (region);
ifsese if_region = NULL;
isl_ast_node *root_node;
ivs_params ip;
timevar_push (TV_GRAPHITE_CODE_GEN);
new scop schedule for isl-0.15 Keep unchanged the implementation for isl-0.14. * graphite-poly.c (apply_poly_transforms): Simplify. (print_isl_set): Use more readable format: ISL_YAML_STYLE_BLOCK. (print_isl_map): Same. (print_isl_union_map): Same. (print_isl_schedule): New. (debug_isl_schedule): New. * graphite-dependences.c (scop_get_reads): Do not call isl_union_map_add_map that is undocumented isl functionality. (scop_get_must_writes): Same. (scop_get_may_writes): Same. (scop_get_original_schedule): Remove. (scop_get_dependences): Do not call isl_union_map_compute_flow that is deprecated in isl 0.15. Instead, use isl_union_access_* interface. (compute_deps): Remove. * graphite-isl-ast-to-gimple.c (print_schedule_ast): New. (debug_schedule_ast): New. (translate_isl_ast_to_gimple::scop_to_isl_ast): Call set_separate_option. (graphite_regenerate_ast_isl): Add dump. (translate_isl_ast_to_gimple::scop_to_isl_ast): Generate code from scop->transformed_schedule. (graphite_regenerate_ast_isl): Add more dump. * graphite-optimize-isl.c (optimize_isl): Set scop->transformed_schedule. Check whether schedules are equal. (apply_poly_transforms): Move here. * graphite-poly.c (apply_poly_transforms): ... from here. (free_poly_bb): Static. (free_scop): Static. (pbb_number_of_iterations_at_time): Remove. (print_isl_ast): New. (debug_isl_ast): New. (debug_scop_pbb): New. * graphite-scop-detection.c (print_edge): Move. (print_sese): Move. * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons): Remove. (build_scop_scattering): Remove. (create_pw_aff_from_tree): Assert instead of bailing out. (add_condition_to_pbb): Remove unused code, do not fail. (add_conditions_to_domain): Same. (add_conditions_to_constraints): Remove. (build_scop_context): New. (add_iter_domain_dimension): New. (build_iteration_domains): Initialize pbb->iterators. Call add_conditions_to_domain. (nested_in): New. (loop_at): New. (index_outermost_in_loop): New. (index_pbb_in_loop): New. (outermost_pbb_in): New. (add_in_sequence): New. (add_outer_projection): New. (outer_projection_mupa): New. (add_loop_schedule): New. (build_schedule_pbb): New. (build_schedule_loop): New. (embed_in_surrounding_loops): New. (build_schedule_loop_nest): New. (build_original_schedule): New. (build_poly_scop): Call build_original_schedule. * graphite.h: Declare print_isl_schedule and debug_isl_schedule. (free_poly_dr): Remove. (struct poly_bb): Add iterators. Remove schedule, transformed, saved. (free_poly_bb): Remove. (debug_loop_vec): Remove. (print_isl_ast): Declare. (debug_isl_ast): Declare. (scop_do_interchange): Remove. (scop_do_strip_mine): Remove. (scop_do_block): Remove. (flatten_all_loops): Remove. (optimize_isl): Remove. (pbb_number_of_iterations_at_time): Remove. (debug_scop_pbb): Declare. (print_schedule_ast): Declare. (debug_schedule_ast): Declare. (struct scop): Remove schedule. Add original_schedule, transformed_schedule. (free_gimple_poly_bb): Remove. (print_generated_program): Remove. (debug_generated_program): Remove. (unify_scattering_dimensions): Remove. * sese.c (print_edge): ... here. (print_sese): ... here. (debug_edge): ... here. (debug_sese): ... here. * sese.h (print_edge): Declare. (print_sese): Declare. (dump_edge): Declare. (dump_sese): Declare. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r232812
2016-01-26 01:19:20 +01:00
#ifdef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
t.add_parameters_to_ivs_params (scop, ip);
root_node = t.scop_to_isl_ast (scop);
#else
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
root_node = t.scop_to_isl_ast (scop, ip);
new scop schedule for isl-0.15 Keep unchanged the implementation for isl-0.14. * graphite-poly.c (apply_poly_transforms): Simplify. (print_isl_set): Use more readable format: ISL_YAML_STYLE_BLOCK. (print_isl_map): Same. (print_isl_union_map): Same. (print_isl_schedule): New. (debug_isl_schedule): New. * graphite-dependences.c (scop_get_reads): Do not call isl_union_map_add_map that is undocumented isl functionality. (scop_get_must_writes): Same. (scop_get_may_writes): Same. (scop_get_original_schedule): Remove. (scop_get_dependences): Do not call isl_union_map_compute_flow that is deprecated in isl 0.15. Instead, use isl_union_access_* interface. (compute_deps): Remove. * graphite-isl-ast-to-gimple.c (print_schedule_ast): New. (debug_schedule_ast): New. (translate_isl_ast_to_gimple::scop_to_isl_ast): Call set_separate_option. (graphite_regenerate_ast_isl): Add dump. (translate_isl_ast_to_gimple::scop_to_isl_ast): Generate code from scop->transformed_schedule. (graphite_regenerate_ast_isl): Add more dump. * graphite-optimize-isl.c (optimize_isl): Set scop->transformed_schedule. Check whether schedules are equal. (apply_poly_transforms): Move here. * graphite-poly.c (apply_poly_transforms): ... from here. (free_poly_bb): Static. (free_scop): Static. (pbb_number_of_iterations_at_time): Remove. (print_isl_ast): New. (debug_isl_ast): New. (debug_scop_pbb): New. * graphite-scop-detection.c (print_edge): Move. (print_sese): Move. * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons): Remove. (build_scop_scattering): Remove. (create_pw_aff_from_tree): Assert instead of bailing out. (add_condition_to_pbb): Remove unused code, do not fail. (add_conditions_to_domain): Same. (add_conditions_to_constraints): Remove. (build_scop_context): New. (add_iter_domain_dimension): New. (build_iteration_domains): Initialize pbb->iterators. Call add_conditions_to_domain. (nested_in): New. (loop_at): New. (index_outermost_in_loop): New. (index_pbb_in_loop): New. (outermost_pbb_in): New. (add_in_sequence): New. (add_outer_projection): New. (outer_projection_mupa): New. (add_loop_schedule): New. (build_schedule_pbb): New. (build_schedule_loop): New. (embed_in_surrounding_loops): New. (build_schedule_loop_nest): New. (build_original_schedule): New. (build_poly_scop): Call build_original_schedule. * graphite.h: Declare print_isl_schedule and debug_isl_schedule. (free_poly_dr): Remove. (struct poly_bb): Add iterators. Remove schedule, transformed, saved. (free_poly_bb): Remove. (debug_loop_vec): Remove. (print_isl_ast): Declare. (debug_isl_ast): Declare. (scop_do_interchange): Remove. (scop_do_strip_mine): Remove. (scop_do_block): Remove. (flatten_all_loops): Remove. (optimize_isl): Remove. (pbb_number_of_iterations_at_time): Remove. (debug_scop_pbb): Declare. (print_schedule_ast): Declare. (debug_schedule_ast): Declare. (struct scop): Remove schedule. Add original_schedule, transformed_schedule. (free_gimple_poly_bb): Remove. (print_generated_program): Remove. (debug_generated_program): Remove. (unify_scattering_dimensions): Remove. * sese.c (print_edge): ... here. (print_sese): ... here. (debug_edge): ... here. (debug_sese): ... here. * sese.h (print_edge): Declare. (print_sese): Declare. (dump_edge): Declare. (dump_sese): Declare. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r232812
2016-01-26 01:19:20 +01:00
#endif
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
if (dump_file && (dump_flags & TDF_DETAILS))
{
new scop schedule for isl-0.15 Keep unchanged the implementation for isl-0.14. * graphite-poly.c (apply_poly_transforms): Simplify. (print_isl_set): Use more readable format: ISL_YAML_STYLE_BLOCK. (print_isl_map): Same. (print_isl_union_map): Same. (print_isl_schedule): New. (debug_isl_schedule): New. * graphite-dependences.c (scop_get_reads): Do not call isl_union_map_add_map that is undocumented isl functionality. (scop_get_must_writes): Same. (scop_get_may_writes): Same. (scop_get_original_schedule): Remove. (scop_get_dependences): Do not call isl_union_map_compute_flow that is deprecated in isl 0.15. Instead, use isl_union_access_* interface. (compute_deps): Remove. * graphite-isl-ast-to-gimple.c (print_schedule_ast): New. (debug_schedule_ast): New. (translate_isl_ast_to_gimple::scop_to_isl_ast): Call set_separate_option. (graphite_regenerate_ast_isl): Add dump. (translate_isl_ast_to_gimple::scop_to_isl_ast): Generate code from scop->transformed_schedule. (graphite_regenerate_ast_isl): Add more dump. * graphite-optimize-isl.c (optimize_isl): Set scop->transformed_schedule. Check whether schedules are equal. (apply_poly_transforms): Move here. * graphite-poly.c (apply_poly_transforms): ... from here. (free_poly_bb): Static. (free_scop): Static. (pbb_number_of_iterations_at_time): Remove. (print_isl_ast): New. (debug_isl_ast): New. (debug_scop_pbb): New. * graphite-scop-detection.c (print_edge): Move. (print_sese): Move. * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons): Remove. (build_scop_scattering): Remove. (create_pw_aff_from_tree): Assert instead of bailing out. (add_condition_to_pbb): Remove unused code, do not fail. (add_conditions_to_domain): Same. (add_conditions_to_constraints): Remove. (build_scop_context): New. (add_iter_domain_dimension): New. (build_iteration_domains): Initialize pbb->iterators. Call add_conditions_to_domain. (nested_in): New. (loop_at): New. (index_outermost_in_loop): New. (index_pbb_in_loop): New. (outermost_pbb_in): New. (add_in_sequence): New. (add_outer_projection): New. (outer_projection_mupa): New. (add_loop_schedule): New. (build_schedule_pbb): New. (build_schedule_loop): New. (embed_in_surrounding_loops): New. (build_schedule_loop_nest): New. (build_original_schedule): New. (build_poly_scop): Call build_original_schedule. * graphite.h: Declare print_isl_schedule and debug_isl_schedule. (free_poly_dr): Remove. (struct poly_bb): Add iterators. Remove schedule, transformed, saved. (free_poly_bb): Remove. (debug_loop_vec): Remove. (print_isl_ast): Declare. (debug_isl_ast): Declare. (scop_do_interchange): Remove. (scop_do_strip_mine): Remove. (scop_do_block): Remove. (flatten_all_loops): Remove. (optimize_isl): Remove. (pbb_number_of_iterations_at_time): Remove. (debug_scop_pbb): Declare. (print_schedule_ast): Declare. (debug_schedule_ast): Declare. (struct scop): Remove schedule. Add original_schedule, transformed_schedule. (free_gimple_poly_bb): Remove. (print_generated_program): Remove. (debug_generated_program): Remove. (unify_scattering_dimensions): Remove. * sese.c (print_edge): ... here. (print_sese): ... here. (debug_edge): ... here. (debug_sese): ... here. * sese.h (print_edge): Declare. (print_sese): Declare. (dump_edge): Declare. (dump_sese): Declare. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r232812
2016-01-26 01:19:20 +01:00
#ifdef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
fprintf (dump_file, "[scheduler] original schedule:\n");
print_isl_schedule (dump_file, scop->original_schedule);
fprintf (dump_file, "[scheduler] isl transformed schedule:\n");
print_isl_schedule (dump_file, scop->transformed_schedule);
fprintf (dump_file, "[scheduler] original ast:\n");
print_schedule_ast (dump_file, scop->original_schedule, scop);
#endif
fprintf (dump_file, "[scheduler] AST generated by isl:\n");
print_isl_ast (dump_file, root_node);
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
}
recompute_all_dominators ();
graphite_verify ();
if_region = move_sese_in_condition (region);
region->if_region = if_region;
recompute_all_dominators ();
loop_p context_loop = region->region.entry->src->loop_father;
/* Copy all the parameters which are defined in the region. */
copy_internal_parameters(if_region->false_region, if_region->true_region);
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
edge e = single_succ_edge (if_region->true_region->region.entry->dest);
basic_block bb = split_edge (e);
Preserve the original program while using graphite. Earlier, graphite used to translate portions of the original program after scop-detection in order to represent the SCoP into polyhedral model. This was required because each basic block was represented as independent basic block in the polyhedral model. So all the cross-basic-block dependencies were translated out-of-ssa. With this patch those dependencies are also exposed to the ISL, so there is no need to modify the original structure of the program. After this patch we should be able to enable graphite at some default optimization level. Highlights: Remove cross bb scalar to array translation For reductions, add support for more than just INT_CST Early bailout on codegen. Verify loop-closed ssa structure during copy of renames The uses of exprs should come from bb which dominates the bb Collect the init value of close phi in loop-guard Do not follow vuses for close-phi, postpone loop-close phi until the corresponding loop-phi is processed Bail out if no bb found to place cond/loop -phis Move insertion of liveouts at the end of codegen Insert loop-phis in the loop-header. This patch passes regtest and bootstrap with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' 2015-11-11 Aditya Kumar <aditya.k7@samsung.com> Sebastian Pop <s.pop@samsung.com> * graphite-isl-ast-to-gimple.c (class translate_isl_ast_to_gimple): New member codegen_error (translate_isl_ast_for_loop): Remove call to single_succ_edge and early return. (translate_isl_ast_node_user): Early return in case of error. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_to_gimple::translate_pending_phi_nodes): New. (add_parameters_to_ivs_params): Remove macro. (graphite_regenerate_ast_isl): Add if_region pointer to region. * graphite-poly.c (new_poly_dr): Remove macro. (print_pdr): Same. (new_gimple_poly_bb): Same. (free_gimple_poly_bb): Same. (print_scop_params): Same. * graphite-poly.h (struct poly_dr): Same. (struct poly_bb): Add new_bb. (gbb_from_bb): Remove dead code. (pbb_from_bb): Same. * graphite-scop-detection.c (parameter_index_in_region_1): Same. (parameter_index_in_region): Same. (find_scop_parameters): Same. (build_cross_bb_scalars_def): New. (build_cross_bb_scalars_use): New. (graphite_find_cross_bb_scalar_vars): New (try_generate_gimple_bb): Reads and Writes. (build_alias_set): Move. (gather_bbs::before_dom_children): Gather bbs visited. (build_scops): call build_alias_set. * graphite-sese-to-poly.c (phi_arg_in_outermost_loop): Delete. (remove_simple_copy_phi): Delete. (remove_invariant_phi): Delete. (simple_copy_phi_p): Delete. (reduction_phi_p): Delete. (isl_id_for_dr): Remove unused param. (parameter_index_in_region_1): Remove macro usage. (set_scop_parameter_dim): Same. (add_param_constraints): Same. (add_conditions_to_constraints): Same (build_scop_iteration_domain): Same. (pdr_add_alias_set): Comment. (add_scalar_version_numbers): New. (build_poly_dr): ISL id. (build_scop_drs): Move. (build_poly_sr_1): Same. (insert_stmts): Remove. (build_poly_sr): New. (new_pbb_from_pbb): Delete. (insert_out_of_ssa_copy_on_edge): Delete. (create_zero_dim_array): Delete. (scalar_close_phi_node_p): Delete. (propagate_expr_outside_region): Delete. (rewrite_close_phi_out_of_ssa): Delete. (rewrite_phi_out_of_ssa): Delete. (rewrite_degenerate_phi): Delete. (rewrite_reductions_out_of_ssa): Delete. (rewrite_cross_bb_scalar_dependence): Delete. (handle_scalar_deps_crossing_scop_limits): (rewrite_cross_bb_scalar_deps): Delete. (build_poly_scop): Remove calls to out-of-ssa functions. * graphite.c (graphite_transform_loops): Early return in case of codegen error. * sese.c (debug_rename_map_1): Delete. (debug_rename_map): Delete. (sese_record_loop): Remove macro. (build_sese_loop_nests): Same. (new_sese_info): Same. (free_sese_info): Same. (sese_insert_phis_for_liveouts): (is_loop_closed_ssa_use): New. (number_of_phi_nodes): New. (bb_contains_loop_close_phi_nodes): New. (bb_contains_loop_phi_nodes): New. (phi_uses_name): New. (is_valid_rename): (get_rename): Add old_bb and loop_phi for more precise matching of exprs. (set_rename): Pass region. (later_of_the_two): New. (gsi_insert_earliest): New. (collect_all_ssa_names): New. (substitute_ssa_name): New. (rename_all_uses): New. (get_rename_from_scev): New. (rename_uses): Pass old_bb for more precise matching of exprs. (get_def_bb_for_const): New. (get_new_name): New. (get_loc): New. (get_edges): New. (copy_loop_phi_args): New. (copy_loop_phi_nodes): New. (get_loop_init_value): New. (find_init_value): New. (find_init_value_close_phi): New. (copy_loop_close_phi_args): New. (copy_loop_close_phi_nodes): New. (add_phi_arg_for_new_expr): New. (copy_cond_phi_args): New. (copy_cond_phi_nodes): New. (copy_phi_nodes): New. (should_copy_to_new_region): New. (set_rename_for_each_def): New. (graphite_copy_stmts_from_block): Early return in case of error. (copy_bb_and_scalar_dependences): Same. * sese.h (vec_find): New. (SESE_PARAMS): Delete. (SESE_LOOPS): Delete. (SESE_LOOP_NEST): Delete. (sese_contains_loop): Remove macro usage. (sese_nb_params): Same. (struct gimple_poly_bb): Added read_scalar_refs, write_scalar_refs. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r230200
2015-11-12 01:37:47 +01:00
/* Update the true_region exit edge. */
region->if_region->true_region->region.exit = single_succ_edge (bb);
Preserve the original program while using graphite. Earlier, graphite used to translate portions of the original program after scop-detection in order to represent the SCoP into polyhedral model. This was required because each basic block was represented as independent basic block in the polyhedral model. So all the cross-basic-block dependencies were translated out-of-ssa. With this patch those dependencies are also exposed to the ISL, so there is no need to modify the original structure of the program. After this patch we should be able to enable graphite at some default optimization level. Highlights: Remove cross bb scalar to array translation For reductions, add support for more than just INT_CST Early bailout on codegen. Verify loop-closed ssa structure during copy of renames The uses of exprs should come from bb which dominates the bb Collect the init value of close phi in loop-guard Do not follow vuses for close-phi, postpone loop-close phi until the corresponding loop-phi is processed Bail out if no bb found to place cond/loop -phis Move insertion of liveouts at the end of codegen Insert loop-phis in the loop-header. This patch passes regtest and bootstrap with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' 2015-11-11 Aditya Kumar <aditya.k7@samsung.com> Sebastian Pop <s.pop@samsung.com> * graphite-isl-ast-to-gimple.c (class translate_isl_ast_to_gimple): New member codegen_error (translate_isl_ast_for_loop): Remove call to single_succ_edge and early return. (translate_isl_ast_node_user): Early return in case of error. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_to_gimple::translate_pending_phi_nodes): New. (add_parameters_to_ivs_params): Remove macro. (graphite_regenerate_ast_isl): Add if_region pointer to region. * graphite-poly.c (new_poly_dr): Remove macro. (print_pdr): Same. (new_gimple_poly_bb): Same. (free_gimple_poly_bb): Same. (print_scop_params): Same. * graphite-poly.h (struct poly_dr): Same. (struct poly_bb): Add new_bb. (gbb_from_bb): Remove dead code. (pbb_from_bb): Same. * graphite-scop-detection.c (parameter_index_in_region_1): Same. (parameter_index_in_region): Same. (find_scop_parameters): Same. (build_cross_bb_scalars_def): New. (build_cross_bb_scalars_use): New. (graphite_find_cross_bb_scalar_vars): New (try_generate_gimple_bb): Reads and Writes. (build_alias_set): Move. (gather_bbs::before_dom_children): Gather bbs visited. (build_scops): call build_alias_set. * graphite-sese-to-poly.c (phi_arg_in_outermost_loop): Delete. (remove_simple_copy_phi): Delete. (remove_invariant_phi): Delete. (simple_copy_phi_p): Delete. (reduction_phi_p): Delete. (isl_id_for_dr): Remove unused param. (parameter_index_in_region_1): Remove macro usage. (set_scop_parameter_dim): Same. (add_param_constraints): Same. (add_conditions_to_constraints): Same (build_scop_iteration_domain): Same. (pdr_add_alias_set): Comment. (add_scalar_version_numbers): New. (build_poly_dr): ISL id. (build_scop_drs): Move. (build_poly_sr_1): Same. (insert_stmts): Remove. (build_poly_sr): New. (new_pbb_from_pbb): Delete. (insert_out_of_ssa_copy_on_edge): Delete. (create_zero_dim_array): Delete. (scalar_close_phi_node_p): Delete. (propagate_expr_outside_region): Delete. (rewrite_close_phi_out_of_ssa): Delete. (rewrite_phi_out_of_ssa): Delete. (rewrite_degenerate_phi): Delete. (rewrite_reductions_out_of_ssa): Delete. (rewrite_cross_bb_scalar_dependence): Delete. (handle_scalar_deps_crossing_scop_limits): (rewrite_cross_bb_scalar_deps): Delete. (build_poly_scop): Remove calls to out-of-ssa functions. * graphite.c (graphite_transform_loops): Early return in case of codegen error. * sese.c (debug_rename_map_1): Delete. (debug_rename_map): Delete. (sese_record_loop): Remove macro. (build_sese_loop_nests): Same. (new_sese_info): Same. (free_sese_info): Same. (sese_insert_phis_for_liveouts): (is_loop_closed_ssa_use): New. (number_of_phi_nodes): New. (bb_contains_loop_close_phi_nodes): New. (bb_contains_loop_phi_nodes): New. (phi_uses_name): New. (is_valid_rename): (get_rename): Add old_bb and loop_phi for more precise matching of exprs. (set_rename): Pass region. (later_of_the_two): New. (gsi_insert_earliest): New. (collect_all_ssa_names): New. (substitute_ssa_name): New. (rename_all_uses): New. (get_rename_from_scev): New. (rename_uses): Pass old_bb for more precise matching of exprs. (get_def_bb_for_const): New. (get_new_name): New. (get_loc): New. (get_edges): New. (copy_loop_phi_args): New. (copy_loop_phi_nodes): New. (get_loop_init_value): New. (find_init_value): New. (find_init_value_close_phi): New. (copy_loop_close_phi_args): New. (copy_loop_close_phi_nodes): New. (add_phi_arg_for_new_expr): New. (copy_cond_phi_args): New. (copy_cond_phi_nodes): New. (copy_phi_nodes): New. (should_copy_to_new_region): New. (set_rename_for_each_def): New. (graphite_copy_stmts_from_block): Early return in case of error. (copy_bb_and_scalar_dependences): Same. * sese.h (vec_find): New. (SESE_PARAMS): Delete. (SESE_LOOPS): Delete. (SESE_LOOP_NEST): Delete. (sese_contains_loop): Remove macro usage. (sese_nb_params): Same. (struct gimple_poly_bb): Added read_scalar_refs, write_scalar_refs. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r230200
2015-11-12 01:37:47 +01:00
t.translate_isl_ast (context_loop, root_node, e, ip);
if (t.codegen_error_p ())
{
if (dump_file)
new scop schedule for isl-0.15 Keep unchanged the implementation for isl-0.14. * graphite-poly.c (apply_poly_transforms): Simplify. (print_isl_set): Use more readable format: ISL_YAML_STYLE_BLOCK. (print_isl_map): Same. (print_isl_union_map): Same. (print_isl_schedule): New. (debug_isl_schedule): New. * graphite-dependences.c (scop_get_reads): Do not call isl_union_map_add_map that is undocumented isl functionality. (scop_get_must_writes): Same. (scop_get_may_writes): Same. (scop_get_original_schedule): Remove. (scop_get_dependences): Do not call isl_union_map_compute_flow that is deprecated in isl 0.15. Instead, use isl_union_access_* interface. (compute_deps): Remove. * graphite-isl-ast-to-gimple.c (print_schedule_ast): New. (debug_schedule_ast): New. (translate_isl_ast_to_gimple::scop_to_isl_ast): Call set_separate_option. (graphite_regenerate_ast_isl): Add dump. (translate_isl_ast_to_gimple::scop_to_isl_ast): Generate code from scop->transformed_schedule. (graphite_regenerate_ast_isl): Add more dump. * graphite-optimize-isl.c (optimize_isl): Set scop->transformed_schedule. Check whether schedules are equal. (apply_poly_transforms): Move here. * graphite-poly.c (apply_poly_transforms): ... from here. (free_poly_bb): Static. (free_scop): Static. (pbb_number_of_iterations_at_time): Remove. (print_isl_ast): New. (debug_isl_ast): New. (debug_scop_pbb): New. * graphite-scop-detection.c (print_edge): Move. (print_sese): Move. * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons): Remove. (build_scop_scattering): Remove. (create_pw_aff_from_tree): Assert instead of bailing out. (add_condition_to_pbb): Remove unused code, do not fail. (add_conditions_to_domain): Same. (add_conditions_to_constraints): Remove. (build_scop_context): New. (add_iter_domain_dimension): New. (build_iteration_domains): Initialize pbb->iterators. Call add_conditions_to_domain. (nested_in): New. (loop_at): New. (index_outermost_in_loop): New. (index_pbb_in_loop): New. (outermost_pbb_in): New. (add_in_sequence): New. (add_outer_projection): New. (outer_projection_mupa): New. (add_loop_schedule): New. (build_schedule_pbb): New. (build_schedule_loop): New. (embed_in_surrounding_loops): New. (build_schedule_loop_nest): New. (build_original_schedule): New. (build_poly_scop): Call build_original_schedule. * graphite.h: Declare print_isl_schedule and debug_isl_schedule. (free_poly_dr): Remove. (struct poly_bb): Add iterators. Remove schedule, transformed, saved. (free_poly_bb): Remove. (debug_loop_vec): Remove. (print_isl_ast): Declare. (debug_isl_ast): Declare. (scop_do_interchange): Remove. (scop_do_strip_mine): Remove. (scop_do_block): Remove. (flatten_all_loops): Remove. (optimize_isl): Remove. (pbb_number_of_iterations_at_time): Remove. (debug_scop_pbb): Declare. (print_schedule_ast): Declare. (debug_schedule_ast): Declare. (struct scop): Remove schedule. Add original_schedule, transformed_schedule. (free_gimple_poly_bb): Remove. (print_generated_program): Remove. (debug_generated_program): Remove. (unify_scattering_dimensions): Remove. * sese.c (print_edge): ... here. (print_sese): ... here. (debug_edge): ... here. (debug_sese): ... here. * sese.h (print_edge): Declare. (print_sese): Declare. (dump_edge): Declare. (dump_sese): Declare. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r232812
2016-01-26 01:19:20 +01:00
fprintf (dump_file, "codegen error: "
"reverting back to the original code.\n");
Preserve the original program while using graphite. Earlier, graphite used to translate portions of the original program after scop-detection in order to represent the SCoP into polyhedral model. This was required because each basic block was represented as independent basic block in the polyhedral model. So all the cross-basic-block dependencies were translated out-of-ssa. With this patch those dependencies are also exposed to the ISL, so there is no need to modify the original structure of the program. After this patch we should be able to enable graphite at some default optimization level. Highlights: Remove cross bb scalar to array translation For reductions, add support for more than just INT_CST Early bailout on codegen. Verify loop-closed ssa structure during copy of renames The uses of exprs should come from bb which dominates the bb Collect the init value of close phi in loop-guard Do not follow vuses for close-phi, postpone loop-close phi until the corresponding loop-phi is processed Bail out if no bb found to place cond/loop -phis Move insertion of liveouts at the end of codegen Insert loop-phis in the loop-header. This patch passes regtest and bootstrap with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' 2015-11-11 Aditya Kumar <aditya.k7@samsung.com> Sebastian Pop <s.pop@samsung.com> * graphite-isl-ast-to-gimple.c (class translate_isl_ast_to_gimple): New member codegen_error (translate_isl_ast_for_loop): Remove call to single_succ_edge and early return. (translate_isl_ast_node_user): Early return in case of error. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_to_gimple::translate_pending_phi_nodes): New. (add_parameters_to_ivs_params): Remove macro. (graphite_regenerate_ast_isl): Add if_region pointer to region. * graphite-poly.c (new_poly_dr): Remove macro. (print_pdr): Same. (new_gimple_poly_bb): Same. (free_gimple_poly_bb): Same. (print_scop_params): Same. * graphite-poly.h (struct poly_dr): Same. (struct poly_bb): Add new_bb. (gbb_from_bb): Remove dead code. (pbb_from_bb): Same. * graphite-scop-detection.c (parameter_index_in_region_1): Same. (parameter_index_in_region): Same. (find_scop_parameters): Same. (build_cross_bb_scalars_def): New. (build_cross_bb_scalars_use): New. (graphite_find_cross_bb_scalar_vars): New (try_generate_gimple_bb): Reads and Writes. (build_alias_set): Move. (gather_bbs::before_dom_children): Gather bbs visited. (build_scops): call build_alias_set. * graphite-sese-to-poly.c (phi_arg_in_outermost_loop): Delete. (remove_simple_copy_phi): Delete. (remove_invariant_phi): Delete. (simple_copy_phi_p): Delete. (reduction_phi_p): Delete. (isl_id_for_dr): Remove unused param. (parameter_index_in_region_1): Remove macro usage. (set_scop_parameter_dim): Same. (add_param_constraints): Same. (add_conditions_to_constraints): Same (build_scop_iteration_domain): Same. (pdr_add_alias_set): Comment. (add_scalar_version_numbers): New. (build_poly_dr): ISL id. (build_scop_drs): Move. (build_poly_sr_1): Same. (insert_stmts): Remove. (build_poly_sr): New. (new_pbb_from_pbb): Delete. (insert_out_of_ssa_copy_on_edge): Delete. (create_zero_dim_array): Delete. (scalar_close_phi_node_p): Delete. (propagate_expr_outside_region): Delete. (rewrite_close_phi_out_of_ssa): Delete. (rewrite_phi_out_of_ssa): Delete. (rewrite_degenerate_phi): Delete. (rewrite_reductions_out_of_ssa): Delete. (rewrite_cross_bb_scalar_dependence): Delete. (handle_scalar_deps_crossing_scop_limits): (rewrite_cross_bb_scalar_deps): Delete. (build_poly_scop): Remove calls to out-of-ssa functions. * graphite.c (graphite_transform_loops): Early return in case of codegen error. * sese.c (debug_rename_map_1): Delete. (debug_rename_map): Delete. (sese_record_loop): Remove macro. (build_sese_loop_nests): Same. (new_sese_info): Same. (free_sese_info): Same. (sese_insert_phis_for_liveouts): (is_loop_closed_ssa_use): New. (number_of_phi_nodes): New. (bb_contains_loop_close_phi_nodes): New. (bb_contains_loop_phi_nodes): New. (phi_uses_name): New. (is_valid_rename): (get_rename): Add old_bb and loop_phi for more precise matching of exprs. (set_rename): Pass region. (later_of_the_two): New. (gsi_insert_earliest): New. (collect_all_ssa_names): New. (substitute_ssa_name): New. (rename_all_uses): New. (get_rename_from_scev): New. (rename_uses): Pass old_bb for more precise matching of exprs. (get_def_bb_for_const): New. (get_new_name): New. (get_loc): New. (get_edges): New. (copy_loop_phi_args): New. (copy_loop_phi_nodes): New. (get_loop_init_value): New. (find_init_value): New. (find_init_value_close_phi): New. (copy_loop_close_phi_args): New. (copy_loop_close_phi_nodes): New. (add_phi_arg_for_new_expr): New. (copy_cond_phi_args): New. (copy_cond_phi_nodes): New. (copy_phi_nodes): New. (should_copy_to_new_region): New. (set_rename_for_each_def): New. (graphite_copy_stmts_from_block): Early return in case of error. (copy_bb_and_scalar_dependences): Same. * sese.h (vec_find): New. (SESE_PARAMS): Delete. (SESE_LOOPS): Delete. (SESE_LOOP_NEST): Delete. (sese_contains_loop): Remove macro usage. (sese_nb_params): Same. (struct gimple_poly_bb): Added read_scalar_refs, write_scalar_refs. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r230200
2015-11-12 01:37:47 +01:00
set_ifsese_condition (if_region, integer_zero_node);
}
else
{
t.translate_pending_phi_nodes ();
if (!t.codegen_error_p ())
{
sese_insert_phis_for_liveouts (region,
if_region->region->region.exit->src,
if_region->false_region->region.exit,
if_region->true_region->region.exit);
mark_virtual_operands_for_renaming (cfun);
update_ssa (TODO_update_ssa);
graphite_verify ();
scev_reset ();
recompute_all_dominators ();
graphite_verify ();
new scop schedule for isl-0.15 Keep unchanged the implementation for isl-0.14. * graphite-poly.c (apply_poly_transforms): Simplify. (print_isl_set): Use more readable format: ISL_YAML_STYLE_BLOCK. (print_isl_map): Same. (print_isl_union_map): Same. (print_isl_schedule): New. (debug_isl_schedule): New. * graphite-dependences.c (scop_get_reads): Do not call isl_union_map_add_map that is undocumented isl functionality. (scop_get_must_writes): Same. (scop_get_may_writes): Same. (scop_get_original_schedule): Remove. (scop_get_dependences): Do not call isl_union_map_compute_flow that is deprecated in isl 0.15. Instead, use isl_union_access_* interface. (compute_deps): Remove. * graphite-isl-ast-to-gimple.c (print_schedule_ast): New. (debug_schedule_ast): New. (translate_isl_ast_to_gimple::scop_to_isl_ast): Call set_separate_option. (graphite_regenerate_ast_isl): Add dump. (translate_isl_ast_to_gimple::scop_to_isl_ast): Generate code from scop->transformed_schedule. (graphite_regenerate_ast_isl): Add more dump. * graphite-optimize-isl.c (optimize_isl): Set scop->transformed_schedule. Check whether schedules are equal. (apply_poly_transforms): Move here. * graphite-poly.c (apply_poly_transforms): ... from here. (free_poly_bb): Static. (free_scop): Static. (pbb_number_of_iterations_at_time): Remove. (print_isl_ast): New. (debug_isl_ast): New. (debug_scop_pbb): New. * graphite-scop-detection.c (print_edge): Move. (print_sese): Move. * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons): Remove. (build_scop_scattering): Remove. (create_pw_aff_from_tree): Assert instead of bailing out. (add_condition_to_pbb): Remove unused code, do not fail. (add_conditions_to_domain): Same. (add_conditions_to_constraints): Remove. (build_scop_context): New. (add_iter_domain_dimension): New. (build_iteration_domains): Initialize pbb->iterators. Call add_conditions_to_domain. (nested_in): New. (loop_at): New. (index_outermost_in_loop): New. (index_pbb_in_loop): New. (outermost_pbb_in): New. (add_in_sequence): New. (add_outer_projection): New. (outer_projection_mupa): New. (add_loop_schedule): New. (build_schedule_pbb): New. (build_schedule_loop): New. (embed_in_surrounding_loops): New. (build_schedule_loop_nest): New. (build_original_schedule): New. (build_poly_scop): Call build_original_schedule. * graphite.h: Declare print_isl_schedule and debug_isl_schedule. (free_poly_dr): Remove. (struct poly_bb): Add iterators. Remove schedule, transformed, saved. (free_poly_bb): Remove. (debug_loop_vec): Remove. (print_isl_ast): Declare. (debug_isl_ast): Declare. (scop_do_interchange): Remove. (scop_do_strip_mine): Remove. (scop_do_block): Remove. (flatten_all_loops): Remove. (optimize_isl): Remove. (pbb_number_of_iterations_at_time): Remove. (debug_scop_pbb): Declare. (print_schedule_ast): Declare. (debug_schedule_ast): Declare. (struct scop): Remove schedule. Add original_schedule, transformed_schedule. (free_gimple_poly_bb): Remove. (print_generated_program): Remove. (debug_generated_program): Remove. (unify_scattering_dimensions): Remove. * sese.c (print_edge): ... here. (print_sese): ... here. (debug_edge): ... here. (debug_sese): ... here. * sese.h (print_edge): Declare. (print_sese): Declare. (dump_edge): Declare. (dump_sese): Declare. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r232812
2016-01-26 01:19:20 +01:00
if (dump_file)
fprintf (dump_file, "[codegen] isl AST to Gimple succeeded.\n");
Preserve the original program while using graphite. Earlier, graphite used to translate portions of the original program after scop-detection in order to represent the SCoP into polyhedral model. This was required because each basic block was represented as independent basic block in the polyhedral model. So all the cross-basic-block dependencies were translated out-of-ssa. With this patch those dependencies are also exposed to the ISL, so there is no need to modify the original structure of the program. After this patch we should be able to enable graphite at some default optimization level. Highlights: Remove cross bb scalar to array translation For reductions, add support for more than just INT_CST Early bailout on codegen. Verify loop-closed ssa structure during copy of renames The uses of exprs should come from bb which dominates the bb Collect the init value of close phi in loop-guard Do not follow vuses for close-phi, postpone loop-close phi until the corresponding loop-phi is processed Bail out if no bb found to place cond/loop -phis Move insertion of liveouts at the end of codegen Insert loop-phis in the loop-header. This patch passes regtest and bootstrap with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' 2015-11-11 Aditya Kumar <aditya.k7@samsung.com> Sebastian Pop <s.pop@samsung.com> * graphite-isl-ast-to-gimple.c (class translate_isl_ast_to_gimple): New member codegen_error (translate_isl_ast_for_loop): Remove call to single_succ_edge and early return. (translate_isl_ast_node_user): Early return in case of error. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_to_gimple::translate_pending_phi_nodes): New. (add_parameters_to_ivs_params): Remove macro. (graphite_regenerate_ast_isl): Add if_region pointer to region. * graphite-poly.c (new_poly_dr): Remove macro. (print_pdr): Same. (new_gimple_poly_bb): Same. (free_gimple_poly_bb): Same. (print_scop_params): Same. * graphite-poly.h (struct poly_dr): Same. (struct poly_bb): Add new_bb. (gbb_from_bb): Remove dead code. (pbb_from_bb): Same. * graphite-scop-detection.c (parameter_index_in_region_1): Same. (parameter_index_in_region): Same. (find_scop_parameters): Same. (build_cross_bb_scalars_def): New. (build_cross_bb_scalars_use): New. (graphite_find_cross_bb_scalar_vars): New (try_generate_gimple_bb): Reads and Writes. (build_alias_set): Move. (gather_bbs::before_dom_children): Gather bbs visited. (build_scops): call build_alias_set. * graphite-sese-to-poly.c (phi_arg_in_outermost_loop): Delete. (remove_simple_copy_phi): Delete. (remove_invariant_phi): Delete. (simple_copy_phi_p): Delete. (reduction_phi_p): Delete. (isl_id_for_dr): Remove unused param. (parameter_index_in_region_1): Remove macro usage. (set_scop_parameter_dim): Same. (add_param_constraints): Same. (add_conditions_to_constraints): Same (build_scop_iteration_domain): Same. (pdr_add_alias_set): Comment. (add_scalar_version_numbers): New. (build_poly_dr): ISL id. (build_scop_drs): Move. (build_poly_sr_1): Same. (insert_stmts): Remove. (build_poly_sr): New. (new_pbb_from_pbb): Delete. (insert_out_of_ssa_copy_on_edge): Delete. (create_zero_dim_array): Delete. (scalar_close_phi_node_p): Delete. (propagate_expr_outside_region): Delete. (rewrite_close_phi_out_of_ssa): Delete. (rewrite_phi_out_of_ssa): Delete. (rewrite_degenerate_phi): Delete. (rewrite_reductions_out_of_ssa): Delete. (rewrite_cross_bb_scalar_dependence): Delete. (handle_scalar_deps_crossing_scop_limits): (rewrite_cross_bb_scalar_deps): Delete. (build_poly_scop): Remove calls to out-of-ssa functions. * graphite.c (graphite_transform_loops): Early return in case of codegen error. * sese.c (debug_rename_map_1): Delete. (debug_rename_map): Delete. (sese_record_loop): Remove macro. (build_sese_loop_nests): Same. (new_sese_info): Same. (free_sese_info): Same. (sese_insert_phis_for_liveouts): (is_loop_closed_ssa_use): New. (number_of_phi_nodes): New. (bb_contains_loop_close_phi_nodes): New. (bb_contains_loop_phi_nodes): New. (phi_uses_name): New. (is_valid_rename): (get_rename): Add old_bb and loop_phi for more precise matching of exprs. (set_rename): Pass region. (later_of_the_two): New. (gsi_insert_earliest): New. (collect_all_ssa_names): New. (substitute_ssa_name): New. (rename_all_uses): New. (get_rename_from_scev): New. (rename_uses): Pass old_bb for more precise matching of exprs. (get_def_bb_for_const): New. (get_new_name): New. (get_loc): New. (get_edges): New. (copy_loop_phi_args): New. (copy_loop_phi_nodes): New. (get_loop_init_value): New. (find_init_value): New. (find_init_value_close_phi): New. (copy_loop_close_phi_args): New. (copy_loop_close_phi_nodes): New. (add_phi_arg_for_new_expr): New. (copy_cond_phi_args): New. (copy_cond_phi_nodes): New. (copy_phi_nodes): New. (should_copy_to_new_region): New. (set_rename_for_each_def): New. (graphite_copy_stmts_from_block): Early return in case of error. (copy_bb_and_scalar_dependences): Same. * sese.h (vec_find): New. (SESE_PARAMS): Delete. (SESE_LOOPS): Delete. (SESE_LOOP_NEST): Delete. (sese_contains_loop): Remove macro usage. (sese_nb_params): Same. (struct gimple_poly_bb): Added read_scalar_refs, write_scalar_refs. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r230200
2015-11-12 01:37:47 +01:00
}
else
{
if (dump_file)
fprintf (dump_file, "[codegen] unsuccessful in translating"
" pending phis, reverting back to the original code.\n");
set_ifsese_condition (if_region, integer_zero_node);
}
Preserve the original program while using graphite. Earlier, graphite used to translate portions of the original program after scop-detection in order to represent the SCoP into polyhedral model. This was required because each basic block was represented as independent basic block in the polyhedral model. So all the cross-basic-block dependencies were translated out-of-ssa. With this patch those dependencies are also exposed to the ISL, so there is no need to modify the original structure of the program. After this patch we should be able to enable graphite at some default optimization level. Highlights: Remove cross bb scalar to array translation For reductions, add support for more than just INT_CST Early bailout on codegen. Verify loop-closed ssa structure during copy of renames The uses of exprs should come from bb which dominates the bb Collect the init value of close phi in loop-guard Do not follow vuses for close-phi, postpone loop-close phi until the corresponding loop-phi is processed Bail out if no bb found to place cond/loop -phis Move insertion of liveouts at the end of codegen Insert loop-phis in the loop-header. This patch passes regtest and bootstrap with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' 2015-11-11 Aditya Kumar <aditya.k7@samsung.com> Sebastian Pop <s.pop@samsung.com> * graphite-isl-ast-to-gimple.c (class translate_isl_ast_to_gimple): New member codegen_error (translate_isl_ast_for_loop): Remove call to single_succ_edge and early return. (translate_isl_ast_node_user): Early return in case of error. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_to_gimple::translate_pending_phi_nodes): New. (add_parameters_to_ivs_params): Remove macro. (graphite_regenerate_ast_isl): Add if_region pointer to region. * graphite-poly.c (new_poly_dr): Remove macro. (print_pdr): Same. (new_gimple_poly_bb): Same. (free_gimple_poly_bb): Same. (print_scop_params): Same. * graphite-poly.h (struct poly_dr): Same. (struct poly_bb): Add new_bb. (gbb_from_bb): Remove dead code. (pbb_from_bb): Same. * graphite-scop-detection.c (parameter_index_in_region_1): Same. (parameter_index_in_region): Same. (find_scop_parameters): Same. (build_cross_bb_scalars_def): New. (build_cross_bb_scalars_use): New. (graphite_find_cross_bb_scalar_vars): New (try_generate_gimple_bb): Reads and Writes. (build_alias_set): Move. (gather_bbs::before_dom_children): Gather bbs visited. (build_scops): call build_alias_set. * graphite-sese-to-poly.c (phi_arg_in_outermost_loop): Delete. (remove_simple_copy_phi): Delete. (remove_invariant_phi): Delete. (simple_copy_phi_p): Delete. (reduction_phi_p): Delete. (isl_id_for_dr): Remove unused param. (parameter_index_in_region_1): Remove macro usage. (set_scop_parameter_dim): Same. (add_param_constraints): Same. (add_conditions_to_constraints): Same (build_scop_iteration_domain): Same. (pdr_add_alias_set): Comment. (add_scalar_version_numbers): New. (build_poly_dr): ISL id. (build_scop_drs): Move. (build_poly_sr_1): Same. (insert_stmts): Remove. (build_poly_sr): New. (new_pbb_from_pbb): Delete. (insert_out_of_ssa_copy_on_edge): Delete. (create_zero_dim_array): Delete. (scalar_close_phi_node_p): Delete. (propagate_expr_outside_region): Delete. (rewrite_close_phi_out_of_ssa): Delete. (rewrite_phi_out_of_ssa): Delete. (rewrite_degenerate_phi): Delete. (rewrite_reductions_out_of_ssa): Delete. (rewrite_cross_bb_scalar_dependence): Delete. (handle_scalar_deps_crossing_scop_limits): (rewrite_cross_bb_scalar_deps): Delete. (build_poly_scop): Remove calls to out-of-ssa functions. * graphite.c (graphite_transform_loops): Early return in case of codegen error. * sese.c (debug_rename_map_1): Delete. (debug_rename_map): Delete. (sese_record_loop): Remove macro. (build_sese_loop_nests): Same. (new_sese_info): Same. (free_sese_info): Same. (sese_insert_phis_for_liveouts): (is_loop_closed_ssa_use): New. (number_of_phi_nodes): New. (bb_contains_loop_close_phi_nodes): New. (bb_contains_loop_phi_nodes): New. (phi_uses_name): New. (is_valid_rename): (get_rename): Add old_bb and loop_phi for more precise matching of exprs. (set_rename): Pass region. (later_of_the_two): New. (gsi_insert_earliest): New. (collect_all_ssa_names): New. (substitute_ssa_name): New. (rename_all_uses): New. (get_rename_from_scev): New. (rename_uses): Pass old_bb for more precise matching of exprs. (get_def_bb_for_const): New. (get_new_name): New. (get_loc): New. (get_edges): New. (copy_loop_phi_args): New. (copy_loop_phi_nodes): New. (get_loop_init_value): New. (find_init_value): New. (find_init_value_close_phi): New. (copy_loop_close_phi_args): New. (copy_loop_close_phi_nodes): New. (add_phi_arg_for_new_expr): New. (copy_cond_phi_args): New. (copy_cond_phi_nodes): New. (copy_phi_nodes): New. (should_copy_to_new_region): New. (set_rename_for_each_def): New. (graphite_copy_stmts_from_block): Early return in case of error. (copy_bb_and_scalar_dependences): Same. * sese.h (vec_find): New. (SESE_PARAMS): Delete. (SESE_LOOPS): Delete. (SESE_LOOP_NEST): Delete. (sese_contains_loop): Remove macro usage. (sese_nb_params): Same. (struct gimple_poly_bb): Added read_scalar_refs, write_scalar_refs. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r230200
2015-11-12 01:37:47 +01:00
}
free (if_region->true_region);
free (if_region->region);
free (if_region);
ivs_params_clear (ip);
isl_ast_node_free (root_node);
timevar_pop (TV_GRAPHITE_CODE_GEN);
if (dump_file && (dump_flags & TDF_DETAILS))
{
loop_p loop;
int num_no_dependency = 0;
FOR_EACH_LOOP (loop, 0)
if (loop->can_be_parallel)
num_no_dependency++;
fprintf (dump_file, "%d loops carried no dependency.\n",
num_no_dependency);
}
Preserve the original program while using graphite. Earlier, graphite used to translate portions of the original program after scop-detection in order to represent the SCoP into polyhedral model. This was required because each basic block was represented as independent basic block in the polyhedral model. So all the cross-basic-block dependencies were translated out-of-ssa. With this patch those dependencies are also exposed to the ISL, so there is no need to modify the original structure of the program. After this patch we should be able to enable graphite at some default optimization level. Highlights: Remove cross bb scalar to array translation For reductions, add support for more than just INT_CST Early bailout on codegen. Verify loop-closed ssa structure during copy of renames The uses of exprs should come from bb which dominates the bb Collect the init value of close phi in loop-guard Do not follow vuses for close-phi, postpone loop-close phi until the corresponding loop-phi is processed Bail out if no bb found to place cond/loop -phis Move insertion of liveouts at the end of codegen Insert loop-phis in the loop-header. This patch passes regtest and bootstrap with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' 2015-11-11 Aditya Kumar <aditya.k7@samsung.com> Sebastian Pop <s.pop@samsung.com> * graphite-isl-ast-to-gimple.c (class translate_isl_ast_to_gimple): New member codegen_error (translate_isl_ast_for_loop): Remove call to single_succ_edge and early return. (translate_isl_ast_node_user): Early return in case of error. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_to_gimple::translate_pending_phi_nodes): New. (add_parameters_to_ivs_params): Remove macro. (graphite_regenerate_ast_isl): Add if_region pointer to region. * graphite-poly.c (new_poly_dr): Remove macro. (print_pdr): Same. (new_gimple_poly_bb): Same. (free_gimple_poly_bb): Same. (print_scop_params): Same. * graphite-poly.h (struct poly_dr): Same. (struct poly_bb): Add new_bb. (gbb_from_bb): Remove dead code. (pbb_from_bb): Same. * graphite-scop-detection.c (parameter_index_in_region_1): Same. (parameter_index_in_region): Same. (find_scop_parameters): Same. (build_cross_bb_scalars_def): New. (build_cross_bb_scalars_use): New. (graphite_find_cross_bb_scalar_vars): New (try_generate_gimple_bb): Reads and Writes. (build_alias_set): Move. (gather_bbs::before_dom_children): Gather bbs visited. (build_scops): call build_alias_set. * graphite-sese-to-poly.c (phi_arg_in_outermost_loop): Delete. (remove_simple_copy_phi): Delete. (remove_invariant_phi): Delete. (simple_copy_phi_p): Delete. (reduction_phi_p): Delete. (isl_id_for_dr): Remove unused param. (parameter_index_in_region_1): Remove macro usage. (set_scop_parameter_dim): Same. (add_param_constraints): Same. (add_conditions_to_constraints): Same (build_scop_iteration_domain): Same. (pdr_add_alias_set): Comment. (add_scalar_version_numbers): New. (build_poly_dr): ISL id. (build_scop_drs): Move. (build_poly_sr_1): Same. (insert_stmts): Remove. (build_poly_sr): New. (new_pbb_from_pbb): Delete. (insert_out_of_ssa_copy_on_edge): Delete. (create_zero_dim_array): Delete. (scalar_close_phi_node_p): Delete. (propagate_expr_outside_region): Delete. (rewrite_close_phi_out_of_ssa): Delete. (rewrite_phi_out_of_ssa): Delete. (rewrite_degenerate_phi): Delete. (rewrite_reductions_out_of_ssa): Delete. (rewrite_cross_bb_scalar_dependence): Delete. (handle_scalar_deps_crossing_scop_limits): (rewrite_cross_bb_scalar_deps): Delete. (build_poly_scop): Remove calls to out-of-ssa functions. * graphite.c (graphite_transform_loops): Early return in case of codegen error. * sese.c (debug_rename_map_1): Delete. (debug_rename_map): Delete. (sese_record_loop): Remove macro. (build_sese_loop_nests): Same. (new_sese_info): Same. (free_sese_info): Same. (sese_insert_phis_for_liveouts): (is_loop_closed_ssa_use): New. (number_of_phi_nodes): New. (bb_contains_loop_close_phi_nodes): New. (bb_contains_loop_phi_nodes): New. (phi_uses_name): New. (is_valid_rename): (get_rename): Add old_bb and loop_phi for more precise matching of exprs. (set_rename): Pass region. (later_of_the_two): New. (gsi_insert_earliest): New. (collect_all_ssa_names): New. (substitute_ssa_name): New. (rename_all_uses): New. (get_rename_from_scev): New. (rename_uses): Pass old_bb for more precise matching of exprs. (get_def_bb_for_const): New. (get_new_name): New. (get_loc): New. (get_edges): New. (copy_loop_phi_args): New. (copy_loop_phi_nodes): New. (get_loop_init_value): New. (find_init_value): New. (find_init_value_close_phi): New. (copy_loop_close_phi_args): New. (copy_loop_close_phi_nodes): New. (add_phi_arg_for_new_expr): New. (copy_cond_phi_args): New. (copy_cond_phi_nodes): New. (copy_phi_nodes): New. (should_copy_to_new_region): New. (set_rename_for_each_def): New. (graphite_copy_stmts_from_block): Early return in case of error. (copy_bb_and_scalar_dependences): Same. * sese.h (vec_find): New. (SESE_PARAMS): Delete. (SESE_LOOPS): Delete. (SESE_LOOP_NEST): Delete. (sese_contains_loop): Remove macro usage. (sese_nb_params): Same. (struct gimple_poly_bb): Added read_scalar_refs, write_scalar_refs. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r230200
2015-11-12 01:37:47 +01:00
return !t.codegen_error_p ();
}
Move codegen related functions to graphite-isl-ast-to-gimple.c No functional changes intended. This patch passes regtest and bootstrap on linux-x86-64 with BOOT_CFLAGS='-O2 -fgraphite-identity -floop-nest-optimize' gcc/ChangeLog: 2015-11-14 hiraditya <hiraditya@msn.com> * graphite-isl-ast-to-gimple.c (struct ast_build_info): Remove semicolon. (class translate_isl_ast_to_gimple): Indentation. (translate_pending_phi_nodes): Comment. (add_parameters_to_ivs_params): Moved from sese.c inside class translate_isl_ast_to_gimple. (get_max_schedule_dimensions): Same. (generate_isl_context): Same. (extend_schedule): Same. (generate_isl_schedule): Same. (set_options): Same. (scop_to_isl_ast): Same. (is_valid_rename): Same. (get_rename): Same. (get_rename_from_scev): Same. (get_def_bb_for_const): Same. (get_new_name): Same. (collect_all_ssa_names): Same. (copy_loop_phi_args): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (add_phi_arg_for_new_expr): Same. (rename_uses): Same. (set_rename): Same. (set_rename_for_each_def): Same. (gsi_insert_earliest): Same. (rename_all_uses): Same. (codegen_error_p): Same. (print_isl_ast_node): Same. (translate_isl_ast_for_loop): Call function codegen_error_p. (translate_isl_ast_to_gimple::translate_isl_ast): Same. (translate_isl_ast_node_user): Make nb_loops const and release iv_map before exit. (get_true_edge_from_guard_bb): Move all free-functions early. (get_false_edge_from_guard_bb): Same. (bb_contains_loop_close_phi_nodes): Same. (bb_contains_loop_phi_nodes): Same. (is_loop_closed_ssa_use): Same. (number_of_phi_nodes): Same. (phi_uses_name): Same. (later_of_the_two): Same. (substitute_ssa_name): (get_edges): Same. (get_loc): Same. (get_loop_init_value): Same. (find_init_value): Same. (find_init_value_close_phi): Same. (ast_build_before_for): Same. (graphite_regenerate_ast_isl): Formatting changes. * graphite-scop-detection.c (build_cross_bb_scalars_use): Same. * sese.c (get_rename): Move to graphite-isl-ast-to-gimple.c (set_rename): Same. (gsi_insert_earliest): Same. (collect_all_ssa_names): Same. (rename_all_uses): Same. (rename_uses): Same. (get_def_bb_for_const): Same. (copy_loop_phi_nodes): Same. (copy_loop_close_phi_args): Same. (copy_loop_close_phi_nodes): Same. (copy_cond_phi_args): Same. (copy_cond_phi_nodes): Same. (set_rename_for_each_def): Same. (graphite_copy_stmts_from_block): Same. (copy_bb_and_scalar_dependences): Same. (if_region_set_false_region): Same. (scev_analyzable_p): Same. * sese.h: Delete extern functions moved to graphite-isl-ast-to-gimple.c From-SVN: r230566
2015-11-18 22:08:33 +01:00
#endif /* HAVE_isl */