2004-05-13 08:41:07 +02:00
|
|
|
/* SSA Dominator optimizations for trees
|
2015-01-05 13:33:28 +01:00
|
|
|
Copyright (C) 2001-2015 Free Software Foundation, Inc.
|
2004-05-13 08:41:07 +02:00
|
|
|
Contributed by Diego Novillo <dnovillo@redhat.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
|
2007-07-26 10:37:01 +02:00
|
|
|
the Free Software Foundation; either version 3, or (at your option)
|
2004-05-13 08:41:07 +02:00
|
|
|
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
|
2007-07-26 10:37:01 +02:00
|
|
|
along with GCC; see the file COPYING3. If not see
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
#include "system.h"
|
|
|
|
#include "coretypes.h"
|
2015-07-08 02:53:03 +02:00
|
|
|
#include "backend.h"
|
2015-07-10 14:13:06 +02:00
|
|
|
#include "cfghooks.h"
|
2004-05-13 08:41:07 +02:00
|
|
|
#include "tree.h"
|
2015-07-08 02:53:03 +02:00
|
|
|
#include "gimple.h"
|
|
|
|
#include "hard-reg-set.h"
|
|
|
|
#include "ssa.h"
|
|
|
|
#include "alias.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 "fold-const.h"
|
2013-11-19 13:31:09 +01:00
|
|
|
#include "stor-layout.h"
|
2004-05-13 08:41:07 +02:00
|
|
|
#include "flags.h"
|
|
|
|
#include "tm_p.h"
|
2014-10-27 13:41:01 +01:00
|
|
|
#include "cfganal.h"
|
|
|
|
#include "cfgloop.h"
|
diagnostic.c: Don't include tm.h, tree.h, tm_p.h, langhooks.h or langhooks-def.h.
* diagnostic.c: Don't include tm.h, tree.h, tm_p.h, langhooks.h or
langhooks-def.h.
(diagnostic_initialize): Initialize x_data not last_function.
(diagnostic_report_current_function): Move to tree-diagnostic.c.
(default_diagnostic_starter): Call
diagnostic_report_current_module not
diagnostic_report_current_function.
(diagnostic_report_diagnostic): Initialize x_data not
abstract_origin.
(verbatim): Likewise.
* diagnostic.h (struct diagnostic_info): Change abstract_origin to
x_data.
(struct diagnostic_context): Change last_function to x_data.
(diagnostic_auxiliary_data): Replace with
diagnostic_context_auxiliary_data and
diagnostic_info_auxiliary_data.
(diagnostic_last_function_changed, diagnostic_set_last_function,
diagnostic_report_current_function): Move to tree-diagnostic.h.
(print_declaration, dump_generic_node, print_generic_stmt,
print_generic_stmt_indented, print_generic_expr,
print_generic_decl, debug_c_tree, dump_omp_clauses,
print_call_name, debug_generic_expr, debug_generic_stmt,
debug_tree_chain, default_tree_printer): Move to
tree-pretty-print.h.
(debug_gimple_stmt, debug_gimple_seq, print_gimple_seq,
print_gimple_stmt, print_gimple_expr, dump_gimple_stmt): Move to
gimple-pretty-print.h.
* pretty-print.c: Don't include tree.h
(pp_base_format): Don't handle %K here.
(pp_base_tree_identifier): Move to tree-pretty-print.c.
* pretty-print.h (text_info): Change abstract_origin to x_data.
(pp_tree_identifier, pp_unsupported_tree,
pp_base_tree_identifier): Move to tree-pretty-print.h.
* gimple-pretty-print.h, tree-diagnostic.c, tree-diagnostic.h,
tree-pretty-print.h: New files.
* tree-pretty-print.c: Include tree-pretty-print.h.
(percent_K_format): New. Moved from pretty-print.c.
(pp_base_tree_identifier): Move from pretty-print.c.
* c-objc-common.c: Include tree-pretty-print.h.
(c_tree_printer): Handle %K here.
* langhooks.c: Include tree-diagnostic.h.
(lhd_print_error_function): Use diagnostic_abstract_origin macro.
* toplev.c: Include tree-diagnostic.h and tree-pretty-print.h.
(default_tree_printer): Handle %K using percent_K_format.
(general_init): Use default_tree_diagnostic_starter.
* tree.c: Include tree-diagnostic.h and tree-pretty-print.h.
(free_lang_data): Use default_tree_diagnostic_starter.
* c-pretty-print.c: Include tree-pretty-print.h.
* cfgexpand.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* cgraphunit.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* dwarf2out.c: Include tree-pretty-print.h.
* except.c: Include tree-pretty-print.h.
* gimple-pretty-print.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* gimplify.c: Include tree-pretty-print.h.
* graphite-poly.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* ipa-cp.c: Include tree-pretty-print.h.
* ipa-inline.c: Include gimple-pretty-print.h.
* ipa-prop.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* ipa-pure-const.c: Include gimple-pretty-print.h.
* ipa-struct-reorg.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* ipa-type-escape.c: Include tree-pretty-print.h.
* print-rtl.c: Include tree-pretty-print.h.
* print-tree.c: Include gimple-pretty-print.h.
* sese.c: Include tree-pretty-print.h.
* tree-affine.c: Include tree-pretty-print.h.
* tree-browser.c: Include tree-pretty-print.h.
* tree-call-cdce.c: Include gimple-pretty-print.h.
* tree-cfg.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-chrec.c: Include tree-pretty-print.h.
* tree-data-ref.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-dfa.c: Include tree-pretty-print.h.
* tree-if-conv.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-inline.c: Include tree-pretty-print.h.
* tree-into-ssa.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-nrv.c: Include tree-pretty-print.h.
* tree-object-size.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-outof-ssa.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-parloops.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-predcom.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-scalar-evolution.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-sra.c: Include tree-pretty-print.h.
* tree-ssa-address.c: Include tree-pretty-print.h.
* tree-ssa-alias.c: Include tree-pretty-print.h.
* tree-ssa-ccp.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-ssa-coalesce.c: Include tree-pretty-print.h.
* tree-ssa-copy.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-ssa-copyrename.c: Include tree-pretty-print.h.
* tree-ssa-dce.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-ssa-dom.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-ssa-dse.c: Include gimple-pretty-print.h.
* tree-ssa-forwprop.c: Include tree-pretty-print.h.
* tree-ssa-ifcombine.c: Include tree-pretty-print.h.
* tree-ssa-live.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-ssa-loop-im.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-ssa-loop-ivcanon.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-ssa-loop-ivopts.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-ssa-loop-niter.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-ssa-loop-prefetch.c: Include tree-pretty-print.h.
* tree-ssa-math-opts.c: Include gimple-pretty-print.h.
* tree-ssa-operands.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-ssa-phiprop.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-ssa-pre.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-ssa-propagate.c: Include gimple-pretty-print.h.
* tree-ssa-reassoc.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-ssa-sccvn.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-ssa-sink.c: Include gimple-pretty-print.h.
* tree-ssa-ter.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-ssa-uninit.c: Include gimple-pretty-print.h.
* tree-ssa.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-stdarg.c: Include gimple-pretty-print.h.
* tree-switch-conversion.c: Include gimple-pretty-print.h.
* tree-tailcall.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-vect-data-refs.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-vect-loop-manip.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-vect-loop.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-vect-patterns.c: Include gimple-pretty-print.h.
* tree-vect-slp.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-vect-stmts.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-vectorizer.c: Include tree-pretty-print.h.
* tree-vrp.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* value-prof.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* var-tracking.c: Include tree-pretty-print.h.
* Makefile.in (OBJS-common): Add tree-diagnostic.o.
(tree-diagnostic.o): New dependencies.
(c-objc-common.o, c-pretty-print.o, langhooks.o, tree.o,
tree-inline.o, print-tree.o, stor-layout.o, tree-ssa-uninit.o,
tree-ssa.o, tree-into-ssa.o, tree-ssa-ter.o, tree-ssa-coalesce.o,
tree-outof-ssa.o, tree-ssa-forwprop.o, tree-ssa-phiprop.o,
tree-ssa-ifcombine.o, tree-nrv.o, tree-ssa-copy.o,
tree-ssa-propagate.o, tree-ssa-dom.o, tree-ssa-uncprop.o,
tree-ssa-live.o, tree-ssa-copyrename.o, tree-ssa-pre.o,
tree-ssa-sccvn.o, tree-vrp.o, tree-cfg.o, tree-tailcall.o,
tree-ssa-sink.o, tree-if-conv.o, tree-dfa.o, tree-ssa-operands.o,
tree-ssa-address.o, tree-ssa-loop-niter.o,
tree-ssa-loop-ivcanon.o, tree-ssa-loop-prefetch.o, tree-predcom.o,
tree-ssa-loop-ivopts.o, tree-affine.o, tree-ssa-loop-im.o,
tree-ssa-math-opts.o, tree-ssa-alias.o, tree-ssa-reassoc.o,
gimplify.o, tree-browser.o, tree-chrec.o, tree-scalar-evolution.o,
tree-data-ref.o, sese.o, graphite-poly.o, tree-vect-loop.o,
tree-vect-loop-manip.o, tree-vect-patterns.o, tree-vect-slp.o,
tree-vect-stmts.o, tree-vect-data-refs.o, tree-vectorizer.o,
tree-parloops.o, tree-stdarg.o, tree-object-size.o,
gimple-pretty-print.o, tree-pretty-print.o, diagnostic.o,
toplev.o, print-rtl.o, except.o, dwarf2out.o, cgraphunit.o,
ipa-prop.o, ipa-cp.o, ipa-inline.o, ipa-pure-const.o,
ipa-type-escape.o, ipa-struct-reorg.o, tree-ssa-dce.o,
tree-call-cdce.o, tree-ssa-ccp.o, tree-sra.o,
tree-switch-conversion.o, var-tracking.o, value-prof.o,
cfgexpand.o, pretty-print.o): Update dependencies.
cp:
* error.c: Include tree-diagnostic.h and tree-pretty-print.h.
(cp_print_error_function): Use diagnostic_abstract_origin macro.
(cp_printer): Handle %K here using percent_K_format.
* cxx-pretty-print.c: Include tree-pretty-print.h.
* Make-lang.in (cp/error.o, cp/cxx-pretty-print.o): Update
dependencies.
From-SVN: r159685
2010-05-22 00:34:26 +02:00
|
|
|
#include "gimple-pretty-print.h"
|
2013-11-22 16:58:51 +01:00
|
|
|
#include "internal-fn.h"
|
|
|
|
#include "gimple-fold.h"
|
|
|
|
#include "tree-eh.h"
|
gimple-walk.h: New File.
* gimple-walk.h: New File. Relocate prototypes from gimple.h.
(struct walk_stmt_info): Relocate here from gimple.h.
* gimple-iterator.h: New File. Relocate prototypes from gimple.h.
(struct gimple_stmt_iterator_d): Relocate here from gimple.h.
(gsi_start_1, gsi_none, gsi_start_bb, gsi_last_1, gsi_last_bb,
gsi_end_p, gsi_one_before_end_p, gsi_next, gsi_prev, gsi_stmt,
gsi_after_labels, gsi_next_nondebug, gsi_prev_nondebug,
gsi_start_nondebug_bb, gsi_start_nondebug_after_labels_bb,
gsi_last_nondebug_bb, gsi_bb, gsi_seq): Relocate here from gimple.h.
* gimple.h (struct gimple_stmt_iterator_d): Move to gimple-iterator.h.
(gsi_start_1, gsi_none, gsi_start_bb, gsi_last_1, gsi_last_bb,
gsi_end_p, gsi_one_before_end_p, gsi_next, gsi_prev, gsi_stmt,
gsi_after_labels, gsi_next_nondebug, gsi_prev_nondebug,
gsi_start_nondebug_bb, gsi_start_nondebug_after_labels_bb,
gsi_last_nondebug_bb, gsi_bb, gsi_seq): Move to gimple-iterator.h.
(struct walk_stmt_info): Move to gimple-walk.h.
(gimple_seq_set_location): Move to gimple.c
* gimple-walk.c: New File.
(walk_gimple_seq_mod, walk_gimple_seq, walk_gimple_asm, walk_gimple_op,
walk_gimple_stmt, get_base_loadstore, walk_stmt_load_store_addr_ops,
walk_stmt_load_store_ops): Relocate here from gimple.c.
* gimple-iterator.c: Include gimple-iterator.h.
* gimple.c (walk_gimple_seq_mod, walk_gimple_seq, walk_gimple_asm,
walk_gimple_op, walk_gimple_stmt, get_base_loadstore,
walk_stmt_load_store_addr_ops, walk_stmt_load_store_ops): Move to
gimple-walk.c.
(gimple_seq_set_location): Relocate from gimple.h.
* tree-phinodes.h (set_phi_nodes): Move to tree-phinodes.c.
* tree-phinodes.c (set_phi_nodes): Relocate from tree-phinodes.h.
* gengtype.c (open_base_files): Add gimple-iterator.h to include list.
* Makefile.in (OBJS): Add gimple-walk.o
* asan.c: Update Include list as required for gimple-iterator.h and
gimple-walk.h.
* cfgexpand.c: Likewise.
* cfgloop.c: Likewise.
* cfgloopmanip.c: Likewise.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* cgraphunit.c: Likewise.
* gimple-fold.c: Likewise.
* gimple-low.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.
* gimplify.c: Likewise.
* graphite-blocking.c: Likewise.
* graphite-clast-to-gimple.c: Likewise.
* graphite-dependences.c: Likewise.
* graphite-interchange.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.
* ipa-inline-analysis.c: Likewise.
* ipa-profile.c: Likewise.
* ipa-prop.c: Likewise.
* ipa-pure-const.c: Likewise.
* ipa-split.c: Likewise.
* lto-streamer-in.c: Likewise.
* lto-streamer-out.c: Likewise.
* omp-low.c: Likewise.
* predict.c: Likewise.
* profile.c: Likewise.
* sese.c: Likewise.
* tracer.c: Likewise.
* trans-mem.c: Likewise.
* tree-call-cdce.c: Likewise.
* tree-cfg.c: Likewise.
* tree-cfgcleanup.c: Likewise.
* tree-complex.c: Likewise.
* tree-data-ref.c: Likewise.
* tree-dfa.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-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-predcom.c: Likewise.
* tree-profile.c: Likewise.
* tree-scalar-evolution.c: Likewise.
* tree-sra.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.c: Likewise.
* tree-ssa-math-opts.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-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-stdarg.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.
* value-prof.c: Likewise.
* vtable-verify.c: Likewise.
* config/aarch64/aarch64-builtins.c: Include gimple-iterator.h.
* config/rs6000/rs6000.c: Include gimple-iterator.h and gimple-walk.h.
* testsuite/g++.dg/plugin/selfassign.c: Include gimple-iterator.h.
* testsuite/gcc.dg/plugin/selfassign.c: Likewise.
From-SVN: r204763
2013-11-14 00:54:17 +01:00
|
|
|
#include "gimple-iterator.h"
|
2013-10-23 14:16:58 +02:00
|
|
|
#include "tree-cfg.h"
|
|
|
|
#include "tree-into-ssa.h"
|
2004-05-13 08:41:07 +02:00
|
|
|
#include "domwalk.h"
|
|
|
|
#include "tree-pass.h"
|
2004-09-15 23:47:45 +02:00
|
|
|
#include "tree-ssa-propagate.h"
|
2013-09-26 05:28:03 +02:00
|
|
|
#include "tree-ssa-threadupdate.h"
|
2004-05-13 08:41:07 +02:00
|
|
|
#include "langhooks.h"
|
2005-11-04 21:09:25 +01:00
|
|
|
#include "params.h"
|
2015-04-17 21:24:17 +02:00
|
|
|
#include "tree-ssa-scopedtables.h"
|
tree-ssa.h: Don't include gimple-low.h...
* tree-ssa.h: Don't include gimple-low.h, tree-ssa-address.h, sbitmap.h,
tree-ssa-threadedge.h, tree-ssa-dom.h, and tree-cfgcleanup.h.
* gimple-low.c (gimple_check_call_arg,
gimple_check_call_matching_types): Move to cgraph.c.
* gimple-low.h: Remove prototype.
* cgraph.c: (gimple_check_call_arg, gimple_check_call_matching_types):
Relocate from gimple-low.c.
* cgraph.h: Add prototype. Don't include basic-block.h.
* gimplify.c: Add gimple-low to include list.
* omp-low.c: Add gimple-low and tree-cfgcleanup.h to include list.
* tree-eh.c: Add gimple-low to include list.
* tree-nested.c: Likewise.
* cfgexpand.c: Add tree-ssa-address.h to include list.
* expr.c: Likewise.
* gimple-fold.c: Likewise.
* gimple-ssa-strength-reduction.c: Likewise.
* trans-mem.c: Likewise.
* tree-mudflap.c: Likewise.
* tree-ssa-loop-ivopts.c: Likewise.
* tree-ssa-dom.c: Include tree-ssa-threadedge.h and tree-ssa-dom.h.
(degenerate_phi_result): Move to tree-phinodes.c.
* tree-ssa-loop-ch.c: Include tree-ssa-threadedge.h.
* tree-ssa-threadedge.c: Likewise.
* tree-vrp.c: Likewise.
* tree-phinodes.c (degenerate_phi_result): Relocate here.
* tree-ssa-dom.h (degenerate_phi_result): Remove Prototype.
* tree-phinodes.h (degenerate_phi_result): Add prototype.
* tree-ssa-copy.c: Include tree-ssa-dom.h.
* tree-ssa-forwprop.c: Likewise.
* tree-cfgcleanup.c (execute_cleanup_cfg_post_optimizing,
pass_data_cleanup_cfg_post_optimizing,
make_pass_cleanup_cfg_post_optimizing): Relocate from tree-optimize.c.
* tree-optimize.c: Delete File.
* graphite.c: Include tree-cfgcleanup.h.
* passes.c: Likewise.
* tree-cfg.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-dse.c: Likewise.
* tree-ssa-loop-ivcanon.c: Likewise.
* tree-switch-conversion.c: Don't include tree-ssa-operands.h.
* tree-outof-ssa.c: Include sbitmap.h.
* tree-ssa-live.c: Likewise.
* tree-ssa-propagate.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* tree-stdarg.c: Likewise.
* Makefile.in (OBJS): Delete tree-optimize.o.
* basic-block.h (gcov_type, gcov_type_unsigned): Move to coretypes.h.
* coretypes.h (gcov_type, gcov_type_unsigned): Relocate here.
* varasm.c: Include basic-block.h.
* cfgloop.h: Include function.h instead of basic-block.h
(bb_loop_depth): Move to cfgloop.c.
* cfgloop.c (bb_loop_depth): Relocate from cfgloop.h.
From-SVN: r203833
2013-10-18 21:35:40 +02:00
|
|
|
#include "tree-ssa-threadedge.h"
|
|
|
|
#include "tree-ssa-dom.h"
|
2014-11-20 09:40:52 +01:00
|
|
|
#include "gimplify.h"
|
2015-03-13 09:47:14 +01:00
|
|
|
#include "tree-cfgcleanup.h"
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
/* This file implements optimizations on the dominator tree. */
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
/* Representation of a "naked" right-hand-side expression, to be used
|
|
|
|
in recording available expressions in the expression hash table. */
|
|
|
|
|
|
|
|
enum expr_kind
|
|
|
|
{
|
|
|
|
EXPR_SINGLE,
|
|
|
|
EXPR_UNARY,
|
|
|
|
EXPR_BINARY,
|
2010-06-25 10:56:24 +02:00
|
|
|
EXPR_TERNARY,
|
2011-12-08 23:00:38 +01:00
|
|
|
EXPR_CALL,
|
|
|
|
EXPR_PHI
|
2008-07-28 16:33:56 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
struct hashable_expr
|
|
|
|
{
|
|
|
|
tree type;
|
|
|
|
enum expr_kind kind;
|
|
|
|
union {
|
|
|
|
struct { tree rhs; } single;
|
|
|
|
struct { enum tree_code op; tree opnd; } unary;
|
2010-06-25 10:56:24 +02:00
|
|
|
struct { enum tree_code op; tree opnd0, opnd1; } binary;
|
|
|
|
struct { enum tree_code op; tree opnd0, opnd1, opnd2; } ternary;
|
2014-11-19 18:00:54 +01:00
|
|
|
struct { gcall *fn_from; bool pure; size_t nargs; tree *args; } call;
|
2011-12-08 23:00:38 +01:00
|
|
|
struct { size_t nargs; tree *args; } phi;
|
2008-07-28 16:33:56 +02:00
|
|
|
} ops;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Structure for recording known values of a conditional expression
|
|
|
|
at the exits from its block. */
|
|
|
|
|
remove useless typedefs
gcc/ChangeLog:
2015-08-11 trevor Saunders <tbsaunde@tbsaunde.org>
* bt-load.c, cgraph.h, dwarf2out.c, dwarf2out.h, final.c,
function.c, graphite-scop-detection.c, haifa-sched.c,
ipa-devirt.c, ipa-split.c, recog.c, ree.c, stmt.c,
tree-data-ref.c, tree-ssa-dom.c, tree-ssa-loop-ivopts.c,
varasm.c: Remove typedefs of structs.
From-SVN: r227000
2015-08-19 04:48:16 +02:00
|
|
|
struct cond_equivalence
|
2008-07-28 16:33:56 +02:00
|
|
|
{
|
|
|
|
struct hashable_expr cond;
|
|
|
|
tree value;
|
remove useless typedefs
gcc/ChangeLog:
2015-08-11 trevor Saunders <tbsaunde@tbsaunde.org>
* bt-load.c, cgraph.h, dwarf2out.c, dwarf2out.h, final.c,
function.c, graphite-scop-detection.c, haifa-sched.c,
ipa-devirt.c, ipa-split.c, recog.c, ree.c, stmt.c,
tree-data-ref.c, tree-ssa-dom.c, tree-ssa-loop-ivopts.c,
varasm.c: Remove typedefs of structs.
From-SVN: r227000
2015-08-19 04:48:16 +02:00
|
|
|
};
|
2010-08-17 11:55:04 +02:00
|
|
|
|
2004-10-30 02:06:22 +02:00
|
|
|
|
2015-09-11 23:32:38 +02:00
|
|
|
/* Structure for recording edge equivalences.
|
2004-10-30 02:06:22 +02:00
|
|
|
|
|
|
|
Computing and storing the edge equivalences instead of creating
|
|
|
|
them on-demand can save significant amounts of time, particularly
|
2009-11-25 11:55:54 +01:00
|
|
|
for pathological cases involving switch statements.
|
2004-10-30 02:06:22 +02:00
|
|
|
|
|
|
|
These structures live for a single iteration of the dominator
|
|
|
|
optimizer in the edge's AUX field. At the end of an iteration we
|
2015-09-11 23:32:38 +02:00
|
|
|
free each of these structures. */
|
2004-10-30 02:06:22 +02:00
|
|
|
|
|
|
|
struct edge_info
|
|
|
|
{
|
|
|
|
/* If this edge creates a simple equivalence, the LHS and RHS of
|
|
|
|
the equivalence will be stored here. */
|
|
|
|
tree lhs;
|
|
|
|
tree rhs;
|
|
|
|
|
|
|
|
/* Traversing an edge may also indicate one or more particular conditions
|
2010-08-17 11:55:04 +02:00
|
|
|
are true or false. */
|
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'.
This patch rewrites the old VEC macro-based interface into a new one
based on the template class 'vec'. The user-visible changes are
described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec.
I have tested the patch pretty extensively:
- Regular bootstraps on x86_64, ppc, ia64, sparc and hppa.
- Bootstraps with --enable-checking=release
- Bootstraps with --enable-checking=gc,gcac
- Basic builds on all targets (using contrib/config-list.mk).
We no longer access the vectors via VEC_* macros. The pattern is
"VEC_operation (T, A, V, args)" becomes "V.operation (args)".
The only thing I could not do is create proper ctors and dtors for the
vec class. Since these vectors are stored in unions, we
have to keep them as PODs (C++03 does not allow non-PODs in unions).
This means that creation and destruction must be explicit. There is a
new method vec<type, allocation, layout>::create() and another vec<type,
allocation, layout>::destroy() to allocate the internal vector.
For vectors that must be pointers, there is a family of free functions
that implement the operations that need to tolerate NULL vectors.
These functions all start with the prefix 'vec_safe_'. See the wiki
page for details.
The gengtype change removes the special handling for VEC() that used
to exist in gengtype. Additionally, it allows gengtype to recognize
templates of more than one argument and introduces the concept of an
undefined type (useful for template arguments that may or may not be
types).
When a TYPE_UNDEFINED is reached, gengtype will ignore it if it
happens inside a type marked with GTY((user)). Otherwise, it will
emit an error.
Finally, gengtype rejects root types marked GTY((user)) that are not
first class pointers.
2012-11-16 Diego Novillo <dnovillo@google.com>
VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec)
* vec.c (register_overhead): Convert it into
member function of vec_prefix.
(release_overhead): Likewise.
(calculate_allocation): Likewise.
(vec_heap_free): Remove.
(vec_gc_o_reserve_1): Remove.
(vec_heap_o_reserve_1): Remove.
(vec_stack_o_reserve_1): Remove.
(vec_stack_o_reserve_exact): Remove.
(register_stack_vec): New.
(stack_vec_register_index): New.
(unregister_stack_vec): New.
(vec_assert_fail): Remove.
* vec.h: Conditionally include ggc.h. Document conditional
hackery.
Update top-level documentation.
(ALONE_VEC_CHECK_INFO): Remove.
(VEC_CHECK_INFO): Remove.
(ALONE_VEC_CHECK_DECL): Remove.
(VEC_CHECK_DECL): Remove.
(ALONE_VEC_CHECK_PASS): Remove.
(VEC_CHECK_PASS): Remove.
(VEC_ASSERT): Remove.
(vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and
va_stack.
Mark fields alloc_ and num_ as protected.
(struct vec_t): Remove. Remove all function members.
(struct vl_embed): Declare.
(struct vl_ptr): Declare.
(free): Remove.
(reserve_exact): Remove.
(reserve): Remove.
(safe_splice): Remove.
(safe_push): Remove.
(safe_grow): Remove.
(safe_grow_cleared): Remove.
(safe_insert): Remove.
(DEF_VEC_I): Remove.
(DEF_VEC_ALLOC_I): Remove.
(DEF_VEC_P): Remove.
(DEF_VEC_ALLOC_P): Remove.
(DEF_VEC_O): Remove.
(DEF_VEC_ALLOC_O): Remove.
(DEF_VEC_ALLOC_P_STACK): Remove.
(DEF_VEC_ALLOC_O_STACK): Remove.
(DEF_VEC_ALLOC_I_STACK): Remove.
(DEF_VEC_A): Remove.
(DEF_VEC_ALLOC_A): Remove.
(vec_stack_p_reserve_exact_1): Remove.
(vec_stack_o_reserve): Remove.
(vec_stack_o_reserve_exact): Remove.
(VEC_length): Remove.
(VEC_empty): Remove.
(VEC_address): Remove.
(vec_address): Remove.
(VEC_last): Remove.
(VEC_index): Remove.
(VEC_iterate): Remove.
(VEC_embedded_size): Remove.
(VEC_embedded_init): Remove.
(VEC_free): Remove.
(VEC_copy): Remove.
(VEC_space): Remove.
(VEC_reserve): Remove.
(VEC_reserve_exact): Remove.
(VEC_splice): Remove.
(VEC_safe_splice): Remove.
(VEC_quick_push): Remove.
(VEC_safe_push): Remove.
(VEC_pop): Remove.
(VEC_truncate): Remove.
(VEC_safe_grow): Remove.
(VEC_replace): Remove.
(VEC_quick_insert): Remove.
(VEC_safe_insert): Remove.
(VEC_ordered_remove): Remove.
(VEC_unordered_remove): Remove.
(VEC_block_remove): Remove.
(VEC_lower_bound): Remove.
(VEC_alloc): Remove.
(VEC_qsort): Remove.
(va_heap): Declare.
(va_heap::default_layout): New typedef to vl_ptr.
(va_heap::reserve): New.
(va_heap::release): New.
(va_gc): Declare.
(va_gc::default_layout): New typedef to vl_embed.
(va_gc::reserve): New.
(va_gc::release): New.
(va_gc_atomic): Declare. Inherit from va_gc.
(va_stack): Declare.
(va_stack::default_layout): New typedef to vl_ptr.
(va_stack::alloc): New.
(va_stack::reserve): New.
(va_stack::release): New.
(register_stack_vec): Declare.
(stack_vec_register_index): Declare.
(unregister_stack_vec): Declare.
(vec<T, A = va_heap, L = typename A::default_layout>): Declare
empty vec template.
(vec<T, A, vl_embed>): Partial specialization for embedded
layout.
(vec<T, A, vl_embed>::allocated): New.
(vec<T, A, vl_embed>::length): New.
(vec<T, A, vl_embed>::is_empty): New.
(vec<T, A, vl_embed>::address): New.
(vec<T, A, vl_embed>::operator[]): New.
(vec<T, A, vl_embed>::last New.
(vec<T, A, vl_embed>::space): New.
(vec<T, A, vl_embed>::iterate): New.
(vec<T, A, vl_embed>::iterate): New.
(vec<T, A, vl_embed>::copy): New.
(vec<T, A, vl_embed>::splice): New.
(vec<T, A, vl_embed>::quick_push New.
(vec<T, A, vl_embed>::pop New.
(vec<T, A, vl_embed>::truncate): New.
(vec<T, A, vl_embed>::quick_insert): New.
(vec<T, A, vl_embed>::ordered_remove): New.
(vec<T, A, vl_embed>::unordered_remove): New.
(vec<T, A, vl_embed>::block_remove): New.
(vec<T, A, vl_embed>::qsort): New.
(vec<T, A, vl_embed>::lower_bound): New.
(vec<T, A, vl_embed>::embedded_size): New.
(vec<T, A, vl_embed>::embedded_init): New.
(vec<T, A, vl_embed>::quick_grow): New.
(vec<T, A, vl_embed>::quick_grow_cleared): New.
(vec_safe_space): New.
(vec_safe_length): New.
(vec_safe_address): New.
(vec_safe_is_empty): New.
(vec_safe_reserve): New.
(vec_safe_reserve_exact): New.
(vec_alloc): New.
(vec_free): New.
(vec_safe_grow): New.
(vec_safe_grow_cleared): New.
(vec_safe_iterate): New.
(vec_safe_push): New.
(vec_safe_insert): New.
(vec_safe_truncate): New.
(vec_safe_copy): New.
(vec_safe_splice): New.
(vec<T, A, vl_ptr>): New partial specialization for the space
efficient layout.
(vec<T, A, vl_ptr>::exists): New.
(vec<T, A, vl_ptr>::is_empty): New.
(vec<T, A, vl_ptr>::length): New.
(vec<T, A, vl_ptr>::address): New.
(vec<T, A, vl_ptr>::operator[]): New.
(vec<T, A, vl_ptr>::operator!=): New.
(vec<T, A, vl_ptr>::operator==): New.
(vec<T, A, vl_ptr>::last): New.
(vec<T, A, vl_ptr>::space): New.
(vec<T, A, vl_ptr>::iterate): New.
(vec<T, A, vl_ptr>::copy): New.
(vec<T, A, vl_ptr>::reserve): New.
(vec<T, A, vl_ptr>::reserve_exact): New.
(vec<T, A, vl_ptr>::splice): New.
(vec<T, A, vl_ptr>::safe_splice): New.
(vec<T, A, vl_ptr>::quick_push): New.
(vec<T, A, vl_ptr>::safe_push): New.
(vec<T, A, vl_ptr>::pop): New.
(vec<T, A, vl_ptr>::truncate): New.
(vec<T, A, vl_ptr>::safe_grow): New.
(vec<T, A, vl_ptr>::safe_grow_cleared): New.
(vec<T, A, vl_ptr>::quick_grow): New.
(vec<T, A, vl_ptr>::quick_grow_cleared): New.
(vec<T, A, vl_ptr>::quick_insert): New.
(vec<T, A, vl_ptr>::safe_insert): New.
(vec<T, A, vl_ptr>::ordered_remove): New.
(vec<T, A, vl_ptr>::unordered_remove): New.
(vec<T, A, vl_ptr>::block_remove): New.
(vec<T, A, vl_ptr>::qsort): New.
(vec<T, A, vl_ptr>::lower_bound): New.
(vec_stack_alloc): Define.
(FOR_EACH_VEC_SAFE_ELT): Define.
* vecir.h: Remove. Update all users.
* vecprim.h: Remove. Update all users.
Move uchar to coretypes.h.
* Makefile.in (VEC_H): Add $(GGC_H).
Remove vecir.h and vecprim.h dependencies everywhere.
2012-11-16 Diego Novillo <dnovillo@google.com>
* gengtype-lex.l (VEC): Remove.
Add characters in the set [\!\>\.-].
* gengtype-parse.c (token_names): Remove "VEC".
(require_template_declaration): Remove handling of VEC_TOKEN.
(type): Likewise.
Call create_user_defined_type when parsing GTY((user)).
* gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED.
(write_state_undefined_type): New.
(write_state_type): Call write_state_undefined_type for
TYPE_UNDEFINED.
(read_state_type): Call read_state_undefined_type for
TYPE_UNDEFINED.
* gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED.
(create_user_defined_type): Make extern.
(type_for_name): Factor out of resolve_typedef.
(create_undefined_type): New
(resolve_typedef): Call it when we cannot find a previous
typedef and the type is not a template.
(find_structure): Accept TYPE_UNDEFINED.
(set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES,
default to false.
Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or
ALLOWED_UNDEFINED_TYPES is set.
Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT.
(filter_type_name): Accept templates with more than one
argument.
(output_mangled_typename): Handle TYPE_UNDEFINED
(walk_type): Likewise.
(write_types_process_field): Likewise.
(write_func_for_structure): If CHAIN_NEXT is set, ORIG_S
should not be a user-defined type.
(write_types_local_user_process_field): Handle TYPE_ARRAY,
TYPE_NONE and TYPE_UNDEFINED.
(write_types_local_process_field): Likewise.
(contains_scalar_p): Return 0 for TYPE_USER_STRUCT.
(write_root): Reject user-defined types that are not pointers.
Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT
and TYPE_PARAM_STRUCT.
(output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and
TYPE_ARRAY.
(dump_typekind): Handle TYPE_UNDEFINED.
* gengtype.h (enum typekind): Add TYPE_UNDEFINED.
(create_user_defined_type): Declare.
(enum gty_token): Remove VEC_TOKEN.
2012-11-16 Diego Novillo <dnovillo@google.com>
Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec)
* coretypes.h (uchar): Define.
* alias.c: Use new vec API in vec.h.
* asan.c: Likewise.
* attribs.c: Likewise.
* basic-block.h: Likewise.
* bb-reorder.c: Likewise.
* builtins.c: Likewise.
* calls.c: Likewise.
* cfg.c: Likewise.
* cfganal.c: Likewise.
* cfgcleanup.c: Likewise.
* cfgexpand.c: Likewise.
* cfghooks.c: Likewise.
* cfghooks.h: Likewise.
* cfgloop.c: Likewise.
* cfgloop.h: Likewise.
* cfgloopanal.c: Likewise.
* cfgloopmanip.c: Likewise.
* cfgrtl.c: Likewise.
* cgraph.c: Likewise.
* cgraph.h: Likewise.
* cgraphclones.c: Likewise.
* cgraphunit.c: Likewise.
* combine.c: Likewise.
* compare-elim.c: Likewise.
* coverage.c: Likewise.
* cprop.c: Likewise.
* data-streamer.h: Likewise.
* dbxout.c: Likewise.
* dce.c: Likewise.
* df-core.c: Likewise.
* df-problems.c: Likewise.
* df-scan.c: Likewise.
* dominance.c: Likewise.
* domwalk.c: Likewise.
* domwalk.h: Likewise.
* dse.c: Likewise.
* dwarf2cfi.c: Likewise.
* dwarf2out.c: Likewise.
* dwarf2out.h: Likewise.
* emit-rtl.c: Likewise.
* except.c: Likewise.
* except.h: Likewise.
* expr.c: Likewise.
* expr.h: Likewise.
* final.c: Likewise.
* fold-const.c: Likewise.
* function.c: Likewise.
* function.h: Likewise.
* fwprop.c: Likewise.
* gcc.c: Likewise.
* gcse.c: Likewise.
* genattr.c: Likewise.
* genattrtab.c: Likewise.
* genautomata.c: Likewise.
* genextract.c: Likewise.
* genopinit.c: Likewise
* ggc-common.c: Likewise.
* ggc.h: Likewise.
* gimple-low.c: Likewise.
* gimple-ssa-strength-reduction.c: Likewise.
* gimple-streamer-in.c: Likewise.
* gimple.c: Likewise.
* gimple.h: Likewise.
* gimplify.c: Likewise.
* graph.c: Likewise.
* graphds.c: Likewise.
* graphds.h: Likewise.
* graphite-blocking.c: Likewise.
* graphite-clast-to-gimple.c: Likewise.
* graphite-dependences.c: Likewise.
* graphite-interchange.c: Likewise.
* graphite-optimize-isl.c: Likewise.
* graphite-poly.c: Likewise.
* graphite-poly.h: Likewise.
* graphite-scop-detection.c: Likewise.
* graphite-scop-detection.h: Likewise.
* graphite-sese-to-poly.c: Likewise.
* graphite.c: Likewise.
* godump.c: Likewise.
* haifa-sched.c: Likewise.
* hw-doloop.c: Likewise.
* hw-doloop.h: Likewise.
* ifcvt.c: Likewise.
* insn-addr.h: Likewise.
* ipa-cp.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* ipa-inline-transform.c: Likewise.
* ipa-inline.c: Likewise.
* ipa-inline.h: Likewise.
* ipa-prop.c: Likewise.
* ipa-prop.h: Likewise.
* ipa-pure-const.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-ref.c: Likewise.
* ipa-ref.h: Likewise.
* ipa-reference.c: Likewise.
* ipa-split.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-utils.h: Likewise.
* ipa.c: Likewise.
* ira-build.c: Likewise.
* ira-color.c: Likewise.
* ira-emit.c: Likewise.
* ira-int.h: Likewise.
* ira.c: Likewise.
* loop-invariant.c: Likewise.
* loop-unroll.c: Likewise.
* lower-subreg.c: Likewise.
* lra-lives.c: Likewise.
* lra.c: Likewise.
* lto-cgraph.c: Likewise.
* lto-section-out.c: Likewise.
* lto-streamer-in.c: Likewise.
* lto-streamer-out.c: Likewise.
* lto-streamer.h: Likewise.
* lto-symtab.c: Likewise.
* mcf.c: Likewise.
* modulo-sched.c: Likewise.
* omp-low.c: Likewise.
* opts-common.c: Likewise.
* opts-global.c: Likewise.
* opts.c: Likewise.
* opts.h: Likewise.
* passes.c: Likewise.
* predict.c: Likewise.
* print-tree.c: Likewise.
* profile.c: Likewise.
* profile.h: Likewise.
* read-rtl.c: Likewise.
* ree.c: Likewise.
* reg-stack.c: Likewise.
* regrename.c: Likewise.
* regrename.h: Likewise.
* reload.c: Likewise.
* reload.h: Likewise.
* reload1.c: Likewise.
* rtl.h: Likewise.
* sched-deps.c: Likewise.
* sched-int.h: Likewise.
* sdbout.c: Likewise.
* sel-sched-dump.c: Likewise.
* sel-sched-ir.c: Likewise.
* sel-sched-ir.h: Likewise.
* sel-sched.c: Likewise.
* sese.c: Likewise.
* sese.h: Likewise.
* statistics.h: Likewise.
* stmt.c: Likewise.
* stor-layout.c: Likewise.
* store-motion.c: Likewise.
* tlink.c: Likewise.
* toplev.c: Likewise.
* trans-mem.c: Likewise.
* tree-browser.c: Likewise.
* tree-call-cdce.c: Likewise.
* tree-cfg.c: Likewise.
* tree-cfgcleanup.c: Likewise.
* tree-chrec.c: Likewise.
* tree-chrec.h: Likewise.
* tree-complex.c: Likewise.
* tree-data-ref.c: Likewise.
* tree-data-ref.h: Likewise.
* tree-dfa.c: Likewise.
* tree-diagnostic.c: Likewise.
* tree-dump.c: Likewise.
* tree-eh.c: Likewise.
* tree-emutls.c: Likewise.
* tree-flow.h: Likewise.
* tree-if-conv.c: Likewise.
* tree-inline.c: Likewise.
* tree-inline.h: Likewise.
* tree-into-ssa.c: Likewise.
* tree-iterator.c: Likewise.
* tree-loop-distribution.c: Likewise.
* tree-mudflap.c: Likewise.
* tree-optimize.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-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-dce.c: Likewise.
* tree-ssa-dom.c: Likewise.
* tree-ssa-forwprop.c: Likewise.
* tree-ssa-live.c: Likewise.
* tree-ssa-live.h: 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-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-sccvn.h: Likewise.
* tree-ssa-strlen.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* tree-ssa-tail-merge.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-streamer.h: Likewise.
* tree-switch-conversion.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-vectorizer.h: Likewise.
* tree-vrp.c: Likewise.
* tree.c: Likewise.
* tree.h: Likewise.
* value-prof.c: Likewise.
* value-prof.h: Likewise.
* var-tracking.c: Likewise.
* varasm.c: Likewise.
* varpool.c: Likewise.
* vmsdbgout.c: Likewise.
* config/bfin/bfin.c: Likewise.
* config/c6x/c6x.c: Likewise.
* config/darwin.c: Likewise.
* config/i386/i386.c: Likewise.
* config/ia64/ia64.c: Likewise.
* config/mep/mep.c: Likewise.
* config/mips/mips.c: Likewise.
* config/pa/pa.c: Likewise.
* config/rs6000/rs6000-c.c: Likewise.
* config/rs6000/rs6000.c: Likewise.
* config/rx/rx.c: Likewise.
* config/spu/spu-c.c: Likewise.
* config/vms/vms.c: Likewise.
* config/vxworks.c: Likewise.
* config/epiphany/resolve-sw-modes.c: Likewise.
From-SVN: r193595
2012-11-18 03:54:30 +01:00
|
|
|
vec<cond_equivalence> cond_equivalences;
|
2004-10-30 02:06:22 +02:00
|
|
|
};
|
|
|
|
|
2004-09-15 06:38:04 +02:00
|
|
|
/* Stack of available expressions in AVAIL_EXPRs. Each block pushes any
|
|
|
|
expressions it enters into the hash table along with a marker entry
|
2004-09-15 15:06:30 +02:00
|
|
|
(null). When we finish processing the block, we pop off entries and
|
2004-09-15 06:38:04 +02:00
|
|
|
remove the expressions from the global hash table until we hit the
|
|
|
|
marker. */
|
2008-07-28 16:33:56 +02:00
|
|
|
typedef struct expr_hash_elt * expr_hash_elt_t;
|
|
|
|
|
2004-09-15 06:38:04 +02:00
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
/* Structure for entries in the expression hash table. */
|
2004-08-09 21:13:07 +02:00
|
|
|
|
2015-09-15 19:03:49 +02:00
|
|
|
class expr_hash_elt
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2015-09-15 19:03:49 +02:00
|
|
|
public:
|
|
|
|
expr_hash_elt (gimple, tree);
|
|
|
|
expr_hash_elt (tree);
|
|
|
|
expr_hash_elt (struct hashable_expr *, tree);
|
|
|
|
expr_hash_elt (class expr_hash_elt &);
|
|
|
|
~expr_hash_elt ();
|
|
|
|
void print (FILE *);
|
|
|
|
tree vop (void) { return m_vop; }
|
|
|
|
tree lhs (void) { return m_lhs; }
|
|
|
|
struct hashable_expr *expr (void) { return &m_expr; }
|
|
|
|
expr_hash_elt *stamp (void) { return m_stamp; }
|
|
|
|
hashval_t hash (void) { return m_hash; }
|
|
|
|
|
|
|
|
private:
|
2004-05-13 08:41:07 +02:00
|
|
|
/* The expression (rhs) we want to record. */
|
2015-09-15 19:03:49 +02:00
|
|
|
struct hashable_expr m_expr;
|
|
|
|
|
|
|
|
/* The value (lhs) of this expression. */
|
|
|
|
tree m_lhs;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2014-11-20 09:40:52 +01:00
|
|
|
/* The virtual operand associated with the nearest dominating stmt
|
|
|
|
loading from or storing to expr. */
|
2015-09-15 19:03:49 +02:00
|
|
|
tree m_vop;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
/* The hash value for RHS. */
|
2015-09-15 19:03:49 +02:00
|
|
|
hashval_t m_hash;
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
|
|
/* A unique stamp, typically the address of the hash
|
|
|
|
element itself, used in removing entries from the table. */
|
2015-09-15 19:03:49 +02:00
|
|
|
struct expr_hash_elt *m_stamp;
|
|
|
|
|
|
|
|
/* We should never be making assignments between objects in this class.
|
|
|
|
Though it might allow us to exploit C++11 move semantics if we
|
|
|
|
defined the move constructor and move assignment operator. */
|
|
|
|
expr_hash_elt& operator=(const expr_hash_elt&);
|
2004-05-13 08:41:07 +02:00
|
|
|
};
|
|
|
|
|
2013-04-26 02:28:35 +02:00
|
|
|
/* Hashtable helpers. */
|
|
|
|
|
|
|
|
static bool hashable_expr_equal_p (const struct hashable_expr *,
|
|
|
|
const struct hashable_expr *);
|
|
|
|
static void free_expr_hash_elt (void *);
|
|
|
|
|
2015-06-25 19:06:52 +02:00
|
|
|
struct expr_elt_hasher : pointer_hash <expr_hash_elt>
|
2013-04-26 02:28:35 +02:00
|
|
|
{
|
2014-06-24 15:21:53 +02:00
|
|
|
static inline hashval_t hash (const value_type &);
|
|
|
|
static inline bool equal (const value_type &, const compare_type &);
|
|
|
|
static inline void remove (value_type &);
|
2013-04-26 02:28:35 +02:00
|
|
|
};
|
|
|
|
|
2015-09-15 19:03:49 +02:00
|
|
|
/* This class defines a unwindable AVAIL_EXPRs, built on top of the
|
|
|
|
available expression hash table.
|
|
|
|
|
|
|
|
Essentially it's just a stack of available expression value pairs with
|
|
|
|
a special marker (NULL, NULL) to indicate unwind points. */
|
|
|
|
|
|
|
|
class avail_exprs_stack
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/* We need access to the AVAIL_EXPR hash table so that we can
|
|
|
|
remove entries from the hash table when unwinding the stack. */
|
|
|
|
avail_exprs_stack (hash_table<expr_elt_hasher> *table)
|
|
|
|
{ m_stack.create (20); m_avail_exprs = table; }
|
|
|
|
~avail_exprs_stack (void) { m_stack.release (); }
|
|
|
|
|
|
|
|
/* Push the unwinding marker onto the stack. */
|
|
|
|
void push_marker (void) { record_expr (NULL, NULL, 'M'); }
|
|
|
|
|
|
|
|
/* Restore the AVAIL_EXPRs table to its state when the last marker
|
|
|
|
was pushed. */
|
|
|
|
void pop_to_marker ();
|
|
|
|
|
|
|
|
/* Record a single available expression that can be unwound. */
|
|
|
|
void record_expr (expr_hash_elt_t, expr_hash_elt_t, char);
|
|
|
|
|
|
|
|
private:
|
|
|
|
vec<std::pair<expr_hash_elt_t, expr_hash_elt_t> > m_stack;
|
|
|
|
hash_table<expr_elt_hasher> *m_avail_exprs;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2013-04-26 02:28:35 +02:00
|
|
|
inline hashval_t
|
2014-06-24 15:21:53 +02:00
|
|
|
expr_elt_hasher::hash (const value_type &p)
|
2013-04-26 02:28:35 +02:00
|
|
|
{
|
2015-09-15 19:03:49 +02:00
|
|
|
return p->hash ();
|
2013-04-26 02:28:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
inline bool
|
2014-06-24 15:21:53 +02:00
|
|
|
expr_elt_hasher::equal (const value_type &p1, const compare_type &p2)
|
2013-04-26 02:28:35 +02:00
|
|
|
{
|
2015-09-15 19:03:49 +02:00
|
|
|
const struct hashable_expr *expr1 = p1->expr ();
|
|
|
|
const struct expr_hash_elt *stamp1 = p1->stamp ();
|
|
|
|
const struct hashable_expr *expr2 = p2->expr ();
|
|
|
|
const struct expr_hash_elt *stamp2 = p2->stamp ();
|
2013-04-26 02:28:35 +02:00
|
|
|
|
|
|
|
/* This case should apply only when removing entries from the table. */
|
|
|
|
if (stamp1 == stamp2)
|
|
|
|
return true;
|
|
|
|
|
2015-09-15 19:03:49 +02:00
|
|
|
if (p1->hash () != p2->hash ())
|
2013-04-26 02:28:35 +02:00
|
|
|
return false;
|
|
|
|
|
|
|
|
/* In case of a collision, both RHS have to be identical and have the
|
|
|
|
same VUSE operands. */
|
|
|
|
if (hashable_expr_equal_p (expr1, expr2)
|
|
|
|
&& types_compatible_p (expr1->type, expr2->type))
|
2014-11-20 09:40:52 +01:00
|
|
|
return true;
|
2013-04-26 02:28:35 +02:00
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Delete an expr_hash_elt and reclaim its storage. */
|
|
|
|
|
|
|
|
inline void
|
2014-06-24 15:21:53 +02:00
|
|
|
expr_elt_hasher::remove (value_type &element)
|
2013-04-26 02:28:35 +02:00
|
|
|
{
|
|
|
|
free_expr_hash_elt (element);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Hash table with expressions made available during the renaming process.
|
|
|
|
When an assignment of the form X_i = EXPR is found, the statement is
|
|
|
|
stored in this table. If the same expression EXPR is later found on the
|
|
|
|
RHS of another statement, it is replaced with X_i (thus performing
|
|
|
|
global redundancy elimination). Similarly as we pass through conditionals
|
|
|
|
we record the conditional itself as having either a true or false value
|
|
|
|
in this table. */
|
Remove a layer of indirection from hash_table
gcc/
* hash-table.h: Remove a layer of indirection from hash_table so that
it contains the hash table's data instead of a pointer to the data.
* alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c,
config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c,
config/mips/mips.c, config/sol2.c, coverage.c, cselib.c,
data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c,
fold-const.c, gcse.c, ggc-common.c,
gimple-ssa-strength-reduction.c, gimplify.c,
graphite-clast-to-gimple.c, graphite-dependences.c,
graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c,
ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c,
loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c,
lto-streamer.c, lto-streamer.h, passes.c, plugin.c,
postreload-gcse.c, sese.c, statistics.c, store-motion.c,
trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c,
tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c,
tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c,
tree-ssa-live.c, tree-ssa-loop-im.c,
tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-tail-merge.c,
tree-ssa-threadupdate.c, tree-ssa-uncprop.c,
tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c,
tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c,
vtable-verify.c, vtable-verify.h: Adjust.
gcc/c/
* c-decl.c: Adjust.
gcc/cp/
* class.c, semantics.c, tree.c, vtable-class-hierarchy.c:
Adjust.
gcc/java/
* jcf-io.c: Adjust.
gcc/lto/
* lto.c: Adjust.
gcc/objc/
* objc-act.c: Adjust.
From-SVN: r211936
2014-06-24 15:21:35 +02:00
|
|
|
static hash_table<expr_elt_hasher> *avail_exprs;
|
2013-04-26 02:28:35 +02:00
|
|
|
|
2015-04-17 21:24:17 +02:00
|
|
|
/* Unwindable const/copy equivalences. */
|
|
|
|
static const_and_copies *const_and_copies;
|
2015-09-15 19:03:49 +02:00
|
|
|
static avail_exprs_stack *avail_exprs_stack;
|
2004-09-17 23:16:07 +02:00
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
/* Track whether or not we have changed the control flow graph. */
|
|
|
|
static bool cfg_altered;
|
|
|
|
|
2004-06-29 08:59:35 +02:00
|
|
|
/* Bitmap of blocks that have had EH statements cleaned. We should
|
2004-07-02 02:51:01 +02:00
|
|
|
remove their dead edges eventually. */
|
2004-06-29 08:59:35 +02:00
|
|
|
static bitmap need_eh_cleanup;
|
2015-03-13 09:47:14 +01:00
|
|
|
static vec<gimple> need_noreturn_fixup;
|
2004-06-29 08:59:35 +02:00
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
/* Statistics for dominator optimizations. */
|
|
|
|
struct opt_stats_d
|
|
|
|
{
|
|
|
|
long num_stmts;
|
|
|
|
long num_exprs_considered;
|
|
|
|
long num_re;
|
backport: copy-prop, incremental SSA updating of FUD chains and newly exposed symbols.
Merge from tree-cleanup-branch: VRP, store CCP, store
copy-prop, incremental SSA updating of FUD chains and
newly exposed symbols.
* Makefile.in (tree-ssa-copy.o): Depend on tree-ssa-propagate.h.
(OBJS-common): Add tree-vrp.o.
(tree-vrp.o): New rule.
* basic-block.h (nearest_common_dominator_for_set): Declare.
* common.opt (ftree-store-ccp): New flag.
(ftree-copy-prop): New flag.
(ftree-vrp): New flag.
(ftree-store-copy-prop): New flag.
* dominance.c (nearest_common_dominator_for_set): New.
* domwalk.c (walk_dominator_tree): Only traverse
statements in blocks marked in walk_data->interesting_blocks.
* domwalk.h (struct dom_walk_data): Add field interesting_blocks.
* fold-const.c (fold): Handle ASSERT_EXPR.
* opts.c (decode_options): Set flag_tree_copy_prop at -O1.
Set flag_tree_store_ccp, flag_tree_store_copy_prop and
flag_tree_vrp at -O2.
* timevar.def (TV_TREE_VRP): Define.
(TV_TREE_COPY_PROP): Define.
(TV_TREE_STORE_COPY_PROP): Define.
(TV_TREE_SSA_INCREMENTAL): Define.
(TV_TREE_STORE_CCP): Define.
* tree-cfg.c (tree_can_merge_blocks_p): Remove reference
to kill_redundant_phi_nodes from comment.
(verify_expr): Handle ASSERT_EXPR.
* tree-dfa.c (mark_new_vars_to_rename): Remove second
argument. Update all users.
(mark_call_clobbered_vars_to_rename): Remove. Update all
users.
* tree-flow-inline.h (unmodifiable_var_p): New.
* tree-flow.h (enum value_range_type): Declare.
(struct value_range_def): Declare.
(value_range): Declare.
(remove_all_phi_nodes_for): Remove. Update all users.
(find_phi_node_for): Declare.
(add_type_alias): Declare.
(count_uses_and_derefs): Declare.
(kill_redundant_phi_nodes): Remove.
(rewrite_into_ssa): Remove.
(rewrite_def_def_chains): Remove.
(update_ssa, register_new_name_mapping, create_new_def_for,
need_ssa_update_p, name_registered_for_update_p,
release_ssa_name_after_update_ssa, dump_repl_tbl,
debug_repl_tbl, dump_names_replaced_by,
debug_names_replaced_by, mark_sym_for_renaming,
mark_set_for_renaming, get_current_def, set_current_def,
get_value_range, dump_value_range, debug_value_range,
dump_all_value_ranges, debug_all_value_ranges,
expr_computes_nonzero, loop_depth_of_name,
unmodifiable_var_p): Declare.
* tree-gimple.c (is_gimple_formal_tmp_rhs): Handle
ASSERT_EXPR.
* tree-into-ssa.c (block_defs_stack): Update comment.
(old_ssa_names, new_ssa_names, old_virtual_ssa_names,
syms_to_rename, names_to_release, repl_tbl,
need_to_initialize_update_ssa_p, need_to_update_vops_p,
need_to_replace_names_p): New locals.
(NAME_SETS_GROWTH_FACTOR): Define.
(struct repl_map_d): Declare.
(struct mark_def_sites_global_data): Add field
interesting_blocks.
(enum rewrite_mode): Declare.
(REGISTER_DEFS_IN_THIS_STMT): Define.
(compute_global_livein): Use last_basic_block instead of
n_basic_blocks.
(set_def_block): Remove last argument. Update all callers.
(prepare_use_operand_for_rename): Remove. Update all callers.
(prepare_def_operand_for_rename): Remove. Update all callers.
(symbol_marked_for_renaming): New.
(is_old_name): New.
(is_new_name): New.
(repl_map_hash): New.
(repl_map_eq): New.
(repl_map_free): New.
(names_replaced_by): New.
(add_to_repl_tbl): New.
(add_new_name_mapping): New.
(mark_def_sites): Assume that all the operands in the
statement are in normal form.
(find_idf): Assert that the block in the stack is valid.
(get_default_def_for): New.
(insert_phi_nodes_for): Add new argument 'update_p'.
Add documentation.
If update_p is true, add a new mapping between the LHS of
each new PHI and the name that it replaces.
(insert_phi_nodes_1): Only call find_idf if needed.
(get_reaching_def): Call get_default_def_for.
(rewrite_operand): Remove.
(rewrite_stmt): Do nothing if REGISTER_DEFS_IN_THIS_STMT
and REWRITE_THIS_STMT are false.
Assume that all the operands in the statement are in
normal form.
(rewrite_add_phi_arguments): Don't use PHI_REWRITTEN.
(rewrite_virtual_phi_arguments): Remove.
(invalidate_name_tags): Remove.
(register_new_update_single, register_new_update_set,
rewrite_update_init_block, replace_use,
rewrite_update_fini_block, rewrite_update_stmt,
rewrite_update_phi_arguments): New.
rewrite_blocks): Remove argument 'fix_virtual_phis'.
Add arguments 'entry', 'what' and 'blocks'.
Initialize the dominator walker according to 'what' and
'blocks'.
Start the dominator walk at 'entry'.
(mark_def_site_blocks): Add argument 'interesting_blocks'.
Use it to configure the dominator walker.
(rewrite_into_ssa): Remove argument 'all'.
Make internal.
(rewrite_all_into_ssa): Remove.
(rewrite_def_def_chains): Remove.
(mark_def_interesting, mark_use_interesting,
prepare_phi_args_for_update, prepare_block_for_update,
prepare_def_site_for, prepare_def_sites,
dump_names_replaced_by, debug_names_replaced_by,
dump_repl_tbl, debug_repl_tbl, init_update_ssa,
delete_update_ssa, create_new_def_for,
register_new_name_mapping, mark_sym_for_renaming,
mark_set_for_renaming, need_ssa_update_p,
name_registered_for_update_p, ssa_names_to_replace,
release_ssa_name_after_update_ssa,
insert_updated_phi_nodes_for, update_ssa): New.
* tree-loop-linear.c (linear_transform_loops): Call
update_ssa instead of rewrite_into_ssa.
* tree-optimize.c (vars_to_rename): Remove.
Update all users.
(init_tree_optimization_passes): Replace
pass_redundant_phi with pass_copy_prop.
Add pass_vrp.
Replace pass_ccp with pass_store_ccp.
Add pass_store_copy_prop after pass_store_ccp.
(execute_todo): If the TODO_ flags don't include updating
the SSA form, assert that it does not need to be updated.
Call update_ssa instead of rewrite_into_ssa and
rewrite_def_def_chains.
If TODO_verify_loops is set, call verify_loop_closed_ssa.
(tree_rest_of_compilation):
* tree-pass.h (TODO_dump_func, TODO_ggc_collect,
TODO_verify_ssa, TODO_verify_flow, TODO_verify_stmts,
TODO_cleanup_cfg): Renumber.
(TODO_verify_loops, TODO_update_ssa,
TODO_update_ssa_no_phi, TODO_update_ssa_full_phi,
TODO_update_ssa_only_virtuals): Define.
(pass_copy_prop, pass_store_ccp, pass_store_copy_prop, pass_vrp):
Declare.
* tree-phinodes.c (make_phi_node): Update documentation.
(remove_all_phi_nodes_for): Remove.
(find_phi_node_for): New.
* tree-pretty-print.c (dump_generic_node): Handle ASSERT_EXPR.
* tree-scalar-evolution.c (follow_ssa_edge_in_rhs): Likewise.
(interpret_rhs_modify_expr): Likewise.
* tree-sra.c (decide_instantiations): Mark all symbols in
SRA_CANDIDATES for renaming.
(mark_all_v_defs_1): Rename from mark_all_v_defs.
(mark_all_v_defs): New function. Update all users to call it
with the whole list of scalarized statements, not just the
first one.
* tree-ssa-alias.c (count_ptr_derefs): Make extern.
(compute_flow_insensitive_aliasing): If the tag is
unmodifiable and the variable isn't or vice-versa, don't
make them alias of each other.
(setup_pointers_and_addressables): If the type tag for
VAR is about to change, mark the old one for renaming.
(add_type_alias): New.
* tree-ssa-ccp.c: Document SSA-CCP and STORE-CCP.
(ccp_lattice_t): Rename from latticevalue.
(value): Remove. Update all users.
(const_val): New local variable.
(do_store_ccp): New local variable.
(dump_lattice_value): Handle UNINITIALIZED.
(debug_lattice_value): New.
(get_default_value): Re-write.
(set_lattice_value): Re-write.
(def_to_varying): Remove. Update all users.
(likely_value): Return VARYING for statements that make
stores when STORE_CCP is false.
Return VARYING for any statement other than MODIFY_EXPR,
COND_EXPR and SWITCH_EXPR.
(ccp_initialize): Re-write.
(replace_uses_in, replace_vuse_in, substitute_and_fold):
Move to tree-ssa-propagate.c.
(ccp_lattice_meet): Handle memory stores when
DO_STORE_CCP is true.
(ccp_visit_phi_node): Likewise.
(ccp_fold): Likewise.
(evaluate_stmt): Likewise.
(visit_assignment): Likewise.
(ccp_visit_stmt): Likewise.
(execute_ssa_ccp): Add argument 'store_ccp'. Copy it
into DO_STORE_CCP.
(do_ssa_ccp): New.
(pass_ccp): Use it.
(do_ssa_store_ccp): New.
(gate_store_ccp): New.
(pass_store_ccp): Declare.
* tree-ssa-copy.c: Include tree-ssa-propagate.h.
(may_propagate_copy): Reformat.
Don't abort if ORIG is a virtual and DEST isn't.
If NEW does not have alias information but DEST does,
copy it.
(copy_of, cached_last_copy_of, do_store_copy_prop, enum
copy_prop_kind, which_copy_prop): Declare.
(stmt_may_generate_copy, get_copy_of_val,
get_last_copy_of, set_copy_of_val, dump_copy_of,
copy_prop_visit_assignment, copy_prop_visit_cond_stmt,
copy_prop_visit_stmt, copy_prop_visit_phi_node,
init_copy_prop, fini_copy_prop, execute_copy_prop,
gate_copy_prop, do_copy_prop, gate_store_copy_prop,
store_copy_prop): New.
(pass_copy_prop, pass_store_copy_prop): Declare.
* tree-ssa-dom.c (struct opt_stats_d): Add fields
'num_const_prop' and 'num_copy_prop'.
(cprop_operand): Update them.
(dump_dominator_optimization_stats): Dump them.
(tree_ssa_dominator_optimize): Call update_ssa instead of
rewrite_into_ssa.
(loop_depth_of_name): Declare extern.
(simplify_cond_and_lookup_avail_expr): Guard against NULL
values for LOW or HIGH.
(cprop_into_successor_phis): Only propagate if NEW != ORIG.
(record_equivalences_from_stmt): Call expr_computes_nonzero.
(cprop_operand): Only propagate if VAL != OP.
* tree-ssa-dse.c (dse_optimize_stmt): Mark symbols in removed
statement for renaming.
* tree-ssa-loop-im.c (move_computations): Call update_ssa.
* tree-ssa-loop-ivopts.c (rewrite_address_base): Call
add_type_alias if necessary.
Call mark_new_vars_to_rename.
(tree_ssa_iv_optimize): If new symbols need to be renamed,
mark every statement updated, call update_ssa and
rewrite_into_loop_closed_ssa.
* tree-ssa-loop-manip.c (add_exit_phis): Do not remove DEF_BB
from LIVEIN if VAR is a virtual.
* tree-ssa-loop.c (tree_loop_optimizer_init): Call update_ssa.
* tree-ssa-operands.c (get_expr_operands): Handle ASSERT_EXPR.
(get_call_expr_operands): Reformat statement.
(add_stmt_operand): Don't create V_MAY_DEFs for read-only
symbols.
* tree-ssa-propagate.c (ssa_prop_init): Initialize
SSA_NAME_VALUE for every name.
(first_vdef, stmt_makes_single_load, stmt_makes_single_store,
get_value_loaded_by): New.
(replace_uses_in, replace_vuses_in, replace_phi_args_in,
substitute_and_fold): Move from tree-ssa-ccp.c.
* tree-ssa-propagate.h (struct prop_value_d, prop_value_t,
first_vdef, stmt_makes_single_load, stmt_makes_single_store,
get_value_loaded_by, replace_uses_in, substitute_and_fold):
Declare.
* tree-ssa.c (verify_use): Fix error message.
(propagate_into_addr, replace_immediate_uses, get_eq_name,
check_phi_redundancy, kill_redundant_phi_nodes,
pass_redundant_phi): Remove. Update all users.
* tree-vect-transform.c (vect_create_data_ref_ptr): Call
add_type_alias, if necessary.
* tree-vectorizer.h (struct _stmt_vect_info): Update
documentation for field 'memtag'.
* tree-vrp.c: New file.
* tree.def (ASSERT_EXPR): Define.
* tree.h (ASSERT_EXPR_VAR): Define.
(ASSERT_EXPR_COND): Define.
(SSA_NAME_VALUE_RANGE): Define.
(struct tree_ssa_name): Add field 'value_range'.
(PHI_REWRITTEN): Remove.
(struct tree_phi_node): Remove field 'rewritten'.
* doc/invoke.texi (-fdump-tree-storeccp, -ftree-copy-prop,
-ftree-store-copy-prop): Document.
* doc/tree-ssa.texi: Remove broken link to McCAT's compiler.
Document usage of update_ssa.
testsuite/ChangeLog
* g++.dg/tree-ssa/pr18178.C: New test.
* gcc.c-torture/execute/20030216-1.x: Ignore at -O1.
* gcc.c-torture/execute/20041019-1.c: New test.
* gcc.dg/tree-ssa/20041008-1.c: New test.
* gcc.dg/tree-ssa/ssa-ccp-12.c: New test.
* gcc.dg/tree-ssa/20030731-2.c: Update to use -fdump-tree-store_ccp.
* gcc.dg/tree-ssa/20030917-1.c: Likewise.
* gcc.dg/tree-ssa/20030917-3.c: Likewise.
* gcc.dg/tree-ssa/20040721-1.c: Likewise.
* gcc.dg/tree-ssa/ssa-ccp-1.c: Likewise.
* gcc.dg/tree-ssa/ssa-ccp-2.c: Likewise.
* gcc.dg/tree-ssa/ssa-ccp-3.c: Likewise.
* gcc.dg/tree-ssa/ssa-ccp-7.c: Likewise.
* gcc.dg/tree-ssa/ssa-ccp-9.c: Likewise.
From-SVN: r97884
2005-04-09 03:37:54 +02:00
|
|
|
long num_const_prop;
|
|
|
|
long num_copy_prop;
|
2004-05-13 08:41:07 +02:00
|
|
|
};
|
|
|
|
|
2004-09-22 06:12:01 +02:00
|
|
|
static struct opt_stats_d opt_stats;
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
/* Local functions. */
|
domwalk.h (struct dom_walk_data): Remove all callbacks except before_dom_children_before_stmts and...
2009-06-27 Paolo Bonzini <bonzini@gnu.org>
* domwalk.h (struct dom_walk_data): Remove all callbacks except
before_dom_children_before_stmts and after_dom_children_after_stmts.
Rename the two remaining callbacks to just before_dom_children and
after_dom_children. Remove other GIMPLE statement walking bits.
* domwalk.c (walk_dominator_tree): Remove now unsupported features.
* graphite.c: Do not include domwalk.h.
* tree-into-ssa.c (interesting_blocks): New global.
(struct mark_def_sites_global_data): Remove it and names_to_rename.
(mark_def_sites, rewrite_stmt, rewrite_add_phi_arguments,
rewrite_update_stmt, rewrite_update_phi_arguments): Simplify
now that they're not domwalk callbacks.
(rewrite_initialize_block): Rename to...
(rewrite_enter_block): ... this, place after called functions. Test
interesting_blocks, call rewrite_stmt and rewrite_add_phi_arguments.
(rewrite_finalize_block): Rename to...
(rewrite_leave_block): ... this, place after called functions.
(rewrite_update_init_block): Rename to...
(rewrite_update_enter_block): ... this, place after called functions.
Test interesting_blocks, call rewrite_update_stmt and
rewrite_update_phi_arguments.
(rewrite_update_fini_block): Rename to...
(rewrite_leave_block): ... this, place after called functions.
(rewrite_blocks): Remove last argument, simplify initialization of
walk_data.
(mark_def_sites_initialize_block): Rename to...
(mark_def_sites_block): ... this, call mark_def_sites.
(mark_def_sites_blocks): Remove argument, simplify initialization of
walk_data.
(rewrite_into_ssa): Adjust for interesting_blocks_being a global.
(update_ssa): Likewise.
* tree-ssa-dom.c (optimize_stmt): Simplify now that it's not a domwalk
callback.
(tree_ssa_dominator_optimize): Simplify initialization of walk_data.
(dom_opt_initialize_block): Rename to...
(dom_opt_enter_block): ... this, place after called functions. Walk
statements here, inline propagate_to_outgoing_edges.
(dom_opt_finalize_block): Rename to...
(dom_opt_leave_block): ... this, place after called functions.
* tree-ssa-dse.c (dse_optimize_stmt): Simplify now that it's not a
domwalk callback.
(dse_enter_block, dse_record_phi): New.
(dse_record_phis): Delete.
(dse_finalize_block): Rename to...
(dse_leave_block): ... this.
(tree_ssa_dse): Simplify initialization of walk_data.
* tree-ssa-loop-im.c (determine_invariantness, move_computations):
Adjust initialization of walk_data.
* tree-ssa-loop-unswitch.c: Do not include domwalk.h.
* tree-ssa-loop-phiopt.c (get_non_trapping):
Adjust initialization of walk_data.
* tree-ssa-loop-threadedge.c: Do not include domwalk.h.
* tree-ssa-uncprop.c (uncprop_into_successor_phis): Simplify now that
it's not a domwalk callback.
(uncprop_initialize_block): Rename to...
(dse_enter_block): ... this, call uncprop_into_successor_phis.
(dse_finalize_block): Rename to...
(dse_leave_block): ... this.
(tree_ssa_uncprop): Simplify initialization of walk_data.
* Makefile.in: Adjust dependencies.
From-SVN: r149008
2009-06-27 16:45:51 +02:00
|
|
|
static void optimize_stmt (basic_block, gimple_stmt_iterator);
|
2008-07-28 16:33:56 +02:00
|
|
|
static tree lookup_avail_expr (gimple, bool);
|
2015-09-15 19:03:49 +02:00
|
|
|
static hashval_t avail_expr_hash (class expr_hash_elt *);
|
Remove a layer of indirection from hash_table
gcc/
* hash-table.h: Remove a layer of indirection from hash_table so that
it contains the hash table's data instead of a pointer to the data.
* alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c,
config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c,
config/mips/mips.c, config/sol2.c, coverage.c, cselib.c,
data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c,
fold-const.c, gcse.c, ggc-common.c,
gimple-ssa-strength-reduction.c, gimplify.c,
graphite-clast-to-gimple.c, graphite-dependences.c,
graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c,
ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c,
loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c,
lto-streamer.c, lto-streamer.h, passes.c, plugin.c,
postreload-gcse.c, sese.c, statistics.c, store-motion.c,
trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c,
tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c,
tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c,
tree-ssa-live.c, tree-ssa-loop-im.c,
tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-tail-merge.c,
tree-ssa-threadupdate.c, tree-ssa-uncprop.c,
tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c,
tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c,
vtable-verify.c, vtable-verify.h: Adjust.
gcc/c/
* c-decl.c: Adjust.
gcc/cp/
* class.c, semantics.c, tree.c, vtable-class-hierarchy.c:
Adjust.
gcc/java/
* jcf-io.c: Adjust.
gcc/lto/
* lto.c: Adjust.
gcc/objc/
* objc-act.c: Adjust.
From-SVN: r211936
2014-06-24 15:21:35 +02:00
|
|
|
static void htab_statistics (FILE *,
|
|
|
|
const hash_table<expr_elt_hasher> &);
|
2010-08-17 11:55:04 +02:00
|
|
|
static void record_cond (cond_equivalence *);
|
2004-09-17 23:16:07 +02:00
|
|
|
static void record_equality (tree, tree);
|
2004-10-30 02:06:22 +02:00
|
|
|
static void record_equivalences_from_phis (basic_block);
|
|
|
|
static void record_equivalences_from_incoming_edge (basic_block);
|
2009-09-26 01:57:01 +02:00
|
|
|
static void eliminate_redundant_computations (gimple_stmt_iterator *);
|
2008-07-28 16:33:56 +02:00
|
|
|
static void record_equivalences_from_stmt (gimple, int);
|
2004-07-19 21:01:55 +02:00
|
|
|
static edge single_incoming_edge_ignoring_loop_edges (basic_block);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
backport: copy-prop, incremental SSA updating of FUD chains and newly exposed symbols.
Merge from tree-cleanup-branch: VRP, store CCP, store
copy-prop, incremental SSA updating of FUD chains and
newly exposed symbols.
* Makefile.in (tree-ssa-copy.o): Depend on tree-ssa-propagate.h.
(OBJS-common): Add tree-vrp.o.
(tree-vrp.o): New rule.
* basic-block.h (nearest_common_dominator_for_set): Declare.
* common.opt (ftree-store-ccp): New flag.
(ftree-copy-prop): New flag.
(ftree-vrp): New flag.
(ftree-store-copy-prop): New flag.
* dominance.c (nearest_common_dominator_for_set): New.
* domwalk.c (walk_dominator_tree): Only traverse
statements in blocks marked in walk_data->interesting_blocks.
* domwalk.h (struct dom_walk_data): Add field interesting_blocks.
* fold-const.c (fold): Handle ASSERT_EXPR.
* opts.c (decode_options): Set flag_tree_copy_prop at -O1.
Set flag_tree_store_ccp, flag_tree_store_copy_prop and
flag_tree_vrp at -O2.
* timevar.def (TV_TREE_VRP): Define.
(TV_TREE_COPY_PROP): Define.
(TV_TREE_STORE_COPY_PROP): Define.
(TV_TREE_SSA_INCREMENTAL): Define.
(TV_TREE_STORE_CCP): Define.
* tree-cfg.c (tree_can_merge_blocks_p): Remove reference
to kill_redundant_phi_nodes from comment.
(verify_expr): Handle ASSERT_EXPR.
* tree-dfa.c (mark_new_vars_to_rename): Remove second
argument. Update all users.
(mark_call_clobbered_vars_to_rename): Remove. Update all
users.
* tree-flow-inline.h (unmodifiable_var_p): New.
* tree-flow.h (enum value_range_type): Declare.
(struct value_range_def): Declare.
(value_range): Declare.
(remove_all_phi_nodes_for): Remove. Update all users.
(find_phi_node_for): Declare.
(add_type_alias): Declare.
(count_uses_and_derefs): Declare.
(kill_redundant_phi_nodes): Remove.
(rewrite_into_ssa): Remove.
(rewrite_def_def_chains): Remove.
(update_ssa, register_new_name_mapping, create_new_def_for,
need_ssa_update_p, name_registered_for_update_p,
release_ssa_name_after_update_ssa, dump_repl_tbl,
debug_repl_tbl, dump_names_replaced_by,
debug_names_replaced_by, mark_sym_for_renaming,
mark_set_for_renaming, get_current_def, set_current_def,
get_value_range, dump_value_range, debug_value_range,
dump_all_value_ranges, debug_all_value_ranges,
expr_computes_nonzero, loop_depth_of_name,
unmodifiable_var_p): Declare.
* tree-gimple.c (is_gimple_formal_tmp_rhs): Handle
ASSERT_EXPR.
* tree-into-ssa.c (block_defs_stack): Update comment.
(old_ssa_names, new_ssa_names, old_virtual_ssa_names,
syms_to_rename, names_to_release, repl_tbl,
need_to_initialize_update_ssa_p, need_to_update_vops_p,
need_to_replace_names_p): New locals.
(NAME_SETS_GROWTH_FACTOR): Define.
(struct repl_map_d): Declare.
(struct mark_def_sites_global_data): Add field
interesting_blocks.
(enum rewrite_mode): Declare.
(REGISTER_DEFS_IN_THIS_STMT): Define.
(compute_global_livein): Use last_basic_block instead of
n_basic_blocks.
(set_def_block): Remove last argument. Update all callers.
(prepare_use_operand_for_rename): Remove. Update all callers.
(prepare_def_operand_for_rename): Remove. Update all callers.
(symbol_marked_for_renaming): New.
(is_old_name): New.
(is_new_name): New.
(repl_map_hash): New.
(repl_map_eq): New.
(repl_map_free): New.
(names_replaced_by): New.
(add_to_repl_tbl): New.
(add_new_name_mapping): New.
(mark_def_sites): Assume that all the operands in the
statement are in normal form.
(find_idf): Assert that the block in the stack is valid.
(get_default_def_for): New.
(insert_phi_nodes_for): Add new argument 'update_p'.
Add documentation.
If update_p is true, add a new mapping between the LHS of
each new PHI and the name that it replaces.
(insert_phi_nodes_1): Only call find_idf if needed.
(get_reaching_def): Call get_default_def_for.
(rewrite_operand): Remove.
(rewrite_stmt): Do nothing if REGISTER_DEFS_IN_THIS_STMT
and REWRITE_THIS_STMT are false.
Assume that all the operands in the statement are in
normal form.
(rewrite_add_phi_arguments): Don't use PHI_REWRITTEN.
(rewrite_virtual_phi_arguments): Remove.
(invalidate_name_tags): Remove.
(register_new_update_single, register_new_update_set,
rewrite_update_init_block, replace_use,
rewrite_update_fini_block, rewrite_update_stmt,
rewrite_update_phi_arguments): New.
rewrite_blocks): Remove argument 'fix_virtual_phis'.
Add arguments 'entry', 'what' and 'blocks'.
Initialize the dominator walker according to 'what' and
'blocks'.
Start the dominator walk at 'entry'.
(mark_def_site_blocks): Add argument 'interesting_blocks'.
Use it to configure the dominator walker.
(rewrite_into_ssa): Remove argument 'all'.
Make internal.
(rewrite_all_into_ssa): Remove.
(rewrite_def_def_chains): Remove.
(mark_def_interesting, mark_use_interesting,
prepare_phi_args_for_update, prepare_block_for_update,
prepare_def_site_for, prepare_def_sites,
dump_names_replaced_by, debug_names_replaced_by,
dump_repl_tbl, debug_repl_tbl, init_update_ssa,
delete_update_ssa, create_new_def_for,
register_new_name_mapping, mark_sym_for_renaming,
mark_set_for_renaming, need_ssa_update_p,
name_registered_for_update_p, ssa_names_to_replace,
release_ssa_name_after_update_ssa,
insert_updated_phi_nodes_for, update_ssa): New.
* tree-loop-linear.c (linear_transform_loops): Call
update_ssa instead of rewrite_into_ssa.
* tree-optimize.c (vars_to_rename): Remove.
Update all users.
(init_tree_optimization_passes): Replace
pass_redundant_phi with pass_copy_prop.
Add pass_vrp.
Replace pass_ccp with pass_store_ccp.
Add pass_store_copy_prop after pass_store_ccp.
(execute_todo): If the TODO_ flags don't include updating
the SSA form, assert that it does not need to be updated.
Call update_ssa instead of rewrite_into_ssa and
rewrite_def_def_chains.
If TODO_verify_loops is set, call verify_loop_closed_ssa.
(tree_rest_of_compilation):
* tree-pass.h (TODO_dump_func, TODO_ggc_collect,
TODO_verify_ssa, TODO_verify_flow, TODO_verify_stmts,
TODO_cleanup_cfg): Renumber.
(TODO_verify_loops, TODO_update_ssa,
TODO_update_ssa_no_phi, TODO_update_ssa_full_phi,
TODO_update_ssa_only_virtuals): Define.
(pass_copy_prop, pass_store_ccp, pass_store_copy_prop, pass_vrp):
Declare.
* tree-phinodes.c (make_phi_node): Update documentation.
(remove_all_phi_nodes_for): Remove.
(find_phi_node_for): New.
* tree-pretty-print.c (dump_generic_node): Handle ASSERT_EXPR.
* tree-scalar-evolution.c (follow_ssa_edge_in_rhs): Likewise.
(interpret_rhs_modify_expr): Likewise.
* tree-sra.c (decide_instantiations): Mark all symbols in
SRA_CANDIDATES for renaming.
(mark_all_v_defs_1): Rename from mark_all_v_defs.
(mark_all_v_defs): New function. Update all users to call it
with the whole list of scalarized statements, not just the
first one.
* tree-ssa-alias.c (count_ptr_derefs): Make extern.
(compute_flow_insensitive_aliasing): If the tag is
unmodifiable and the variable isn't or vice-versa, don't
make them alias of each other.
(setup_pointers_and_addressables): If the type tag for
VAR is about to change, mark the old one for renaming.
(add_type_alias): New.
* tree-ssa-ccp.c: Document SSA-CCP and STORE-CCP.
(ccp_lattice_t): Rename from latticevalue.
(value): Remove. Update all users.
(const_val): New local variable.
(do_store_ccp): New local variable.
(dump_lattice_value): Handle UNINITIALIZED.
(debug_lattice_value): New.
(get_default_value): Re-write.
(set_lattice_value): Re-write.
(def_to_varying): Remove. Update all users.
(likely_value): Return VARYING for statements that make
stores when STORE_CCP is false.
Return VARYING for any statement other than MODIFY_EXPR,
COND_EXPR and SWITCH_EXPR.
(ccp_initialize): Re-write.
(replace_uses_in, replace_vuse_in, substitute_and_fold):
Move to tree-ssa-propagate.c.
(ccp_lattice_meet): Handle memory stores when
DO_STORE_CCP is true.
(ccp_visit_phi_node): Likewise.
(ccp_fold): Likewise.
(evaluate_stmt): Likewise.
(visit_assignment): Likewise.
(ccp_visit_stmt): Likewise.
(execute_ssa_ccp): Add argument 'store_ccp'. Copy it
into DO_STORE_CCP.
(do_ssa_ccp): New.
(pass_ccp): Use it.
(do_ssa_store_ccp): New.
(gate_store_ccp): New.
(pass_store_ccp): Declare.
* tree-ssa-copy.c: Include tree-ssa-propagate.h.
(may_propagate_copy): Reformat.
Don't abort if ORIG is a virtual and DEST isn't.
If NEW does not have alias information but DEST does,
copy it.
(copy_of, cached_last_copy_of, do_store_copy_prop, enum
copy_prop_kind, which_copy_prop): Declare.
(stmt_may_generate_copy, get_copy_of_val,
get_last_copy_of, set_copy_of_val, dump_copy_of,
copy_prop_visit_assignment, copy_prop_visit_cond_stmt,
copy_prop_visit_stmt, copy_prop_visit_phi_node,
init_copy_prop, fini_copy_prop, execute_copy_prop,
gate_copy_prop, do_copy_prop, gate_store_copy_prop,
store_copy_prop): New.
(pass_copy_prop, pass_store_copy_prop): Declare.
* tree-ssa-dom.c (struct opt_stats_d): Add fields
'num_const_prop' and 'num_copy_prop'.
(cprop_operand): Update them.
(dump_dominator_optimization_stats): Dump them.
(tree_ssa_dominator_optimize): Call update_ssa instead of
rewrite_into_ssa.
(loop_depth_of_name): Declare extern.
(simplify_cond_and_lookup_avail_expr): Guard against NULL
values for LOW or HIGH.
(cprop_into_successor_phis): Only propagate if NEW != ORIG.
(record_equivalences_from_stmt): Call expr_computes_nonzero.
(cprop_operand): Only propagate if VAL != OP.
* tree-ssa-dse.c (dse_optimize_stmt): Mark symbols in removed
statement for renaming.
* tree-ssa-loop-im.c (move_computations): Call update_ssa.
* tree-ssa-loop-ivopts.c (rewrite_address_base): Call
add_type_alias if necessary.
Call mark_new_vars_to_rename.
(tree_ssa_iv_optimize): If new symbols need to be renamed,
mark every statement updated, call update_ssa and
rewrite_into_loop_closed_ssa.
* tree-ssa-loop-manip.c (add_exit_phis): Do not remove DEF_BB
from LIVEIN if VAR is a virtual.
* tree-ssa-loop.c (tree_loop_optimizer_init): Call update_ssa.
* tree-ssa-operands.c (get_expr_operands): Handle ASSERT_EXPR.
(get_call_expr_operands): Reformat statement.
(add_stmt_operand): Don't create V_MAY_DEFs for read-only
symbols.
* tree-ssa-propagate.c (ssa_prop_init): Initialize
SSA_NAME_VALUE for every name.
(first_vdef, stmt_makes_single_load, stmt_makes_single_store,
get_value_loaded_by): New.
(replace_uses_in, replace_vuses_in, replace_phi_args_in,
substitute_and_fold): Move from tree-ssa-ccp.c.
* tree-ssa-propagate.h (struct prop_value_d, prop_value_t,
first_vdef, stmt_makes_single_load, stmt_makes_single_store,
get_value_loaded_by, replace_uses_in, substitute_and_fold):
Declare.
* tree-ssa.c (verify_use): Fix error message.
(propagate_into_addr, replace_immediate_uses, get_eq_name,
check_phi_redundancy, kill_redundant_phi_nodes,
pass_redundant_phi): Remove. Update all users.
* tree-vect-transform.c (vect_create_data_ref_ptr): Call
add_type_alias, if necessary.
* tree-vectorizer.h (struct _stmt_vect_info): Update
documentation for field 'memtag'.
* tree-vrp.c: New file.
* tree.def (ASSERT_EXPR): Define.
* tree.h (ASSERT_EXPR_VAR): Define.
(ASSERT_EXPR_COND): Define.
(SSA_NAME_VALUE_RANGE): Define.
(struct tree_ssa_name): Add field 'value_range'.
(PHI_REWRITTEN): Remove.
(struct tree_phi_node): Remove field 'rewritten'.
* doc/invoke.texi (-fdump-tree-storeccp, -ftree-copy-prop,
-ftree-store-copy-prop): Document.
* doc/tree-ssa.texi: Remove broken link to McCAT's compiler.
Document usage of update_ssa.
testsuite/ChangeLog
* g++.dg/tree-ssa/pr18178.C: New test.
* gcc.c-torture/execute/20030216-1.x: Ignore at -O1.
* gcc.c-torture/execute/20041019-1.c: New test.
* gcc.dg/tree-ssa/20041008-1.c: New test.
* gcc.dg/tree-ssa/ssa-ccp-12.c: New test.
* gcc.dg/tree-ssa/20030731-2.c: Update to use -fdump-tree-store_ccp.
* gcc.dg/tree-ssa/20030917-1.c: Likewise.
* gcc.dg/tree-ssa/20030917-3.c: Likewise.
* gcc.dg/tree-ssa/20040721-1.c: Likewise.
* gcc.dg/tree-ssa/ssa-ccp-1.c: Likewise.
* gcc.dg/tree-ssa/ssa-ccp-2.c: Likewise.
* gcc.dg/tree-ssa/ssa-ccp-3.c: Likewise.
* gcc.dg/tree-ssa/ssa-ccp-7.c: Likewise.
* gcc.dg/tree-ssa/ssa-ccp-9.c: Likewise.
From-SVN: r97884
2005-04-09 03:37:54 +02:00
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
/* Given a statement STMT, initialize the hash table element pointed to
|
|
|
|
by ELEMENT. */
|
|
|
|
|
2015-09-15 19:03:49 +02:00
|
|
|
expr_hash_elt::expr_hash_elt (gimple stmt, tree orig_lhs)
|
2008-07-28 16:33:56 +02:00
|
|
|
{
|
|
|
|
enum gimple_code code = gimple_code (stmt);
|
2015-09-15 19:03:49 +02:00
|
|
|
struct hashable_expr *expr = this->expr ();
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
|
|
if (code == GIMPLE_ASSIGN)
|
|
|
|
{
|
|
|
|
enum tree_code subcode = gimple_assign_rhs_code (stmt);
|
|
|
|
|
|
|
|
switch (get_gimple_rhs_class (subcode))
|
|
|
|
{
|
|
|
|
case GIMPLE_SINGLE_RHS:
|
2010-06-25 10:56:24 +02:00
|
|
|
expr->kind = EXPR_SINGLE;
|
2011-06-30 21:32:23 +02:00
|
|
|
expr->type = TREE_TYPE (gimple_assign_rhs1 (stmt));
|
2010-06-25 10:56:24 +02:00
|
|
|
expr->ops.single.rhs = gimple_assign_rhs1 (stmt);
|
|
|
|
break;
|
2008-07-28 16:33:56 +02:00
|
|
|
case GIMPLE_UNARY_RHS:
|
2010-06-25 10:56:24 +02:00
|
|
|
expr->kind = EXPR_UNARY;
|
2008-07-28 16:33:56 +02:00
|
|
|
expr->type = TREE_TYPE (gimple_assign_lhs (stmt));
|
2014-10-30 16:36:05 +01:00
|
|
|
if (CONVERT_EXPR_CODE_P (subcode))
|
2014-10-31 17:26:43 +01:00
|
|
|
subcode = NOP_EXPR;
|
2010-06-25 10:56:24 +02:00
|
|
|
expr->ops.unary.op = subcode;
|
|
|
|
expr->ops.unary.opnd = gimple_assign_rhs1 (stmt);
|
|
|
|
break;
|
2008-07-28 16:33:56 +02:00
|
|
|
case GIMPLE_BINARY_RHS:
|
2010-06-25 10:56:24 +02:00
|
|
|
expr->kind = EXPR_BINARY;
|
2008-07-28 16:33:56 +02:00
|
|
|
expr->type = TREE_TYPE (gimple_assign_lhs (stmt));
|
2010-06-25 10:56:24 +02:00
|
|
|
expr->ops.binary.op = subcode;
|
|
|
|
expr->ops.binary.opnd0 = gimple_assign_rhs1 (stmt);
|
|
|
|
expr->ops.binary.opnd1 = gimple_assign_rhs2 (stmt);
|
|
|
|
break;
|
|
|
|
case GIMPLE_TERNARY_RHS:
|
|
|
|
expr->kind = EXPR_TERNARY;
|
|
|
|
expr->type = TREE_TYPE (gimple_assign_lhs (stmt));
|
|
|
|
expr->ops.ternary.op = subcode;
|
|
|
|
expr->ops.ternary.opnd0 = gimple_assign_rhs1 (stmt);
|
|
|
|
expr->ops.ternary.opnd1 = gimple_assign_rhs2 (stmt);
|
|
|
|
expr->ops.ternary.opnd2 = gimple_assign_rhs3 (stmt);
|
|
|
|
break;
|
2008-07-28 16:33:56 +02:00
|
|
|
default:
|
|
|
|
gcc_unreachable ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (code == GIMPLE_COND)
|
|
|
|
{
|
|
|
|
expr->type = boolean_type_node;
|
|
|
|
expr->kind = EXPR_BINARY;
|
|
|
|
expr->ops.binary.op = gimple_cond_code (stmt);
|
|
|
|
expr->ops.binary.opnd0 = gimple_cond_lhs (stmt);
|
|
|
|
expr->ops.binary.opnd1 = gimple_cond_rhs (stmt);
|
|
|
|
}
|
2014-11-19 18:00:54 +01:00
|
|
|
else if (gcall *call_stmt = dyn_cast <gcall *> (stmt))
|
2008-07-28 16:33:56 +02:00
|
|
|
{
|
2014-11-19 18:00:54 +01:00
|
|
|
size_t nargs = gimple_call_num_args (call_stmt);
|
2008-07-28 16:33:56 +02:00
|
|
|
size_t i;
|
|
|
|
|
2014-11-19 18:00:54 +01:00
|
|
|
gcc_assert (gimple_call_lhs (call_stmt));
|
2008-07-28 16:33:56 +02:00
|
|
|
|
2014-11-19 18:00:54 +01:00
|
|
|
expr->type = TREE_TYPE (gimple_call_lhs (call_stmt));
|
2008-07-28 16:33:56 +02:00
|
|
|
expr->kind = EXPR_CALL;
|
2014-11-19 18:00:54 +01:00
|
|
|
expr->ops.call.fn_from = call_stmt;
|
2008-07-28 16:33:56 +02:00
|
|
|
|
2014-11-19 18:00:54 +01:00
|
|
|
if (gimple_call_flags (call_stmt) & (ECF_CONST | ECF_PURE))
|
2008-07-28 16:33:56 +02:00
|
|
|
expr->ops.call.pure = true;
|
2009-11-25 11:55:54 +01:00
|
|
|
else
|
2008-07-28 16:33:56 +02:00
|
|
|
expr->ops.call.pure = false;
|
|
|
|
|
|
|
|
expr->ops.call.nargs = nargs;
|
2011-12-08 23:00:38 +01:00
|
|
|
expr->ops.call.args = XCNEWVEC (tree, nargs);
|
2008-07-28 16:33:56 +02:00
|
|
|
for (i = 0; i < nargs; i++)
|
2014-11-19 18:00:54 +01:00
|
|
|
expr->ops.call.args[i] = gimple_call_arg (call_stmt, i);
|
2008-07-28 16:33:56 +02:00
|
|
|
}
|
2014-11-19 18:00:54 +01:00
|
|
|
else if (gswitch *swtch_stmt = dyn_cast <gswitch *> (stmt))
|
2008-07-28 16:33:56 +02:00
|
|
|
{
|
2014-11-19 18:00:54 +01:00
|
|
|
expr->type = TREE_TYPE (gimple_switch_index (swtch_stmt));
|
2008-07-28 16:33:56 +02:00
|
|
|
expr->kind = EXPR_SINGLE;
|
2014-11-19 18:00:54 +01:00
|
|
|
expr->ops.single.rhs = gimple_switch_index (swtch_stmt);
|
2008-07-28 16:33:56 +02:00
|
|
|
}
|
|
|
|
else if (code == GIMPLE_GOTO)
|
|
|
|
{
|
|
|
|
expr->type = TREE_TYPE (gimple_goto_dest (stmt));
|
|
|
|
expr->kind = EXPR_SINGLE;
|
|
|
|
expr->ops.single.rhs = gimple_goto_dest (stmt);
|
|
|
|
}
|
2011-12-08 23:00:38 +01:00
|
|
|
else if (code == GIMPLE_PHI)
|
|
|
|
{
|
|
|
|
size_t nargs = gimple_phi_num_args (stmt);
|
|
|
|
size_t i;
|
|
|
|
|
|
|
|
expr->type = TREE_TYPE (gimple_phi_result (stmt));
|
|
|
|
expr->kind = EXPR_PHI;
|
|
|
|
expr->ops.phi.nargs = nargs;
|
|
|
|
expr->ops.phi.args = XCNEWVEC (tree, nargs);
|
|
|
|
for (i = 0; i < nargs; i++)
|
|
|
|
expr->ops.phi.args[i] = gimple_phi_arg_def (stmt, i);
|
2015-09-15 19:03:49 +02:00
|
|
|
|
2011-12-08 23:00:38 +01:00
|
|
|
}
|
2008-07-28 16:33:56 +02:00
|
|
|
else
|
|
|
|
gcc_unreachable ();
|
|
|
|
|
2015-09-15 19:03:49 +02:00
|
|
|
m_lhs = orig_lhs;
|
|
|
|
m_vop = gimple_vuse (stmt);
|
|
|
|
m_hash = avail_expr_hash (this);
|
|
|
|
m_stamp = this;
|
2008-07-28 16:33:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Given a conditional expression COND as a tree, initialize
|
|
|
|
a hashable_expr expression EXPR. The conditional must be a
|
|
|
|
comparison or logical negation. A constant or a variable is
|
|
|
|
not permitted. */
|
|
|
|
|
|
|
|
static void
|
|
|
|
initialize_expr_from_cond (tree cond, struct hashable_expr *expr)
|
|
|
|
{
|
|
|
|
expr->type = boolean_type_node;
|
2009-11-25 11:55:54 +01:00
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
if (COMPARISON_CLASS_P (cond))
|
|
|
|
{
|
|
|
|
expr->kind = EXPR_BINARY;
|
|
|
|
expr->ops.binary.op = TREE_CODE (cond);
|
|
|
|
expr->ops.binary.opnd0 = TREE_OPERAND (cond, 0);
|
|
|
|
expr->ops.binary.opnd1 = TREE_OPERAND (cond, 1);
|
|
|
|
}
|
|
|
|
else if (TREE_CODE (cond) == TRUTH_NOT_EXPR)
|
|
|
|
{
|
|
|
|
expr->kind = EXPR_UNARY;
|
|
|
|
expr->ops.unary.op = TRUTH_NOT_EXPR;
|
|
|
|
expr->ops.unary.opnd = TREE_OPERAND (cond, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
gcc_unreachable ();
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Given a hashable_expr expression EXPR and an LHS,
|
|
|
|
initialize the hash table element pointed to by ELEMENT. */
|
|
|
|
|
2015-09-15 19:03:49 +02:00
|
|
|
expr_hash_elt::expr_hash_elt (struct hashable_expr *orig, tree orig_lhs)
|
2008-07-28 16:33:56 +02:00
|
|
|
{
|
2015-09-15 19:03:49 +02:00
|
|
|
m_expr = *orig;
|
|
|
|
m_lhs = orig_lhs;
|
|
|
|
m_vop = NULL_TREE;
|
|
|
|
m_hash = avail_expr_hash (this);
|
|
|
|
m_stamp = this;
|
|
|
|
}
|
|
|
|
|
|
|
|
expr_hash_elt::expr_hash_elt (class expr_hash_elt &old_elt)
|
|
|
|
{
|
|
|
|
m_expr = old_elt.m_expr;
|
|
|
|
m_lhs = old_elt.m_lhs;
|
|
|
|
m_vop = old_elt.m_vop;
|
|
|
|
m_hash = old_elt.m_hash;
|
|
|
|
m_stamp = this;
|
|
|
|
|
|
|
|
/* Now deep copy the malloc'd space for CALL and PHI args. */
|
|
|
|
if (old_elt.m_expr.kind == EXPR_CALL)
|
|
|
|
{
|
|
|
|
size_t nargs = old_elt.m_expr.ops.call.nargs;
|
|
|
|
size_t i;
|
|
|
|
|
|
|
|
m_expr.ops.call.args = XCNEWVEC (tree, nargs);
|
|
|
|
for (i = 0; i < nargs; i++)
|
|
|
|
m_expr.ops.call.args[i] = old_elt.m_expr.ops.call.args[i];
|
|
|
|
}
|
|
|
|
else if (old_elt.m_expr.kind == EXPR_PHI)
|
|
|
|
{
|
|
|
|
size_t nargs = old_elt.m_expr.ops.phi.nargs;
|
|
|
|
size_t i;
|
|
|
|
|
|
|
|
m_expr.ops.phi.args = XCNEWVEC (tree, nargs);
|
|
|
|
for (i = 0; i < nargs; i++)
|
|
|
|
m_expr.ops.phi.args[i] = old_elt.m_expr.ops.phi.args[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
expr_hash_elt::~expr_hash_elt ()
|
|
|
|
{
|
|
|
|
if (m_expr.kind == EXPR_CALL)
|
|
|
|
free (m_expr.ops.call.args);
|
|
|
|
else if (m_expr.kind == EXPR_PHI)
|
|
|
|
free (m_expr.ops.phi.args);
|
2008-07-28 16:33:56 +02:00
|
|
|
}
|
|
|
|
|
2015-07-13 06:46:34 +02:00
|
|
|
/* Compare two hashable_expr structures for equivalence. They are
|
|
|
|
considered equivalent when the expressions they denote must
|
|
|
|
necessarily be equal. The logic is intended to follow that of
|
|
|
|
operand_equal_p in fold-const.c */
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
|
|
static bool
|
|
|
|
hashable_expr_equal_p (const struct hashable_expr *expr0,
|
2015-09-15 19:03:49 +02:00
|
|
|
const struct hashable_expr *expr1)
|
2008-07-28 16:33:56 +02:00
|
|
|
{
|
|
|
|
tree type0 = expr0->type;
|
|
|
|
tree type1 = expr1->type;
|
|
|
|
|
|
|
|
/* If either type is NULL, there is nothing to check. */
|
|
|
|
if ((type0 == NULL_TREE) ^ (type1 == NULL_TREE))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
/* If both types don't have the same signedness, precision, and mode,
|
|
|
|
then we can't consider them equal. */
|
|
|
|
if (type0 != type1
|
|
|
|
&& (TREE_CODE (type0) == ERROR_MARK
|
|
|
|
|| TREE_CODE (type1) == ERROR_MARK
|
|
|
|
|| TYPE_UNSIGNED (type0) != TYPE_UNSIGNED (type1)
|
|
|
|
|| TYPE_PRECISION (type0) != TYPE_PRECISION (type1)
|
|
|
|
|| TYPE_MODE (type0) != TYPE_MODE (type1)))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (expr0->kind != expr1->kind)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
switch (expr0->kind)
|
|
|
|
{
|
|
|
|
case EXPR_SINGLE:
|
|
|
|
return operand_equal_p (expr0->ops.single.rhs,
|
|
|
|
expr1->ops.single.rhs, 0);
|
|
|
|
|
|
|
|
case EXPR_UNARY:
|
|
|
|
if (expr0->ops.unary.op != expr1->ops.unary.op)
|
|
|
|
return false;
|
|
|
|
|
2008-08-18 18:23:47 +02:00
|
|
|
if ((CONVERT_EXPR_CODE_P (expr0->ops.unary.op)
|
2008-07-28 16:33:56 +02:00
|
|
|
|| expr0->ops.unary.op == NON_LVALUE_EXPR)
|
|
|
|
&& TYPE_UNSIGNED (expr0->type) != TYPE_UNSIGNED (expr1->type))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
return operand_equal_p (expr0->ops.unary.opnd,
|
|
|
|
expr1->ops.unary.opnd, 0);
|
|
|
|
|
|
|
|
case EXPR_BINARY:
|
2010-06-25 10:56:24 +02:00
|
|
|
if (expr0->ops.binary.op != expr1->ops.binary.op)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (operand_equal_p (expr0->ops.binary.opnd0,
|
|
|
|
expr1->ops.binary.opnd0, 0)
|
|
|
|
&& operand_equal_p (expr0->ops.binary.opnd1,
|
|
|
|
expr1->ops.binary.opnd1, 0))
|
|
|
|
return true;
|
|
|
|
|
|
|
|
/* For commutative ops, allow the other order. */
|
|
|
|
return (commutative_tree_code (expr0->ops.binary.op)
|
|
|
|
&& operand_equal_p (expr0->ops.binary.opnd0,
|
|
|
|
expr1->ops.binary.opnd1, 0)
|
|
|
|
&& operand_equal_p (expr0->ops.binary.opnd1,
|
|
|
|
expr1->ops.binary.opnd0, 0));
|
|
|
|
|
|
|
|
case EXPR_TERNARY:
|
|
|
|
if (expr0->ops.ternary.op != expr1->ops.ternary.op
|
|
|
|
|| !operand_equal_p (expr0->ops.ternary.opnd2,
|
|
|
|
expr1->ops.ternary.opnd2, 0))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (operand_equal_p (expr0->ops.ternary.opnd0,
|
|
|
|
expr1->ops.ternary.opnd0, 0)
|
|
|
|
&& operand_equal_p (expr0->ops.ternary.opnd1,
|
|
|
|
expr1->ops.ternary.opnd1, 0))
|
|
|
|
return true;
|
|
|
|
|
|
|
|
/* For commutative ops, allow the other order. */
|
|
|
|
return (commutative_ternary_tree_code (expr0->ops.ternary.op)
|
|
|
|
&& operand_equal_p (expr0->ops.ternary.opnd0,
|
|
|
|
expr1->ops.ternary.opnd1, 0)
|
|
|
|
&& operand_equal_p (expr0->ops.ternary.opnd1,
|
|
|
|
expr1->ops.ternary.opnd0, 0));
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
|
|
case EXPR_CALL:
|
|
|
|
{
|
|
|
|
size_t i;
|
|
|
|
|
|
|
|
/* If the calls are to different functions, then they
|
|
|
|
clearly cannot be equal. */
|
2011-04-20 10:21:25 +02:00
|
|
|
if (!gimple_call_same_target_p (expr0->ops.call.fn_from,
|
|
|
|
expr1->ops.call.fn_from))
|
2008-07-28 16:33:56 +02:00
|
|
|
return false;
|
|
|
|
|
|
|
|
if (! expr0->ops.call.pure)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (expr0->ops.call.nargs != expr1->ops.call.nargs)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
for (i = 0; i < expr0->ops.call.nargs; i++)
|
|
|
|
if (! operand_equal_p (expr0->ops.call.args[i],
|
|
|
|
expr1->ops.call.args[i], 0))
|
|
|
|
return false;
|
|
|
|
|
2014-05-20 19:01:35 +02:00
|
|
|
if (stmt_could_throw_p (expr0->ops.call.fn_from))
|
|
|
|
{
|
|
|
|
int lp0 = lookup_stmt_eh_lp (expr0->ops.call.fn_from);
|
|
|
|
int lp1 = lookup_stmt_eh_lp (expr1->ops.call.fn_from);
|
|
|
|
if ((lp0 > 0 || lp1 > 0) && lp0 != lp1)
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
return true;
|
|
|
|
}
|
2009-11-25 11:55:54 +01:00
|
|
|
|
2011-12-08 23:00:38 +01:00
|
|
|
case EXPR_PHI:
|
|
|
|
{
|
|
|
|
size_t i;
|
|
|
|
|
|
|
|
if (expr0->ops.phi.nargs != expr1->ops.phi.nargs)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
for (i = 0; i < expr0->ops.phi.nargs; i++)
|
|
|
|
if (! operand_equal_p (expr0->ops.phi.args[i],
|
|
|
|
expr1->ops.phi.args[i], 0))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
default:
|
|
|
|
gcc_unreachable ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-11-08 23:46:16 +01:00
|
|
|
/* Generate a hash value for a pair of expressions. This can be used
|
2014-08-01 04:52:30 +02:00
|
|
|
iteratively by passing a previous result in HSTATE.
|
2013-11-08 23:46:16 +01:00
|
|
|
|
|
|
|
The same hash value is always returned for a given pair of expressions,
|
|
|
|
regardless of the order in which they are presented. This is useful in
|
|
|
|
hashing the operands of commutative functions. */
|
|
|
|
|
2014-08-01 04:52:30 +02:00
|
|
|
namespace inchash
|
2013-11-08 23:46:16 +01:00
|
|
|
{
|
|
|
|
|
2014-08-01 04:52:30 +02:00
|
|
|
static void
|
|
|
|
add_expr_commutative (const_tree t1, const_tree t2, hash &hstate)
|
|
|
|
{
|
|
|
|
hash one, two;
|
2013-11-08 23:46:16 +01:00
|
|
|
|
2014-08-01 04:52:30 +02:00
|
|
|
inchash::add_expr (t1, one);
|
|
|
|
inchash::add_expr (t2, two);
|
|
|
|
hstate.add_commutative (one, two);
|
2013-11-08 23:46:16 +01:00
|
|
|
}
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
/* Compute a hash value for a hashable_expr value EXPR and a
|
|
|
|
previously accumulated hash value VAL. If two hashable_expr
|
|
|
|
values compare equal with hashable_expr_equal_p, they must
|
|
|
|
hash to the same value, given an identical value of VAL.
|
2014-08-01 04:52:30 +02:00
|
|
|
The logic is intended to follow inchash::add_expr in tree.c. */
|
2008-07-28 16:33:56 +02:00
|
|
|
|
2014-08-01 04:52:30 +02:00
|
|
|
static void
|
|
|
|
add_hashable_expr (const struct hashable_expr *expr, hash &hstate)
|
2008-07-28 16:33:56 +02:00
|
|
|
{
|
|
|
|
switch (expr->kind)
|
|
|
|
{
|
|
|
|
case EXPR_SINGLE:
|
2014-08-01 04:52:30 +02:00
|
|
|
inchash::add_expr (expr->ops.single.rhs, hstate);
|
2008-07-28 16:33:56 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case EXPR_UNARY:
|
2014-08-01 04:52:30 +02:00
|
|
|
hstate.add_object (expr->ops.unary.op);
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
|
|
/* Make sure to include signedness in the hash computation.
|
|
|
|
Don't hash the type, that can lead to having nodes which
|
|
|
|
compare equal according to operand_equal_p, but which
|
|
|
|
have different hash codes. */
|
2008-08-18 18:23:47 +02:00
|
|
|
if (CONVERT_EXPR_CODE_P (expr->ops.unary.op)
|
2008-07-28 16:33:56 +02:00
|
|
|
|| expr->ops.unary.op == NON_LVALUE_EXPR)
|
2014-08-01 04:52:30 +02:00
|
|
|
hstate.add_int (TYPE_UNSIGNED (expr->type));
|
2008-07-28 16:33:56 +02:00
|
|
|
|
2014-08-01 04:52:30 +02:00
|
|
|
inchash::add_expr (expr->ops.unary.opnd, hstate);
|
2008-07-28 16:33:56 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case EXPR_BINARY:
|
2014-08-01 04:52:30 +02:00
|
|
|
hstate.add_object (expr->ops.binary.op);
|
2008-07-28 16:33:56 +02:00
|
|
|
if (commutative_tree_code (expr->ops.binary.op))
|
2014-08-01 04:52:30 +02:00
|
|
|
inchash::add_expr_commutative (expr->ops.binary.opnd0,
|
|
|
|
expr->ops.binary.opnd1, hstate);
|
2008-07-28 16:33:56 +02:00
|
|
|
else
|
|
|
|
{
|
2014-08-01 04:52:30 +02:00
|
|
|
inchash::add_expr (expr->ops.binary.opnd0, hstate);
|
|
|
|
inchash::add_expr (expr->ops.binary.opnd1, hstate);
|
2008-07-28 16:33:56 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2010-06-25 10:56:24 +02:00
|
|
|
case EXPR_TERNARY:
|
2014-08-01 04:52:30 +02:00
|
|
|
hstate.add_object (expr->ops.ternary.op);
|
2010-06-25 10:56:24 +02:00
|
|
|
if (commutative_ternary_tree_code (expr->ops.ternary.op))
|
2014-08-01 04:52:30 +02:00
|
|
|
inchash::add_expr_commutative (expr->ops.ternary.opnd0,
|
|
|
|
expr->ops.ternary.opnd1, hstate);
|
2010-06-25 10:56:24 +02:00
|
|
|
else
|
|
|
|
{
|
2014-08-01 04:52:30 +02:00
|
|
|
inchash::add_expr (expr->ops.ternary.opnd0, hstate);
|
|
|
|
inchash::add_expr (expr->ops.ternary.opnd1, hstate);
|
2010-06-25 10:56:24 +02:00
|
|
|
}
|
2014-08-01 04:52:30 +02:00
|
|
|
inchash::add_expr (expr->ops.ternary.opnd2, hstate);
|
2010-06-25 10:56:24 +02:00
|
|
|
break;
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
case EXPR_CALL:
|
|
|
|
{
|
|
|
|
size_t i;
|
|
|
|
enum tree_code code = CALL_EXPR;
|
2014-11-19 18:00:54 +01:00
|
|
|
gcall *fn_from;
|
2008-07-28 16:33:56 +02:00
|
|
|
|
2014-08-01 04:52:30 +02:00
|
|
|
hstate.add_object (code);
|
2011-04-20 10:21:25 +02:00
|
|
|
fn_from = expr->ops.call.fn_from;
|
|
|
|
if (gimple_call_internal_p (fn_from))
|
2014-08-01 04:52:30 +02:00
|
|
|
hstate.merge_hash ((hashval_t) gimple_call_internal_fn (fn_from));
|
2011-04-20 10:21:25 +02:00
|
|
|
else
|
2014-08-01 04:52:30 +02:00
|
|
|
inchash::add_expr (gimple_call_fn (fn_from), hstate);
|
2008-07-28 16:33:56 +02:00
|
|
|
for (i = 0; i < expr->ops.call.nargs; i++)
|
2014-08-01 04:52:30 +02:00
|
|
|
inchash::add_expr (expr->ops.call.args[i], hstate);
|
2008-07-28 16:33:56 +02:00
|
|
|
}
|
|
|
|
break;
|
2009-11-25 11:55:54 +01:00
|
|
|
|
2011-12-08 23:00:38 +01:00
|
|
|
case EXPR_PHI:
|
|
|
|
{
|
|
|
|
size_t i;
|
|
|
|
|
|
|
|
for (i = 0; i < expr->ops.phi.nargs; i++)
|
2014-08-01 04:52:30 +02:00
|
|
|
inchash::add_expr (expr->ops.phi.args[i], hstate);
|
2011-12-08 23:00:38 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
default:
|
|
|
|
gcc_unreachable ();
|
|
|
|
}
|
2014-08-01 04:52:30 +02:00
|
|
|
}
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Print a diagnostic dump of an expression hash table entry. */
|
|
|
|
|
2015-09-15 19:03:49 +02:00
|
|
|
void
|
|
|
|
expr_hash_elt::print (FILE *stream)
|
2008-07-28 16:33:56 +02:00
|
|
|
{
|
2014-11-20 09:40:52 +01:00
|
|
|
fprintf (stream, "STMT ");
|
2008-07-28 16:33:56 +02:00
|
|
|
|
2015-09-15 19:03:49 +02:00
|
|
|
if (m_lhs)
|
2008-07-28 16:33:56 +02:00
|
|
|
{
|
2015-09-15 19:03:49 +02:00
|
|
|
print_generic_expr (stream, m_lhs, 0);
|
2008-07-28 16:33:56 +02:00
|
|
|
fprintf (stream, " = ");
|
|
|
|
}
|
2009-11-25 11:55:54 +01:00
|
|
|
|
2015-09-15 19:03:49 +02:00
|
|
|
switch (m_expr.kind)
|
2008-07-28 16:33:56 +02:00
|
|
|
{
|
|
|
|
case EXPR_SINGLE:
|
2015-09-15 19:03:49 +02:00
|
|
|
print_generic_expr (stream, m_expr.ops.single.rhs, 0);
|
2008-07-28 16:33:56 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case EXPR_UNARY:
|
2015-09-15 19:03:49 +02:00
|
|
|
fprintf (stream, "%s ", get_tree_code_name (m_expr.ops.unary.op));
|
|
|
|
print_generic_expr (stream, m_expr.ops.unary.opnd, 0);
|
2008-07-28 16:33:56 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case EXPR_BINARY:
|
2015-09-15 19:03:49 +02:00
|
|
|
print_generic_expr (stream, m_expr.ops.binary.opnd0, 0);
|
|
|
|
fprintf (stream, " %s ", get_tree_code_name (m_expr.ops.binary.op));
|
|
|
|
print_generic_expr (stream, m_expr.ops.binary.opnd1, 0);
|
2008-07-28 16:33:56 +02:00
|
|
|
break;
|
|
|
|
|
2010-06-25 10:56:24 +02:00
|
|
|
case EXPR_TERNARY:
|
2015-09-15 19:03:49 +02:00
|
|
|
fprintf (stream, " %s <", get_tree_code_name (m_expr.ops.ternary.op));
|
|
|
|
print_generic_expr (stream, m_expr.ops.ternary.opnd0, 0);
|
2010-06-25 10:56:24 +02:00
|
|
|
fputs (", ", stream);
|
2015-09-15 19:03:49 +02:00
|
|
|
print_generic_expr (stream, m_expr.ops.ternary.opnd1, 0);
|
2010-06-25 10:56:24 +02:00
|
|
|
fputs (", ", stream);
|
2015-09-15 19:03:49 +02:00
|
|
|
print_generic_expr (stream, m_expr.ops.ternary.opnd2, 0);
|
2010-06-25 10:56:24 +02:00
|
|
|
fputs (">", stream);
|
|
|
|
break;
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
case EXPR_CALL:
|
|
|
|
{
|
|
|
|
size_t i;
|
2015-09-15 19:03:49 +02:00
|
|
|
size_t nargs = m_expr.ops.call.nargs;
|
2014-11-19 18:00:54 +01:00
|
|
|
gcall *fn_from;
|
2011-04-20 10:21:25 +02:00
|
|
|
|
2015-09-15 19:03:49 +02:00
|
|
|
fn_from = m_expr.ops.call.fn_from;
|
2011-04-20 10:21:25 +02:00
|
|
|
if (gimple_call_internal_p (fn_from))
|
|
|
|
fputs (internal_fn_name (gimple_call_internal_fn (fn_from)),
|
|
|
|
stream);
|
|
|
|
else
|
|
|
|
print_generic_expr (stream, gimple_call_fn (fn_from), 0);
|
2008-07-28 16:33:56 +02:00
|
|
|
fprintf (stream, " (");
|
|
|
|
for (i = 0; i < nargs; i++)
|
|
|
|
{
|
2015-09-15 19:03:49 +02:00
|
|
|
print_generic_expr (stream, m_expr.ops.call.args[i], 0);
|
2008-07-28 16:33:56 +02:00
|
|
|
if (i + 1 < nargs)
|
|
|
|
fprintf (stream, ", ");
|
|
|
|
}
|
|
|
|
fprintf (stream, ")");
|
|
|
|
}
|
|
|
|
break;
|
2011-12-08 23:00:38 +01:00
|
|
|
|
|
|
|
case EXPR_PHI:
|
|
|
|
{
|
|
|
|
size_t i;
|
2015-09-15 19:03:49 +02:00
|
|
|
size_t nargs = m_expr.ops.phi.nargs;
|
2011-12-08 23:00:38 +01:00
|
|
|
|
|
|
|
fprintf (stream, "PHI <");
|
|
|
|
for (i = 0; i < nargs; i++)
|
|
|
|
{
|
2015-09-15 19:03:49 +02:00
|
|
|
print_generic_expr (stream, m_expr.ops.phi.args[i], 0);
|
2011-12-08 23:00:38 +01:00
|
|
|
if (i + 1 < nargs)
|
|
|
|
fprintf (stream, ", ");
|
|
|
|
}
|
|
|
|
fprintf (stream, ">");
|
|
|
|
}
|
|
|
|
break;
|
2008-07-28 16:33:56 +02:00
|
|
|
}
|
|
|
|
|
2015-09-15 19:03:49 +02:00
|
|
|
if (m_vop)
|
2008-07-28 16:33:56 +02:00
|
|
|
{
|
2014-11-20 09:40:52 +01:00
|
|
|
fprintf (stream, " with ");
|
2015-09-15 19:03:49 +02:00
|
|
|
print_generic_expr (stream, m_vop, 0);
|
2008-07-28 16:33:56 +02:00
|
|
|
}
|
2014-11-20 09:40:52 +01:00
|
|
|
|
|
|
|
fprintf (stream, "\n");
|
2008-07-28 16:33:56 +02:00
|
|
|
}
|
|
|
|
|
2012-08-21 13:48:42 +02:00
|
|
|
/* Delete an expr_hash_elt and reclaim its storage. */
|
2011-12-08 23:00:38 +01:00
|
|
|
|
2012-08-21 13:48:42 +02:00
|
|
|
static void
|
|
|
|
free_expr_hash_elt (void *elt)
|
|
|
|
{
|
2015-09-15 19:03:49 +02:00
|
|
|
class expr_hash_elt *element = ((class expr_hash_elt *)elt);
|
|
|
|
delete element;
|
2008-07-28 16:33:56 +02:00
|
|
|
}
|
|
|
|
|
2004-10-30 02:06:22 +02:00
|
|
|
/* Allocate an EDGE_INFO for edge E and attach it to E.
|
|
|
|
Return the new EDGE_INFO structure. */
|
|
|
|
|
|
|
|
static struct edge_info *
|
|
|
|
allocate_edge_info (edge e)
|
|
|
|
{
|
|
|
|
struct edge_info *edge_info;
|
|
|
|
|
2005-12-18 10:26:53 +01:00
|
|
|
edge_info = XCNEW (struct edge_info);
|
2004-10-30 02:06:22 +02:00
|
|
|
|
|
|
|
e->aux = edge_info;
|
|
|
|
return edge_info;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Free all EDGE_INFO structures associated with edges in the CFG.
|
2004-10-30 14:15:09 +02:00
|
|
|
If a particular edge can be threaded, copy the redirection
|
2004-10-30 02:06:22 +02:00
|
|
|
target from the EDGE_INFO structure into the edge's AUX field
|
|
|
|
as required by code to update the CFG and SSA graph for
|
|
|
|
jump threading. */
|
|
|
|
|
|
|
|
static void
|
|
|
|
free_all_edge_infos (void)
|
|
|
|
{
|
|
|
|
basic_block bb;
|
|
|
|
edge_iterator ei;
|
|
|
|
edge e;
|
|
|
|
|
Eliminate FOR_EACH_BB macro.
gcc/
* basic-block.h (FOR_EACH_BB): Eliminate macro.
* asan.c (transform_statements, execute_sanopt): Eliminate
use of FOR_EACH_BB in favor of FOR_EACH_BB_FN, to make use of cfun
explicit.
* auto-inc-dec.c (rest_of_handle_auto_inc_dec): Likewise.
* bb-reorder.c (find_rarely_executed_basic_blocks_and_crossing_edges,
set_edge_can_fallthru_flag, fix_up_fall_thru_edges,
fix_crossing_unconditional_branches, add_reg_crossing_jump_notes,
insert_section_boundary_note, rest_of_handle_reorder_blocks,
duplicate_computed_gotos): Likewise.
* cfg.c (clear_edges, compact_blocks, brief_dump_cfg): Likewise.
* cfganal.c (find_unreachable_blocks, add_noreturn_fake_exit_edges,
compute_dominance_frontiers_1, single_pred_before_succ_order): Likewise.
* cfgbuild.c (find_many_sub_basic_blocks): Likewise.
* cfgcleanup.c (try_optimize_cfg, delete_dead_jumptables): Likewise.
* cfgexpand.c (add_scope_conflicts, discover_nonconstant_array_refs):
Likewise.
* cfgloop.c (flow_loops_cfg_dump, get_loop_body, record_loop_exits,
verify_loop_structure): Likewise.
* cfgloopanal.c (mark_loop_exit_edges): Likewise.
* cfgrtl.c (compute_bb_for_insn, find_partition_fixes,
verify_hot_cold_block_grouping, purge_all_dead_edges,
fixup_abnormal_edges, record_effective_endpoints,
outof_cfg_layout_mode, fixup_reorder_chain, force_one_exit_fallthru,
break_superblocks): Likewise.
* cgraphbuild.c (build_cgraph_edges, rebuild_cgraph_edges,
cgraph_rebuild_references): Likewise.
* combine-stack-adj.c (combine_stack_adjustments): Likewise.
* combine.c (delete_noop_moves, create_log_links,
combine_instructions): Likewise.
* config/arm/arm.c (thumb1_reorg, thumb2_reorg): Likewise.
* config/bfin/bfin.c (bfin_gen_bundles, reorder_var_tracking_notes):
Likewise.
* config/c6x/c6x.c (c6x_gen_bundles, conditionalize_after_sched,
c6x_reorg): Likewise.
* config/epiphany/resolve-sw-modes.c (resolve_sw_modes): Likewise.
* config/frv/frv.c (frv_optimize_membar): Likewise.
* config/i386/i386.c (ix86_finalize_stack_realign_flags): Likewise.
* config/ia64/ia64.c (ia64_reorg): Likewise.
* config/mips/mips.c (mips_annotate_pic_calls): Likewise.
* config/picochip/picochip.c (reorder_var_tracking_notes): Likewise.
* config/rs6000/rs6000.c (rs6000_alloc_sdmode_stack_slot): Likewise.
* config/s390/s390.c (s390_regs_ever_clobbered): Likewise.
* config/sh/sh_treg_combine.cc (sh_treg_combine::execute): Likewise.
* config/spu/spu.c (spu_machine_dependent_reorg): Likewise.
* config/tilegx/tilegx.c (tilegx_gen_bundles,
reorder_var_tracking_notes): Likewise.
* config/tilepro/tilepro.c (tilepro_gen_bundles,
reorder_var_tracking_notes): Likewise.
* coverage.c (coverage_compute_cfg_checksum): Likewise.
* cprop.c (compute_hash_table_work, compute_cprop_data,
local_cprop_pass, find_implicit_sets): Likewise.
* cse.c (cse_condition_code_reg): Likewise.
* dce.c (prescan_insns_for_dce): Likewise.
* df-core.c (df_compact_blocks): Likewise.
* df-problems.c (df_word_lr_alloc): Likewise.
* df-scan.c (df_scan_start_dump, df_scan_blocks, df_insn_rescan_all,
df_update_entry_exit_and_calls): Likewise.
* dominance.c (calculate_dominance_info, verify_dominators,
debug_dominance_info): Likewise.
* dse.c (dse_step5_nospill): Likewise.
* except.c (finish_eh_generation): Likewise.
* final.c (compute_alignments): Likewise.
* function.c (thread_prologue_and_epilogue_insns,
rest_of_match_asm_constraints): Likewise.
* gcse.c (compute_hash_table_work, prune_expressions,
compute_pre_data, compute_code_hoist_vbeinout, hoist_code,
calculate_bb_reg_pressure, compute_ld_motion_mems): Likewise.
* gimple-iterator.c (gsi_commit_edge_inserts): Likewise.
* gimple-ssa-isolate-paths.c (find_implicit_erroneous_behaviour,
find_explicit_erroneous_behaviour): Likewise.
* graphite-sese-to-poly.c (rewrite_reductions_out_of_ssa,
rewrite_cross_bb_scalar_deps_out_of_ssa): Likewise.
* haifa-sched.c (haifa_sched_init): Likewise.
* hw-doloop.c (discover_loops, set_bb_indices, reorder_loops):
Likewise.
* ifcvt.c (if_convert): Likewise.
* init-regs.c (initialize_uninitialized_regs): Likewise.
* ipa-prop.c (ipcp_transform_function): Likewise.
* ipa-pure-const.c (analyze_function): Likewise.
* ipa-split.c (find_split_points, execute_split_functions): Likewise.
* ira-build.c (form_loop_tree): Likewise.
* ira-costs.c (find_costs_and_classes): Likewise.
* ira-emit.c (emit_moves, add_ranges_and_copies, ira_emit): Likewise.
* ira.c (decrease_live_ranges_number, compute_regs_asm_clobbered,
mark_elimination, update_equiv_regs, find_moveable_pseudos,
split_live_ranges_for_shrink_wrap, allocate_initial_values): Likewise.
* jump.c (mark_all_labels): Likewise.
* lcm.c (compute_laterin, compute_insert_delete, compute_available,
compute_nearerout, compute_rev_insert_delete): Likewise.
* loop-init.c (fix_loop_structure): Likewise.
* loop-invariant.c (calculate_loop_reg_pressure): Likewise.
* lower-subreg.c (decompose_multiword_subregs,
decompose_multiword_subregs): Likewise.
* lra-assigns.c (assign_by_spills): Likewise.
* lra-coalesce.c (lra_coalesce): Likewise.
* lra-constraints.c (lra_inheritance, remove_inheritance_pseudos):
Likewise.
* lra-eliminations.c (lra_init_elimination): Likewise.
* lra-spills.c (assign_spill_hard_regs, spill_pseudos,
lra_final_code_change): Likewise.
* lra.c (remove_scratches, check_rtl, has_nonexceptional_receiver,
update_inc_notes): Likewise.
* mcf.c (adjust_cfg_counts): Likewise.
* mode-switching.c (optimize_mode_switching): Likewise.
* modulo-sched.c (rest_of_handle_sms): Likewise.
* omp-low.c (optimize_omp_library_calls, expand_omp_taskreg,
expand_omp_target): Likewise.
* postreload-gcse.c (alloc_mem, compute_hash_table): Likewise.
* postreload.c (reload_cse_regs_1): Likewise.
* predict.c (strip_predict_hints, tree_bb_level_predictions,
tree_estimate_probability, expensive_function_p,
estimate_bb_frequencies, compute_function_frequency): Likewise.
* profile.c (is_inconsistent, compute_branch_probabilities,
branch_prob): Likewise.
* ree.c (find_removable_extensions): Likewise.
* reg-stack.c (compensate_edges, convert_regs, reg_to_stack): Likewise.
* regcprop.c (copyprop_hardreg_forward): Likewise.
* reginfo.c (init_subregs_of_mode): Likewise.
* regrename.c (regrename_analyze): Likewise.
* regstat.c (regstat_compute_ri, regstat_compute_calls_crossed):
Likewise.
* reload1.c (has_nonexceptional_receiver, reload,
calculate_elim_costs_all_insns): Likewise.
* resource.c (init_resource_info, free_resource_info): Likewise.
* sched-ebb.c (schedule_ebbs): Likewise.
* sched-rgn.c (is_cfg_nonregular, find_single_block_region,
haifa_find_rgns, sched_rgn_local_init): Likewise.
* sel-sched-dump.c (sel_dump_cfg_2): Likewise.
* sel-sched-ir.c (init_lv_sets, free_lv_sets,
make_regions_from_the_rest): Likewise.
* sese.c (build_sese_loop_nests, sese_build_liveouts): Likewise.
* stack-ptr-mod.c (notice_stack_pointer_modification): Likewise.
* store-motion.c (compute_store_table, build_store_vectors,
one_store_motion_pass): Likewise.
* tracer.c (tail_duplicate): Likewise.
* trans-mem.c (compute_transaction_bits): Likewise.
* tree-call-cdce.c (tree_call_cdce): Likewise.
* tree-cfg.c (replace_loop_annotate, factor_computed_gotos,
fold_cond_expr_cond, make_edges, assign_discriminators,
make_abnormal_goto_edges, cleanup_dead_labels, group_case_labels,
dump_cfg_stats, gimple_verify_flow_info, print_loop,
execute_fixup_cfg): Likewise.
* tree-cfgcleanup.c (cleanup_tree_cfg_1, merge_phi_nodes): Likewise.
* tree-complex.c (init_dont_simulate_again, tree_lower_complex):
Likewise.
* tree-dfa.c (collect_dfa_stats, dump_enumerated_decls): Likewise.
* tree-eh.c (execute_lower_resx, execute_lower_eh_dispatch,
mark_reachable_handlers): Likewise.
* tree-emutls.c (lower_emutls_function_body): Likewise.
* tree-if-conv.c (main_tree_if_conversion): Likewise.
* tree-inline.c (optimize_inline_calls): Likewise.
* tree-into-ssa.c (rewrite_into_ssa, update_ssa): Likewise.
* tree-nrv.c (tree_nrv, execute_return_slot_opt): Likewise.
* tree-object-size.c (compute_object_sizes): Likewise.
* tree-outof-ssa.c (eliminate_useless_phis, rewrite_trees,
insert_backedge_copies, tree_profiling): Likewise.
* tree-scalar-evolution.c (scev_const_prop): Likewise.
* tree-sra.c (scan_function, sra_modify_function_body,
propagate_dereference_distances, ipa_sra_modify_function_body,
convert_callers): Likewise.
* tree-ssa-ccp.c (ccp_initialize, execute_fold_all_builtins): Likewise.
* tree-ssa-coalesce.c (build_ssa_conflict_graph): Likewise.
create_outofssa_var_map, coalesce_partitions): Likewise.
* tree-ssa-copy.c (init_copy_prop): Likewise.
* tree-ssa-copyrename.c (rename_ssa_copies): Likewise.
* tree-ssa-dce.c (find_obviously_necessary_stmts,
eliminate_unnecessary_stmts): Likewise.
* tree-ssa-dom.c (free_all_edge_infos, tree_ssa_dominator_optimize):
Likewise.
* tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Likewise.
* tree-ssa-live.c (clear_unused_block_pointer, remove_unused_locals,
new_tree_live_info, calculate_live_on_exit, dump_live_info,
analyze_memory_references, fill_always_executed_in,
tree_ssa_lim_finalize): Likewise.
* tree-ssa-loop-manip.c (find_uses_to_rename, verify_loop_closed_ssa):
Likewise.
* tree-ssa-math-opts.c (execute_cse_reciprocals, execute_cse_sincos,
execute_optimize_bswap, execute_optimize_widening_mul): Likewise.
* tree-ssa-propagate.c (substitute_and_fold): Likewise.
* tree-ssa-structalias.c (compute_points_to_sets): Likewise.
* tree-ssa-tail-merge.c (find_same_succ, reset_cluster_vectors):
Likewise.
* tree-ssa-ter.c (find_replaceable_exprs): Likewise.
* tree-ssa-threadupdate.c (thread_through_all_blocks): Likewise.
* tree-ssa-uncprop.c (associate_equivalences_with_edges,
tree_ssa_uncprop): Likewise.
* tree-ssa-uninit.c (warn_uninitialized_vars,
execute_late_warn_uninitialized): Likewise.
* tree-ssa.c (verify_ssa, execute_update_addresses_taken): Likewise.
* tree-stdarg.c (check_all_va_list_escapes, execute_optimize_stdarg):
Likewise.
* tree-switch-conversion.c (do_switchconv): Likewise.
* tree-vect-generic.c (expand_vector_operations): Likewise.
* tree-vectorizer.c (adjust_simduid_builtins, note_simd_array_uses,
execute_vect_slp): Likewise.
* tree-vrp.c (check_all_array_refs, remove_range_assertions,
vrp_initialize, identify_jump_threads, instrument_memory_accesses):
Likewise.
* ubsan.c (ubsan_pass): Likewise.
* value-prof.c (verify_histograms, gimple_value_profile_transformations,
gimple_find_values_to_profile): Likewise.
* var-tracking.c (vt_find_locations, dump_dataflow_sets, vt_emit_notes,
vt_initialize, delete_debug_insns, vt_finalize): Likewise.
gcc/testsuite/
* g++.dg/plugin/selfassign.c (execute_warn_self_assign): Eliminate
use of FOR_EACH_BB in favor of FOR_EACH_BB_FN, to make use of cfun
explicit.
* gcc.dg/plugin/selfassign.c (execute_warn_self_assign): Likewise.
From-SVN: r205828
2013-12-09 22:06:06 +01:00
|
|
|
FOR_EACH_BB_FN (bb, cfun)
|
2004-10-30 02:06:22 +02:00
|
|
|
{
|
|
|
|
FOR_EACH_EDGE (e, ei, bb->preds)
|
|
|
|
{
|
2005-12-18 10:26:53 +01:00
|
|
|
struct edge_info *edge_info = (struct edge_info *) e->aux;
|
2004-10-30 02:06:22 +02:00
|
|
|
|
|
|
|
if (edge_info)
|
|
|
|
{
|
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'.
This patch rewrites the old VEC macro-based interface into a new one
based on the template class 'vec'. The user-visible changes are
described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec.
I have tested the patch pretty extensively:
- Regular bootstraps on x86_64, ppc, ia64, sparc and hppa.
- Bootstraps with --enable-checking=release
- Bootstraps with --enable-checking=gc,gcac
- Basic builds on all targets (using contrib/config-list.mk).
We no longer access the vectors via VEC_* macros. The pattern is
"VEC_operation (T, A, V, args)" becomes "V.operation (args)".
The only thing I could not do is create proper ctors and dtors for the
vec class. Since these vectors are stored in unions, we
have to keep them as PODs (C++03 does not allow non-PODs in unions).
This means that creation and destruction must be explicit. There is a
new method vec<type, allocation, layout>::create() and another vec<type,
allocation, layout>::destroy() to allocate the internal vector.
For vectors that must be pointers, there is a family of free functions
that implement the operations that need to tolerate NULL vectors.
These functions all start with the prefix 'vec_safe_'. See the wiki
page for details.
The gengtype change removes the special handling for VEC() that used
to exist in gengtype. Additionally, it allows gengtype to recognize
templates of more than one argument and introduces the concept of an
undefined type (useful for template arguments that may or may not be
types).
When a TYPE_UNDEFINED is reached, gengtype will ignore it if it
happens inside a type marked with GTY((user)). Otherwise, it will
emit an error.
Finally, gengtype rejects root types marked GTY((user)) that are not
first class pointers.
2012-11-16 Diego Novillo <dnovillo@google.com>
VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec)
* vec.c (register_overhead): Convert it into
member function of vec_prefix.
(release_overhead): Likewise.
(calculate_allocation): Likewise.
(vec_heap_free): Remove.
(vec_gc_o_reserve_1): Remove.
(vec_heap_o_reserve_1): Remove.
(vec_stack_o_reserve_1): Remove.
(vec_stack_o_reserve_exact): Remove.
(register_stack_vec): New.
(stack_vec_register_index): New.
(unregister_stack_vec): New.
(vec_assert_fail): Remove.
* vec.h: Conditionally include ggc.h. Document conditional
hackery.
Update top-level documentation.
(ALONE_VEC_CHECK_INFO): Remove.
(VEC_CHECK_INFO): Remove.
(ALONE_VEC_CHECK_DECL): Remove.
(VEC_CHECK_DECL): Remove.
(ALONE_VEC_CHECK_PASS): Remove.
(VEC_CHECK_PASS): Remove.
(VEC_ASSERT): Remove.
(vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and
va_stack.
Mark fields alloc_ and num_ as protected.
(struct vec_t): Remove. Remove all function members.
(struct vl_embed): Declare.
(struct vl_ptr): Declare.
(free): Remove.
(reserve_exact): Remove.
(reserve): Remove.
(safe_splice): Remove.
(safe_push): Remove.
(safe_grow): Remove.
(safe_grow_cleared): Remove.
(safe_insert): Remove.
(DEF_VEC_I): Remove.
(DEF_VEC_ALLOC_I): Remove.
(DEF_VEC_P): Remove.
(DEF_VEC_ALLOC_P): Remove.
(DEF_VEC_O): Remove.
(DEF_VEC_ALLOC_O): Remove.
(DEF_VEC_ALLOC_P_STACK): Remove.
(DEF_VEC_ALLOC_O_STACK): Remove.
(DEF_VEC_ALLOC_I_STACK): Remove.
(DEF_VEC_A): Remove.
(DEF_VEC_ALLOC_A): Remove.
(vec_stack_p_reserve_exact_1): Remove.
(vec_stack_o_reserve): Remove.
(vec_stack_o_reserve_exact): Remove.
(VEC_length): Remove.
(VEC_empty): Remove.
(VEC_address): Remove.
(vec_address): Remove.
(VEC_last): Remove.
(VEC_index): Remove.
(VEC_iterate): Remove.
(VEC_embedded_size): Remove.
(VEC_embedded_init): Remove.
(VEC_free): Remove.
(VEC_copy): Remove.
(VEC_space): Remove.
(VEC_reserve): Remove.
(VEC_reserve_exact): Remove.
(VEC_splice): Remove.
(VEC_safe_splice): Remove.
(VEC_quick_push): Remove.
(VEC_safe_push): Remove.
(VEC_pop): Remove.
(VEC_truncate): Remove.
(VEC_safe_grow): Remove.
(VEC_replace): Remove.
(VEC_quick_insert): Remove.
(VEC_safe_insert): Remove.
(VEC_ordered_remove): Remove.
(VEC_unordered_remove): Remove.
(VEC_block_remove): Remove.
(VEC_lower_bound): Remove.
(VEC_alloc): Remove.
(VEC_qsort): Remove.
(va_heap): Declare.
(va_heap::default_layout): New typedef to vl_ptr.
(va_heap::reserve): New.
(va_heap::release): New.
(va_gc): Declare.
(va_gc::default_layout): New typedef to vl_embed.
(va_gc::reserve): New.
(va_gc::release): New.
(va_gc_atomic): Declare. Inherit from va_gc.
(va_stack): Declare.
(va_stack::default_layout): New typedef to vl_ptr.
(va_stack::alloc): New.
(va_stack::reserve): New.
(va_stack::release): New.
(register_stack_vec): Declare.
(stack_vec_register_index): Declare.
(unregister_stack_vec): Declare.
(vec<T, A = va_heap, L = typename A::default_layout>): Declare
empty vec template.
(vec<T, A, vl_embed>): Partial specialization for embedded
layout.
(vec<T, A, vl_embed>::allocated): New.
(vec<T, A, vl_embed>::length): New.
(vec<T, A, vl_embed>::is_empty): New.
(vec<T, A, vl_embed>::address): New.
(vec<T, A, vl_embed>::operator[]): New.
(vec<T, A, vl_embed>::last New.
(vec<T, A, vl_embed>::space): New.
(vec<T, A, vl_embed>::iterate): New.
(vec<T, A, vl_embed>::iterate): New.
(vec<T, A, vl_embed>::copy): New.
(vec<T, A, vl_embed>::splice): New.
(vec<T, A, vl_embed>::quick_push New.
(vec<T, A, vl_embed>::pop New.
(vec<T, A, vl_embed>::truncate): New.
(vec<T, A, vl_embed>::quick_insert): New.
(vec<T, A, vl_embed>::ordered_remove): New.
(vec<T, A, vl_embed>::unordered_remove): New.
(vec<T, A, vl_embed>::block_remove): New.
(vec<T, A, vl_embed>::qsort): New.
(vec<T, A, vl_embed>::lower_bound): New.
(vec<T, A, vl_embed>::embedded_size): New.
(vec<T, A, vl_embed>::embedded_init): New.
(vec<T, A, vl_embed>::quick_grow): New.
(vec<T, A, vl_embed>::quick_grow_cleared): New.
(vec_safe_space): New.
(vec_safe_length): New.
(vec_safe_address): New.
(vec_safe_is_empty): New.
(vec_safe_reserve): New.
(vec_safe_reserve_exact): New.
(vec_alloc): New.
(vec_free): New.
(vec_safe_grow): New.
(vec_safe_grow_cleared): New.
(vec_safe_iterate): New.
(vec_safe_push): New.
(vec_safe_insert): New.
(vec_safe_truncate): New.
(vec_safe_copy): New.
(vec_safe_splice): New.
(vec<T, A, vl_ptr>): New partial specialization for the space
efficient layout.
(vec<T, A, vl_ptr>::exists): New.
(vec<T, A, vl_ptr>::is_empty): New.
(vec<T, A, vl_ptr>::length): New.
(vec<T, A, vl_ptr>::address): New.
(vec<T, A, vl_ptr>::operator[]): New.
(vec<T, A, vl_ptr>::operator!=): New.
(vec<T, A, vl_ptr>::operator==): New.
(vec<T, A, vl_ptr>::last): New.
(vec<T, A, vl_ptr>::space): New.
(vec<T, A, vl_ptr>::iterate): New.
(vec<T, A, vl_ptr>::copy): New.
(vec<T, A, vl_ptr>::reserve): New.
(vec<T, A, vl_ptr>::reserve_exact): New.
(vec<T, A, vl_ptr>::splice): New.
(vec<T, A, vl_ptr>::safe_splice): New.
(vec<T, A, vl_ptr>::quick_push): New.
(vec<T, A, vl_ptr>::safe_push): New.
(vec<T, A, vl_ptr>::pop): New.
(vec<T, A, vl_ptr>::truncate): New.
(vec<T, A, vl_ptr>::safe_grow): New.
(vec<T, A, vl_ptr>::safe_grow_cleared): New.
(vec<T, A, vl_ptr>::quick_grow): New.
(vec<T, A, vl_ptr>::quick_grow_cleared): New.
(vec<T, A, vl_ptr>::quick_insert): New.
(vec<T, A, vl_ptr>::safe_insert): New.
(vec<T, A, vl_ptr>::ordered_remove): New.
(vec<T, A, vl_ptr>::unordered_remove): New.
(vec<T, A, vl_ptr>::block_remove): New.
(vec<T, A, vl_ptr>::qsort): New.
(vec<T, A, vl_ptr>::lower_bound): New.
(vec_stack_alloc): Define.
(FOR_EACH_VEC_SAFE_ELT): Define.
* vecir.h: Remove. Update all users.
* vecprim.h: Remove. Update all users.
Move uchar to coretypes.h.
* Makefile.in (VEC_H): Add $(GGC_H).
Remove vecir.h and vecprim.h dependencies everywhere.
2012-11-16 Diego Novillo <dnovillo@google.com>
* gengtype-lex.l (VEC): Remove.
Add characters in the set [\!\>\.-].
* gengtype-parse.c (token_names): Remove "VEC".
(require_template_declaration): Remove handling of VEC_TOKEN.
(type): Likewise.
Call create_user_defined_type when parsing GTY((user)).
* gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED.
(write_state_undefined_type): New.
(write_state_type): Call write_state_undefined_type for
TYPE_UNDEFINED.
(read_state_type): Call read_state_undefined_type for
TYPE_UNDEFINED.
* gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED.
(create_user_defined_type): Make extern.
(type_for_name): Factor out of resolve_typedef.
(create_undefined_type): New
(resolve_typedef): Call it when we cannot find a previous
typedef and the type is not a template.
(find_structure): Accept TYPE_UNDEFINED.
(set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES,
default to false.
Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or
ALLOWED_UNDEFINED_TYPES is set.
Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT.
(filter_type_name): Accept templates with more than one
argument.
(output_mangled_typename): Handle TYPE_UNDEFINED
(walk_type): Likewise.
(write_types_process_field): Likewise.
(write_func_for_structure): If CHAIN_NEXT is set, ORIG_S
should not be a user-defined type.
(write_types_local_user_process_field): Handle TYPE_ARRAY,
TYPE_NONE and TYPE_UNDEFINED.
(write_types_local_process_field): Likewise.
(contains_scalar_p): Return 0 for TYPE_USER_STRUCT.
(write_root): Reject user-defined types that are not pointers.
Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT
and TYPE_PARAM_STRUCT.
(output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and
TYPE_ARRAY.
(dump_typekind): Handle TYPE_UNDEFINED.
* gengtype.h (enum typekind): Add TYPE_UNDEFINED.
(create_user_defined_type): Declare.
(enum gty_token): Remove VEC_TOKEN.
2012-11-16 Diego Novillo <dnovillo@google.com>
Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec)
* coretypes.h (uchar): Define.
* alias.c: Use new vec API in vec.h.
* asan.c: Likewise.
* attribs.c: Likewise.
* basic-block.h: Likewise.
* bb-reorder.c: Likewise.
* builtins.c: Likewise.
* calls.c: Likewise.
* cfg.c: Likewise.
* cfganal.c: Likewise.
* cfgcleanup.c: Likewise.
* cfgexpand.c: Likewise.
* cfghooks.c: Likewise.
* cfghooks.h: Likewise.
* cfgloop.c: Likewise.
* cfgloop.h: Likewise.
* cfgloopanal.c: Likewise.
* cfgloopmanip.c: Likewise.
* cfgrtl.c: Likewise.
* cgraph.c: Likewise.
* cgraph.h: Likewise.
* cgraphclones.c: Likewise.
* cgraphunit.c: Likewise.
* combine.c: Likewise.
* compare-elim.c: Likewise.
* coverage.c: Likewise.
* cprop.c: Likewise.
* data-streamer.h: Likewise.
* dbxout.c: Likewise.
* dce.c: Likewise.
* df-core.c: Likewise.
* df-problems.c: Likewise.
* df-scan.c: Likewise.
* dominance.c: Likewise.
* domwalk.c: Likewise.
* domwalk.h: Likewise.
* dse.c: Likewise.
* dwarf2cfi.c: Likewise.
* dwarf2out.c: Likewise.
* dwarf2out.h: Likewise.
* emit-rtl.c: Likewise.
* except.c: Likewise.
* except.h: Likewise.
* expr.c: Likewise.
* expr.h: Likewise.
* final.c: Likewise.
* fold-const.c: Likewise.
* function.c: Likewise.
* function.h: Likewise.
* fwprop.c: Likewise.
* gcc.c: Likewise.
* gcse.c: Likewise.
* genattr.c: Likewise.
* genattrtab.c: Likewise.
* genautomata.c: Likewise.
* genextract.c: Likewise.
* genopinit.c: Likewise
* ggc-common.c: Likewise.
* ggc.h: Likewise.
* gimple-low.c: Likewise.
* gimple-ssa-strength-reduction.c: Likewise.
* gimple-streamer-in.c: Likewise.
* gimple.c: Likewise.
* gimple.h: Likewise.
* gimplify.c: Likewise.
* graph.c: Likewise.
* graphds.c: Likewise.
* graphds.h: Likewise.
* graphite-blocking.c: Likewise.
* graphite-clast-to-gimple.c: Likewise.
* graphite-dependences.c: Likewise.
* graphite-interchange.c: Likewise.
* graphite-optimize-isl.c: Likewise.
* graphite-poly.c: Likewise.
* graphite-poly.h: Likewise.
* graphite-scop-detection.c: Likewise.
* graphite-scop-detection.h: Likewise.
* graphite-sese-to-poly.c: Likewise.
* graphite.c: Likewise.
* godump.c: Likewise.
* haifa-sched.c: Likewise.
* hw-doloop.c: Likewise.
* hw-doloop.h: Likewise.
* ifcvt.c: Likewise.
* insn-addr.h: Likewise.
* ipa-cp.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* ipa-inline-transform.c: Likewise.
* ipa-inline.c: Likewise.
* ipa-inline.h: Likewise.
* ipa-prop.c: Likewise.
* ipa-prop.h: Likewise.
* ipa-pure-const.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-ref.c: Likewise.
* ipa-ref.h: Likewise.
* ipa-reference.c: Likewise.
* ipa-split.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-utils.h: Likewise.
* ipa.c: Likewise.
* ira-build.c: Likewise.
* ira-color.c: Likewise.
* ira-emit.c: Likewise.
* ira-int.h: Likewise.
* ira.c: Likewise.
* loop-invariant.c: Likewise.
* loop-unroll.c: Likewise.
* lower-subreg.c: Likewise.
* lra-lives.c: Likewise.
* lra.c: Likewise.
* lto-cgraph.c: Likewise.
* lto-section-out.c: Likewise.
* lto-streamer-in.c: Likewise.
* lto-streamer-out.c: Likewise.
* lto-streamer.h: Likewise.
* lto-symtab.c: Likewise.
* mcf.c: Likewise.
* modulo-sched.c: Likewise.
* omp-low.c: Likewise.
* opts-common.c: Likewise.
* opts-global.c: Likewise.
* opts.c: Likewise.
* opts.h: Likewise.
* passes.c: Likewise.
* predict.c: Likewise.
* print-tree.c: Likewise.
* profile.c: Likewise.
* profile.h: Likewise.
* read-rtl.c: Likewise.
* ree.c: Likewise.
* reg-stack.c: Likewise.
* regrename.c: Likewise.
* regrename.h: Likewise.
* reload.c: Likewise.
* reload.h: Likewise.
* reload1.c: Likewise.
* rtl.h: Likewise.
* sched-deps.c: Likewise.
* sched-int.h: Likewise.
* sdbout.c: Likewise.
* sel-sched-dump.c: Likewise.
* sel-sched-ir.c: Likewise.
* sel-sched-ir.h: Likewise.
* sel-sched.c: Likewise.
* sese.c: Likewise.
* sese.h: Likewise.
* statistics.h: Likewise.
* stmt.c: Likewise.
* stor-layout.c: Likewise.
* store-motion.c: Likewise.
* tlink.c: Likewise.
* toplev.c: Likewise.
* trans-mem.c: Likewise.
* tree-browser.c: Likewise.
* tree-call-cdce.c: Likewise.
* tree-cfg.c: Likewise.
* tree-cfgcleanup.c: Likewise.
* tree-chrec.c: Likewise.
* tree-chrec.h: Likewise.
* tree-complex.c: Likewise.
* tree-data-ref.c: Likewise.
* tree-data-ref.h: Likewise.
* tree-dfa.c: Likewise.
* tree-diagnostic.c: Likewise.
* tree-dump.c: Likewise.
* tree-eh.c: Likewise.
* tree-emutls.c: Likewise.
* tree-flow.h: Likewise.
* tree-if-conv.c: Likewise.
* tree-inline.c: Likewise.
* tree-inline.h: Likewise.
* tree-into-ssa.c: Likewise.
* tree-iterator.c: Likewise.
* tree-loop-distribution.c: Likewise.
* tree-mudflap.c: Likewise.
* tree-optimize.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-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-dce.c: Likewise.
* tree-ssa-dom.c: Likewise.
* tree-ssa-forwprop.c: Likewise.
* tree-ssa-live.c: Likewise.
* tree-ssa-live.h: 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-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-sccvn.h: Likewise.
* tree-ssa-strlen.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* tree-ssa-tail-merge.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-streamer.h: Likewise.
* tree-switch-conversion.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-vectorizer.h: Likewise.
* tree-vrp.c: Likewise.
* tree.c: Likewise.
* tree.h: Likewise.
* value-prof.c: Likewise.
* value-prof.h: Likewise.
* var-tracking.c: Likewise.
* varasm.c: Likewise.
* varpool.c: Likewise.
* vmsdbgout.c: Likewise.
* config/bfin/bfin.c: Likewise.
* config/c6x/c6x.c: Likewise.
* config/darwin.c: Likewise.
* config/i386/i386.c: Likewise.
* config/ia64/ia64.c: Likewise.
* config/mep/mep.c: Likewise.
* config/mips/mips.c: Likewise.
* config/pa/pa.c: Likewise.
* config/rs6000/rs6000-c.c: Likewise.
* config/rs6000/rs6000.c: Likewise.
* config/rx/rx.c: Likewise.
* config/spu/spu-c.c: Likewise.
* config/vms/vms.c: Likewise.
* config/vxworks.c: Likewise.
* config/epiphany/resolve-sw-modes.c: Likewise.
From-SVN: r193595
2012-11-18 03:54:30 +01:00
|
|
|
edge_info->cond_equivalences.release ();
|
2004-10-30 02:06:22 +02:00
|
|
|
free (edge_info);
|
2006-01-11 21:39:42 +01:00
|
|
|
e->aux = NULL;
|
2004-10-30 02:06:22 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-04-15 20:51:49 +02:00
|
|
|
/* Build a cond_equivalence record indicating that the comparison
|
|
|
|
CODE holds between operands OP0 and OP1 and push it to **P. */
|
|
|
|
|
|
|
|
static void
|
|
|
|
build_and_record_new_cond (enum tree_code code,
|
|
|
|
tree op0, tree op1,
|
2015-07-02 09:37:35 +02:00
|
|
|
vec<cond_equivalence> *p,
|
|
|
|
bool val = true)
|
2015-04-15 20:51:49 +02:00
|
|
|
{
|
|
|
|
cond_equivalence c;
|
|
|
|
struct hashable_expr *cond = &c.cond;
|
|
|
|
|
|
|
|
gcc_assert (TREE_CODE_CLASS (code) == tcc_comparison);
|
|
|
|
|
|
|
|
cond->type = boolean_type_node;
|
|
|
|
cond->kind = EXPR_BINARY;
|
|
|
|
cond->ops.binary.op = code;
|
|
|
|
cond->ops.binary.opnd0 = op0;
|
|
|
|
cond->ops.binary.opnd1 = op1;
|
|
|
|
|
2015-07-02 09:37:35 +02:00
|
|
|
c.value = val ? boolean_true_node : boolean_false_node;
|
2015-04-15 20:51:49 +02:00
|
|
|
p->safe_push (c);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Record that COND is true and INVERTED is false into the edge information
|
|
|
|
structure. Also record that any conditions dominated by COND are true
|
|
|
|
as well.
|
|
|
|
|
|
|
|
For example, if a < b is true, then a <= b must also be true. */
|
|
|
|
|
|
|
|
static void
|
|
|
|
record_conditions (struct edge_info *edge_info, tree cond, tree inverted)
|
|
|
|
{
|
|
|
|
tree op0, op1;
|
|
|
|
cond_equivalence c;
|
|
|
|
|
|
|
|
if (!COMPARISON_CLASS_P (cond))
|
|
|
|
return;
|
|
|
|
|
|
|
|
op0 = TREE_OPERAND (cond, 0);
|
|
|
|
op1 = TREE_OPERAND (cond, 1);
|
|
|
|
|
|
|
|
switch (TREE_CODE (cond))
|
|
|
|
{
|
|
|
|
case LT_EXPR:
|
|
|
|
case GT_EXPR:
|
|
|
|
if (FLOAT_TYPE_P (TREE_TYPE (op0)))
|
|
|
|
{
|
|
|
|
build_and_record_new_cond (ORDERED_EXPR, op0, op1,
|
|
|
|
&edge_info->cond_equivalences);
|
|
|
|
build_and_record_new_cond (LTGT_EXPR, op0, op1,
|
|
|
|
&edge_info->cond_equivalences);
|
|
|
|
}
|
|
|
|
|
|
|
|
build_and_record_new_cond ((TREE_CODE (cond) == LT_EXPR
|
|
|
|
? LE_EXPR : GE_EXPR),
|
|
|
|
op0, op1, &edge_info->cond_equivalences);
|
|
|
|
build_and_record_new_cond (NE_EXPR, op0, op1,
|
|
|
|
&edge_info->cond_equivalences);
|
2015-07-02 09:37:35 +02:00
|
|
|
build_and_record_new_cond (EQ_EXPR, op0, op1,
|
|
|
|
&edge_info->cond_equivalences, false);
|
2015-04-15 20:51:49 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GE_EXPR:
|
|
|
|
case LE_EXPR:
|
|
|
|
if (FLOAT_TYPE_P (TREE_TYPE (op0)))
|
|
|
|
{
|
|
|
|
build_and_record_new_cond (ORDERED_EXPR, op0, op1,
|
|
|
|
&edge_info->cond_equivalences);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case EQ_EXPR:
|
|
|
|
if (FLOAT_TYPE_P (TREE_TYPE (op0)))
|
|
|
|
{
|
|
|
|
build_and_record_new_cond (ORDERED_EXPR, op0, op1,
|
|
|
|
&edge_info->cond_equivalences);
|
|
|
|
}
|
|
|
|
build_and_record_new_cond (LE_EXPR, op0, op1,
|
|
|
|
&edge_info->cond_equivalences);
|
|
|
|
build_and_record_new_cond (GE_EXPR, op0, op1,
|
|
|
|
&edge_info->cond_equivalences);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case UNORDERED_EXPR:
|
|
|
|
build_and_record_new_cond (NE_EXPR, op0, op1,
|
|
|
|
&edge_info->cond_equivalences);
|
|
|
|
build_and_record_new_cond (UNLE_EXPR, op0, op1,
|
|
|
|
&edge_info->cond_equivalences);
|
|
|
|
build_and_record_new_cond (UNGE_EXPR, op0, op1,
|
|
|
|
&edge_info->cond_equivalences);
|
|
|
|
build_and_record_new_cond (UNEQ_EXPR, op0, op1,
|
|
|
|
&edge_info->cond_equivalences);
|
|
|
|
build_and_record_new_cond (UNLT_EXPR, op0, op1,
|
|
|
|
&edge_info->cond_equivalences);
|
|
|
|
build_and_record_new_cond (UNGT_EXPR, op0, op1,
|
|
|
|
&edge_info->cond_equivalences);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case UNLT_EXPR:
|
|
|
|
case UNGT_EXPR:
|
|
|
|
build_and_record_new_cond ((TREE_CODE (cond) == UNLT_EXPR
|
|
|
|
? UNLE_EXPR : UNGE_EXPR),
|
|
|
|
op0, op1, &edge_info->cond_equivalences);
|
|
|
|
build_and_record_new_cond (NE_EXPR, op0, op1,
|
|
|
|
&edge_info->cond_equivalences);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case UNEQ_EXPR:
|
|
|
|
build_and_record_new_cond (UNLE_EXPR, op0, op1,
|
|
|
|
&edge_info->cond_equivalences);
|
|
|
|
build_and_record_new_cond (UNGE_EXPR, op0, op1,
|
|
|
|
&edge_info->cond_equivalences);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LTGT_EXPR:
|
|
|
|
build_and_record_new_cond (NE_EXPR, op0, op1,
|
|
|
|
&edge_info->cond_equivalences);
|
|
|
|
build_and_record_new_cond (ORDERED_EXPR, op0, op1,
|
|
|
|
&edge_info->cond_equivalences);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Now store the original true and false conditions into the first
|
|
|
|
two slots. */
|
|
|
|
initialize_expr_from_cond (cond, &c.cond);
|
|
|
|
c.value = boolean_true_node;
|
|
|
|
edge_info->cond_equivalences.safe_push (c);
|
|
|
|
|
|
|
|
/* It is possible for INVERTED to be the negation of a comparison,
|
|
|
|
and not a valid RHS or GIMPLE_COND condition. This happens because
|
|
|
|
invert_truthvalue may return such an expression when asked to invert
|
|
|
|
a floating-point comparison. These comparisons are not assumed to
|
|
|
|
obey the trichotomy law. */
|
|
|
|
initialize_expr_from_cond (inverted, &c.cond);
|
|
|
|
c.value = boolean_false_node;
|
|
|
|
edge_info->cond_equivalences.safe_push (c);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* We have finished optimizing BB, record any information implied by
|
|
|
|
taking a specific outgoing edge from BB. */
|
|
|
|
|
|
|
|
static void
|
|
|
|
record_edge_info (basic_block bb)
|
|
|
|
{
|
|
|
|
gimple_stmt_iterator gsi = gsi_last_bb (bb);
|
|
|
|
struct edge_info *edge_info;
|
|
|
|
|
|
|
|
if (! gsi_end_p (gsi))
|
|
|
|
{
|
|
|
|
gimple stmt = gsi_stmt (gsi);
|
|
|
|
location_t loc = gimple_location (stmt);
|
|
|
|
|
|
|
|
if (gimple_code (stmt) == GIMPLE_SWITCH)
|
|
|
|
{
|
|
|
|
gswitch *switch_stmt = as_a <gswitch *> (stmt);
|
|
|
|
tree index = gimple_switch_index (switch_stmt);
|
|
|
|
|
|
|
|
if (TREE_CODE (index) == SSA_NAME)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
int n_labels = gimple_switch_num_labels (switch_stmt);
|
|
|
|
tree *info = XCNEWVEC (tree, last_basic_block_for_fn (cfun));
|
|
|
|
edge e;
|
|
|
|
edge_iterator ei;
|
|
|
|
|
|
|
|
for (i = 0; i < n_labels; i++)
|
|
|
|
{
|
|
|
|
tree label = gimple_switch_label (switch_stmt, i);
|
|
|
|
basic_block target_bb = label_to_block (CASE_LABEL (label));
|
|
|
|
if (CASE_HIGH (label)
|
|
|
|
|| !CASE_LOW (label)
|
|
|
|
|| info[target_bb->index])
|
|
|
|
info[target_bb->index] = error_mark_node;
|
|
|
|
else
|
|
|
|
info[target_bb->index] = label;
|
|
|
|
}
|
|
|
|
|
|
|
|
FOR_EACH_EDGE (e, ei, bb->succs)
|
|
|
|
{
|
|
|
|
basic_block target_bb = e->dest;
|
|
|
|
tree label = info[target_bb->index];
|
|
|
|
|
|
|
|
if (label != NULL && label != error_mark_node)
|
|
|
|
{
|
|
|
|
tree x = fold_convert_loc (loc, TREE_TYPE (index),
|
|
|
|
CASE_LOW (label));
|
|
|
|
edge_info = allocate_edge_info (e);
|
|
|
|
edge_info->lhs = index;
|
|
|
|
edge_info->rhs = x;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
free (info);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* A COND_EXPR may create equivalences too. */
|
|
|
|
if (gimple_code (stmt) == GIMPLE_COND)
|
|
|
|
{
|
|
|
|
edge true_edge;
|
|
|
|
edge false_edge;
|
|
|
|
|
|
|
|
tree op0 = gimple_cond_lhs (stmt);
|
|
|
|
tree op1 = gimple_cond_rhs (stmt);
|
|
|
|
enum tree_code code = gimple_cond_code (stmt);
|
|
|
|
|
|
|
|
extract_true_false_edges_from_block (bb, &true_edge, &false_edge);
|
|
|
|
|
|
|
|
/* Special case comparing booleans against a constant as we
|
|
|
|
know the value of OP0 on both arms of the branch. i.e., we
|
|
|
|
can record an equivalence for OP0 rather than COND. */
|
|
|
|
if ((code == EQ_EXPR || code == NE_EXPR)
|
|
|
|
&& TREE_CODE (op0) == SSA_NAME
|
|
|
|
&& TREE_CODE (TREE_TYPE (op0)) == BOOLEAN_TYPE
|
|
|
|
&& is_gimple_min_invariant (op1))
|
|
|
|
{
|
|
|
|
if (code == EQ_EXPR)
|
|
|
|
{
|
|
|
|
edge_info = allocate_edge_info (true_edge);
|
|
|
|
edge_info->lhs = op0;
|
|
|
|
edge_info->rhs = (integer_zerop (op1)
|
|
|
|
? boolean_false_node
|
|
|
|
: boolean_true_node);
|
|
|
|
|
|
|
|
edge_info = allocate_edge_info (false_edge);
|
|
|
|
edge_info->lhs = op0;
|
|
|
|
edge_info->rhs = (integer_zerop (op1)
|
|
|
|
? boolean_true_node
|
|
|
|
: boolean_false_node);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
edge_info = allocate_edge_info (true_edge);
|
|
|
|
edge_info->lhs = op0;
|
|
|
|
edge_info->rhs = (integer_zerop (op1)
|
|
|
|
? boolean_true_node
|
|
|
|
: boolean_false_node);
|
|
|
|
|
|
|
|
edge_info = allocate_edge_info (false_edge);
|
|
|
|
edge_info->lhs = op0;
|
|
|
|
edge_info->rhs = (integer_zerop (op1)
|
|
|
|
? boolean_false_node
|
|
|
|
: boolean_true_node);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (is_gimple_min_invariant (op0)
|
|
|
|
&& (TREE_CODE (op1) == SSA_NAME
|
|
|
|
|| is_gimple_min_invariant (op1)))
|
|
|
|
{
|
|
|
|
tree cond = build2 (code, boolean_type_node, op0, op1);
|
|
|
|
tree inverted = invert_truthvalue_loc (loc, cond);
|
|
|
|
bool can_infer_simple_equiv
|
|
|
|
= !(HONOR_SIGNED_ZEROS (op0)
|
|
|
|
&& real_zerop (op0));
|
|
|
|
struct edge_info *edge_info;
|
|
|
|
|
|
|
|
edge_info = allocate_edge_info (true_edge);
|
|
|
|
record_conditions (edge_info, cond, inverted);
|
|
|
|
|
|
|
|
if (can_infer_simple_equiv && code == EQ_EXPR)
|
|
|
|
{
|
|
|
|
edge_info->lhs = op1;
|
|
|
|
edge_info->rhs = op0;
|
|
|
|
}
|
|
|
|
|
|
|
|
edge_info = allocate_edge_info (false_edge);
|
|
|
|
record_conditions (edge_info, inverted, cond);
|
|
|
|
|
|
|
|
if (can_infer_simple_equiv && TREE_CODE (inverted) == EQ_EXPR)
|
|
|
|
{
|
|
|
|
edge_info->lhs = op1;
|
|
|
|
edge_info->rhs = op0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (TREE_CODE (op0) == SSA_NAME
|
|
|
|
&& (TREE_CODE (op1) == SSA_NAME
|
|
|
|
|| is_gimple_min_invariant (op1)))
|
|
|
|
{
|
|
|
|
tree cond = build2 (code, boolean_type_node, op0, op1);
|
|
|
|
tree inverted = invert_truthvalue_loc (loc, cond);
|
|
|
|
bool can_infer_simple_equiv
|
|
|
|
= !(HONOR_SIGNED_ZEROS (op1)
|
|
|
|
&& (TREE_CODE (op1) == SSA_NAME || real_zerop (op1)));
|
|
|
|
struct edge_info *edge_info;
|
|
|
|
|
|
|
|
edge_info = allocate_edge_info (true_edge);
|
|
|
|
record_conditions (edge_info, cond, inverted);
|
|
|
|
|
|
|
|
if (can_infer_simple_equiv && code == EQ_EXPR)
|
|
|
|
{
|
|
|
|
edge_info->lhs = op0;
|
|
|
|
edge_info->rhs = op1;
|
|
|
|
}
|
|
|
|
|
|
|
|
edge_info = allocate_edge_info (false_edge);
|
|
|
|
record_conditions (edge_info, inverted, cond);
|
|
|
|
|
|
|
|
if (can_infer_simple_equiv && TREE_CODE (inverted) == EQ_EXPR)
|
|
|
|
{
|
|
|
|
edge_info->lhs = op0;
|
|
|
|
edge_info->rhs = op1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ??? TRUTH_NOT_EXPR can create an equivalence too. */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-09-18 04:39:50 +02:00
|
|
|
class dom_opt_dom_walker : public dom_walker
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
dom_opt_dom_walker (cdi_direction direction)
|
2013-09-30 22:35:40 +02:00
|
|
|
: dom_walker (direction), m_dummy_cond (NULL) {}
|
2013-09-18 04:39:50 +02:00
|
|
|
|
|
|
|
virtual void before_dom_children (basic_block);
|
|
|
|
virtual void after_dom_children (basic_block);
|
|
|
|
|
|
|
|
private:
|
|
|
|
void thread_across_edge (edge);
|
|
|
|
|
2014-11-19 18:00:54 +01:00
|
|
|
gcond *m_dummy_cond;
|
2013-09-18 04:39:50 +02:00
|
|
|
};
|
|
|
|
|
2009-11-25 11:55:54 +01:00
|
|
|
/* Jump threading, redundancy elimination and const/copy propagation.
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
This pass may expose new symbols that need to be renamed into SSA. For
|
|
|
|
every new symbol exposed, its corresponding bit will be set in
|
2004-06-29 03:53:04 +02:00
|
|
|
VARS_TO_RENAME. */
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2015-08-12 22:09:33 +02:00
|
|
|
namespace {
|
|
|
|
|
|
|
|
const pass_data pass_data_dominator =
|
pass cfun to pass::execute
gcc/
* passes.c (opt_pass::execute): Adjust.
(pass_manager::execute_pass_mode_switching): Likewise.
(early_local_passes::execute): Likewise.
(execute_one_pass): Pass cfun to the pass's execute method.
* tree-pass.h (opt_pass::execute): Add function * argument.
* asan.c, auto-inc-dec.c, bb-reorder.c, bt-load.c, cfgcleanup.c,
cfgexpand.c, cfgrtl.c, cgraphbuild.c, combine-stack-adj.c, combine.c,
compare-elim.c, config/arc/arc.c, config/epiphany/mode-switch-use.c,
config/epiphany/resolve-sw-modes.c, config/i386/i386.c,
config/mips/mips.c, config/rl78/rl78.c, config/s390/s390.c,
config/sparc/sparc.c, cprop.c, dce.c, df-core.c, dse.c, dwarf2cfi.c,
except.c, final.c, function.c, fwprop.c, gcse.c, gimple-low.c,
gimple-ssa-isolate-paths.c, gimple-ssa-strength-reduction.c,
graphite.c, ifcvt.c, init-regs.c, ipa-cp.c, ipa-devirt.c,
ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c,
ipa-reference.c, ipa-split.c, ipa.c, ira.c, jump.c, loop-init.c,
lower-subreg.c, mode-switching.c, omp-low.c, postreload-gcse.c,
postreload.c, predict.c, recog.c, ree.c, reg-stack.c, regcprop.c,
reginfo.c, regrename.c, reorg.c, sched-rgn.c, stack-ptr-mod.c,
store-motion.c, tracer.c, trans-mem.c, tree-call-cdce.c, tree-cfg.c,
tree-cfgcleanup.c, tree-complex.c, tree-eh.c, tree-emutls.c,
tree-if-conv.c, tree-into-ssa.c, tree-loop-distribution.c, tree-nrv.c,
tree-object-size.c, tree-parloops.c, tree-predcom.c, tree-ssa-ccp.c,
tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c,
tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c,
tree-ssa-ifcombine.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c,
tree-ssa-loop-ivcanon.c, tree-ssa-loop-prefetch.c,
tree-ssa-loop-unswitch.c, tree-ssa-loop.c, tree-ssa-math-opts.c,
tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-uncprop.c, tree-ssa-uninit.c,
tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c,
tree-tailcall.c, tree-vect-generic.c, tree-vectorizer.c, tree-vrp.c,
tree.c, tsan.c, ubsan.c, var-tracking.c, vtable-verify.c, web.c:
Adjust.
From-SVN: r209482
2014-04-17 14:37:34 +02:00
|
|
|
{
|
|
|
|
GIMPLE_PASS, /* type */
|
|
|
|
"dom", /* name */
|
|
|
|
OPTGROUP_NONE, /* optinfo_flags */
|
|
|
|
TV_TREE_SSA_DOMINATOR_OPTS, /* tv_id */
|
|
|
|
( PROP_cfg | PROP_ssa ), /* properties_required */
|
|
|
|
0, /* properties_provided */
|
|
|
|
0, /* properties_destroyed */
|
|
|
|
0, /* todo_flags_start */
|
2014-05-06 15:35:40 +02:00
|
|
|
( TODO_cleanup_cfg | TODO_update_ssa ), /* todo_flags_finish */
|
pass cfun to pass::execute
gcc/
* passes.c (opt_pass::execute): Adjust.
(pass_manager::execute_pass_mode_switching): Likewise.
(early_local_passes::execute): Likewise.
(execute_one_pass): Pass cfun to the pass's execute method.
* tree-pass.h (opt_pass::execute): Add function * argument.
* asan.c, auto-inc-dec.c, bb-reorder.c, bt-load.c, cfgcleanup.c,
cfgexpand.c, cfgrtl.c, cgraphbuild.c, combine-stack-adj.c, combine.c,
compare-elim.c, config/arc/arc.c, config/epiphany/mode-switch-use.c,
config/epiphany/resolve-sw-modes.c, config/i386/i386.c,
config/mips/mips.c, config/rl78/rl78.c, config/s390/s390.c,
config/sparc/sparc.c, cprop.c, dce.c, df-core.c, dse.c, dwarf2cfi.c,
except.c, final.c, function.c, fwprop.c, gcse.c, gimple-low.c,
gimple-ssa-isolate-paths.c, gimple-ssa-strength-reduction.c,
graphite.c, ifcvt.c, init-regs.c, ipa-cp.c, ipa-devirt.c,
ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c,
ipa-reference.c, ipa-split.c, ipa.c, ira.c, jump.c, loop-init.c,
lower-subreg.c, mode-switching.c, omp-low.c, postreload-gcse.c,
postreload.c, predict.c, recog.c, ree.c, reg-stack.c, regcprop.c,
reginfo.c, regrename.c, reorg.c, sched-rgn.c, stack-ptr-mod.c,
store-motion.c, tracer.c, trans-mem.c, tree-call-cdce.c, tree-cfg.c,
tree-cfgcleanup.c, tree-complex.c, tree-eh.c, tree-emutls.c,
tree-if-conv.c, tree-into-ssa.c, tree-loop-distribution.c, tree-nrv.c,
tree-object-size.c, tree-parloops.c, tree-predcom.c, tree-ssa-ccp.c,
tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c,
tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c,
tree-ssa-ifcombine.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c,
tree-ssa-loop-ivcanon.c, tree-ssa-loop-prefetch.c,
tree-ssa-loop-unswitch.c, tree-ssa-loop.c, tree-ssa-math-opts.c,
tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-uncprop.c, tree-ssa-uninit.c,
tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c,
tree-tailcall.c, tree-vect-generic.c, tree-vectorizer.c, tree-vrp.c,
tree.c, tsan.c, ubsan.c, var-tracking.c, vtable-verify.c, web.c:
Adjust.
From-SVN: r209482
2014-04-17 14:37:34 +02:00
|
|
|
};
|
|
|
|
|
2015-08-12 22:09:33 +02:00
|
|
|
class pass_dominator : public gimple_opt_pass
|
pass cfun to pass::execute
gcc/
* passes.c (opt_pass::execute): Adjust.
(pass_manager::execute_pass_mode_switching): Likewise.
(early_local_passes::execute): Likewise.
(execute_one_pass): Pass cfun to the pass's execute method.
* tree-pass.h (opt_pass::execute): Add function * argument.
* asan.c, auto-inc-dec.c, bb-reorder.c, bt-load.c, cfgcleanup.c,
cfgexpand.c, cfgrtl.c, cgraphbuild.c, combine-stack-adj.c, combine.c,
compare-elim.c, config/arc/arc.c, config/epiphany/mode-switch-use.c,
config/epiphany/resolve-sw-modes.c, config/i386/i386.c,
config/mips/mips.c, config/rl78/rl78.c, config/s390/s390.c,
config/sparc/sparc.c, cprop.c, dce.c, df-core.c, dse.c, dwarf2cfi.c,
except.c, final.c, function.c, fwprop.c, gcse.c, gimple-low.c,
gimple-ssa-isolate-paths.c, gimple-ssa-strength-reduction.c,
graphite.c, ifcvt.c, init-regs.c, ipa-cp.c, ipa-devirt.c,
ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c,
ipa-reference.c, ipa-split.c, ipa.c, ira.c, jump.c, loop-init.c,
lower-subreg.c, mode-switching.c, omp-low.c, postreload-gcse.c,
postreload.c, predict.c, recog.c, ree.c, reg-stack.c, regcprop.c,
reginfo.c, regrename.c, reorg.c, sched-rgn.c, stack-ptr-mod.c,
store-motion.c, tracer.c, trans-mem.c, tree-call-cdce.c, tree-cfg.c,
tree-cfgcleanup.c, tree-complex.c, tree-eh.c, tree-emutls.c,
tree-if-conv.c, tree-into-ssa.c, tree-loop-distribution.c, tree-nrv.c,
tree-object-size.c, tree-parloops.c, tree-predcom.c, tree-ssa-ccp.c,
tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c,
tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c,
tree-ssa-ifcombine.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c,
tree-ssa-loop-ivcanon.c, tree-ssa-loop-prefetch.c,
tree-ssa-loop-unswitch.c, tree-ssa-loop.c, tree-ssa-math-opts.c,
tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-uncprop.c, tree-ssa-uninit.c,
tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c,
tree-tailcall.c, tree-vect-generic.c, tree-vectorizer.c, tree-vrp.c,
tree.c, tsan.c, ubsan.c, var-tracking.c, vtable-verify.c, web.c:
Adjust.
From-SVN: r209482
2014-04-17 14:37:34 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
pass_dominator (gcc::context *ctxt)
|
|
|
|
: gimple_opt_pass (pass_data_dominator, ctxt)
|
|
|
|
{}
|
|
|
|
|
|
|
|
/* opt_pass methods: */
|
|
|
|
opt_pass * clone () { return new pass_dominator (m_ctxt); }
|
|
|
|
virtual bool gate (function *) { return flag_tree_dom != 0; }
|
|
|
|
virtual unsigned int execute (function *);
|
|
|
|
|
|
|
|
}; // class pass_dominator
|
|
|
|
|
|
|
|
unsigned int
|
|
|
|
pass_dominator::execute (function *fun)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2004-10-04 15:19:20 +02:00
|
|
|
memset (&opt_stats, 0, sizeof (opt_stats));
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
/* Create our hash tables. */
|
Remove a layer of indirection from hash_table
gcc/
* hash-table.h: Remove a layer of indirection from hash_table so that
it contains the hash table's data instead of a pointer to the data.
* alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c,
config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c,
config/mips/mips.c, config/sol2.c, coverage.c, cselib.c,
data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c,
fold-const.c, gcse.c, ggc-common.c,
gimple-ssa-strength-reduction.c, gimplify.c,
graphite-clast-to-gimple.c, graphite-dependences.c,
graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c,
ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c,
loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c,
lto-streamer.c, lto-streamer.h, passes.c, plugin.c,
postreload-gcse.c, sese.c, statistics.c, store-motion.c,
trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c,
tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c,
tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c,
tree-ssa-live.c, tree-ssa-loop-im.c,
tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-tail-merge.c,
tree-ssa-threadupdate.c, tree-ssa-uncprop.c,
tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c,
tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c,
vtable-verify.c, vtable-verify.h: Adjust.
gcc/c/
* c-decl.c: Adjust.
gcc/cp/
* class.c, semantics.c, tree.c, vtable-class-hierarchy.c:
Adjust.
gcc/java/
* jcf-io.c: Adjust.
gcc/lto/
* lto.c: Adjust.
gcc/objc/
* objc-act.c: Adjust.
From-SVN: r211936
2014-06-24 15:21:35 +02:00
|
|
|
avail_exprs = new hash_table<expr_elt_hasher> (1024);
|
2015-09-15 19:03:49 +02:00
|
|
|
avail_exprs_stack = new class avail_exprs_stack (avail_exprs);
|
2015-09-04 17:15:59 +02:00
|
|
|
const_and_copies = new class const_and_copies ();
|
bitmap.h (BITMAP_XMALLOC, [...]): Remove.
* bitmap.h (BITMAP_XMALLOC, BITMAP_XFREE): Remove.
* bb-reorder.c (duplicate_computed_gotos): Use BITMAP_ALLOC and
BITMAP_FREE.
* bt-load.c (btr_def_live_range, combine_btr_defs,
migrate_btr_def, migrate_btr_defs): Likewise.
* cfgcleanup.c (thread_jump): Likewise.
* cfgloop.c (get_loop_body_in_bfs_order): Likewise.
* df.c (df_insn_table_realloc, df_bitmaps_alloc, df_bitmaps_free,
df_alloc, df_free, df_du_chain_create, df_bb_rd_local_compute,
df_rd_local_compute, df_reg_info_compute): Likewise.
* dominance.c (init_dom_info, free_dom_info): Likewise.
* flow.c (init_propagate_block_info,
free_propagate_block_info): Likewise.
* gcse.c (alloc_gcse_mem, free_gcse_mem): Likewise.
* global.c (allocate_bb_info, free_bb_info, calculate_reg_pav,
modify_reg_pav): Likewise.
* loop-invariant.c (find_defs, find_invariant_insn,
find_invariants, free_inv_motion_data): Likewise.
* predict.c (tree_predict_by_opcode,
estimate_bb_frequencies): Likewise.
* stmt.c (expand_case): Likewise.
* tree-cfg.c (tree_duplicate_sese_region): Likewise.
* tree-dfa.c (mark_new_vars_to_rename): Likewise.
* tree-if-conv.c (get_loop_body_in_if_conv_order): Likewise.
* tree-into-ssa.c (insert_phi_nodes_for, def_blocks_free,
get_def_blocks_for, mark_def_site_blocks, rewrite_into_ssa,
rewrite_ssa_into_ssa): Likewise.
* tree-optimize.c (tree_rest_of_compilation): Likewise.
* tree-outof-ssa.c (new_temp_expr_table, free_temp_expr_table,
analyze_edges_for_bb, perform_edge_inserts): Likewise.
* tree-scalar-evolution.c (scev_initialize, scev_finalize): Likewise.
* tree-sra.c (tree_sra): Likewise.
* tree-ssa-alias.c (init_alias_info, delete_alias_info): Likewise.
* tree-ssa-ccp.c (ccp_fold_builtin): Likewise.
* tree-ssa-dce.c (tree_dce_init, tree_dce_done): Likewise.
* tree-ssa-dom.c (tree_ssa_dominator_optimize): Likewise.
* tree-ssa-dse.c (tree_ssa_dse): Likewise.
* tree-ssa-forwprop.c (tree_ssa_forward_propagate_single_use_var):
Likewise.
* tree-ssa-live.c (new_tree_live_info, delete_tree_live_info,
calculate_live_on_entry, calculate_live_on_exit,
build_tree_conflict_graph): Likewise.
* tree-ssa-loop-ivopts.c (tree_ssa_iv_optimize_init, record_use,
record_important_candidates, set_use_iv_cost, find_depends,
determine_use_iv_costs, iv_ca_new, iv_ca_free, free_loop_data,
tree_ssa_iv_optimize_finalize): Likewise.
* tree-ssa-loop-manip.c (add_exit_phis_var, get_loops_exit,
find_uses_to_rename_use, rewrite_into_loop_closed_ssa,
tree_duplicate_loop_to_header_edge): Likewise.
* tree-ssa-pre.c (init_pre, fini_pre): Likewise.
* tree-ssa.c (verify_flow_insensitive_alias_info,
verify_name_tags, verify_ssa, init_tree_ssa,
delete_tree_ssa): Likewise.
* tree-ssanames.c (marked_ssa_names, init_ssanames,
fini_ssanames): Likewise.
* tree-vectorizer.c (slpeel_tree_peel_loop_to_edge): Likewise.
From-SVN: r95172
2005-02-17 17:19:49 +01:00
|
|
|
need_eh_cleanup = BITMAP_ALLOC (NULL);
|
2015-03-13 09:47:14 +01:00
|
|
|
need_noreturn_fixup.create (0);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
calculate_dominance_info (CDI_DOMINATORS);
|
2007-05-07 13:42:21 +02:00
|
|
|
cfg_altered = false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2007-05-17 10:10:24 +02:00
|
|
|
/* We need to know loop structures in order to avoid destroying them
|
|
|
|
in jump threading. Note that we still can e.g. thread through loop
|
|
|
|
headers to an exit edge, or through loop header to the loop body, assuming
|
2014-02-26 02:49:35 +01:00
|
|
|
that we update the loop info.
|
|
|
|
|
|
|
|
TODO: We don't need to set LOOPS_HAVE_PREHEADERS generally, but due
|
|
|
|
to several overly conservative bail-outs in jump threading, case
|
|
|
|
gcc.dg/tree-ssa/pr21417.c can't be threaded if loop preheader is
|
|
|
|
missing. We should improve jump threading in future then
|
|
|
|
LOOPS_HAVE_PREHEADERS won't be needed here. */
|
|
|
|
loop_optimizer_init (LOOPS_HAVE_PREHEADERS | LOOPS_HAVE_SIMPLE_LATCHES);
|
2005-03-04 22:35:49 +01:00
|
|
|
|
2009-04-28 10:50:19 +02:00
|
|
|
/* Initialize the value-handle array. */
|
|
|
|
threadedge_initialize_values ();
|
|
|
|
|
2006-02-07 19:31:27 +01:00
|
|
|
/* We need accurate information regarding back edges in the CFG
|
2008-06-06 07:42:00 +02:00
|
|
|
for jump threading; this may include back edges that are not part of
|
2007-05-17 10:10:24 +02:00
|
|
|
a single loop. */
|
2006-02-07 19:31:27 +01:00
|
|
|
mark_dfs_back_edges ();
|
2009-11-25 11:55:54 +01:00
|
|
|
|
2006-02-07 19:31:27 +01:00
|
|
|
/* Recursively walk the dominator tree optimizing statements. */
|
pass cfun to pass::execute
gcc/
* passes.c (opt_pass::execute): Adjust.
(pass_manager::execute_pass_mode_switching): Likewise.
(early_local_passes::execute): Likewise.
(execute_one_pass): Pass cfun to the pass's execute method.
* tree-pass.h (opt_pass::execute): Add function * argument.
* asan.c, auto-inc-dec.c, bb-reorder.c, bt-load.c, cfgcleanup.c,
cfgexpand.c, cfgrtl.c, cgraphbuild.c, combine-stack-adj.c, combine.c,
compare-elim.c, config/arc/arc.c, config/epiphany/mode-switch-use.c,
config/epiphany/resolve-sw-modes.c, config/i386/i386.c,
config/mips/mips.c, config/rl78/rl78.c, config/s390/s390.c,
config/sparc/sparc.c, cprop.c, dce.c, df-core.c, dse.c, dwarf2cfi.c,
except.c, final.c, function.c, fwprop.c, gcse.c, gimple-low.c,
gimple-ssa-isolate-paths.c, gimple-ssa-strength-reduction.c,
graphite.c, ifcvt.c, init-regs.c, ipa-cp.c, ipa-devirt.c,
ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c,
ipa-reference.c, ipa-split.c, ipa.c, ira.c, jump.c, loop-init.c,
lower-subreg.c, mode-switching.c, omp-low.c, postreload-gcse.c,
postreload.c, predict.c, recog.c, ree.c, reg-stack.c, regcprop.c,
reginfo.c, regrename.c, reorg.c, sched-rgn.c, stack-ptr-mod.c,
store-motion.c, tracer.c, trans-mem.c, tree-call-cdce.c, tree-cfg.c,
tree-cfgcleanup.c, tree-complex.c, tree-eh.c, tree-emutls.c,
tree-if-conv.c, tree-into-ssa.c, tree-loop-distribution.c, tree-nrv.c,
tree-object-size.c, tree-parloops.c, tree-predcom.c, tree-ssa-ccp.c,
tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c,
tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c,
tree-ssa-ifcombine.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c,
tree-ssa-loop-ivcanon.c, tree-ssa-loop-prefetch.c,
tree-ssa-loop-unswitch.c, tree-ssa-loop.c, tree-ssa-math-opts.c,
tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-uncprop.c, tree-ssa-uninit.c,
tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c,
tree-tailcall.c, tree-vect-generic.c, tree-vectorizer.c, tree-vrp.c,
tree.c, tsan.c, ubsan.c, var-tracking.c, vtable-verify.c, web.c:
Adjust.
From-SVN: r209482
2014-04-17 14:37:34 +02:00
|
|
|
dom_opt_dom_walker (CDI_DOMINATORS).walk (fun->cfg->x_entry_block_ptr);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2006-02-07 19:31:27 +01:00
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
gimple_stmt_iterator gsi;
|
2006-02-07 19:31:27 +01:00
|
|
|
basic_block bb;
|
pass cfun to pass::execute
gcc/
* passes.c (opt_pass::execute): Adjust.
(pass_manager::execute_pass_mode_switching): Likewise.
(early_local_passes::execute): Likewise.
(execute_one_pass): Pass cfun to the pass's execute method.
* tree-pass.h (opt_pass::execute): Add function * argument.
* asan.c, auto-inc-dec.c, bb-reorder.c, bt-load.c, cfgcleanup.c,
cfgexpand.c, cfgrtl.c, cgraphbuild.c, combine-stack-adj.c, combine.c,
compare-elim.c, config/arc/arc.c, config/epiphany/mode-switch-use.c,
config/epiphany/resolve-sw-modes.c, config/i386/i386.c,
config/mips/mips.c, config/rl78/rl78.c, config/s390/s390.c,
config/sparc/sparc.c, cprop.c, dce.c, df-core.c, dse.c, dwarf2cfi.c,
except.c, final.c, function.c, fwprop.c, gcse.c, gimple-low.c,
gimple-ssa-isolate-paths.c, gimple-ssa-strength-reduction.c,
graphite.c, ifcvt.c, init-regs.c, ipa-cp.c, ipa-devirt.c,
ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c,
ipa-reference.c, ipa-split.c, ipa.c, ira.c, jump.c, loop-init.c,
lower-subreg.c, mode-switching.c, omp-low.c, postreload-gcse.c,
postreload.c, predict.c, recog.c, ree.c, reg-stack.c, regcprop.c,
reginfo.c, regrename.c, reorg.c, sched-rgn.c, stack-ptr-mod.c,
store-motion.c, tracer.c, trans-mem.c, tree-call-cdce.c, tree-cfg.c,
tree-cfgcleanup.c, tree-complex.c, tree-eh.c, tree-emutls.c,
tree-if-conv.c, tree-into-ssa.c, tree-loop-distribution.c, tree-nrv.c,
tree-object-size.c, tree-parloops.c, tree-predcom.c, tree-ssa-ccp.c,
tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c,
tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c,
tree-ssa-ifcombine.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c,
tree-ssa-loop-ivcanon.c, tree-ssa-loop-prefetch.c,
tree-ssa-loop-unswitch.c, tree-ssa-loop.c, tree-ssa-math-opts.c,
tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-uncprop.c, tree-ssa-uninit.c,
tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c,
tree-tailcall.c, tree-vect-generic.c, tree-vectorizer.c, tree-vrp.c,
tree.c, tsan.c, ubsan.c, var-tracking.c, vtable-verify.c, web.c:
Adjust.
From-SVN: r209482
2014-04-17 14:37:34 +02:00
|
|
|
FOR_EACH_BB_FN (bb, fun)
|
2011-03-24 15:43:16 +01:00
|
|
|
{
|
|
|
|
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
|
2008-07-28 16:33:56 +02:00
|
|
|
update_stmt_if_modified (gsi_stmt (gsi));
|
lambda-code.c (lambda_loopnest_to_gcc_loopnest): Use update_stmt.
2005-04-05 Andrew MacLeod <amacleod@redhat.com>
* lambda-code.c (lambda_loopnest_to_gcc_loopnest): Use update_stmt.
Use immediate use iterator.
(stmt_is_bumper_for_loop): Use immediate use iterator.
* predict.c (strip_builtin_expect): Use update_stmt.
* tree-cfg.c (update_modified_stmts): New. Call update_stmt_if_modified
on all elements of a STATEMENT_LIST.
(bsi_insert_before, bsi_insert_after): Call update_modified_stmts.
(bsi_remove): Remove imm_use links and mark the stmt as modified.
(bsi_replace): Mark stmt as modified and the update it.
* tree-complex.c (update_complex_assignment): Call mark_stmt_modified.
(expand_complex_libcal): Call update_stmt.
(expand_complex_comparison): Call mark_stmt_modified.
(expand_complex_operations_1): Call update_stmt_if_modified.
(expand_vector_operations_1): Call mark_stmt_modified.
* tree-dfa.c (compute_immediate_uses, free_df_for_stmt, free_df,
compute_immediate_uses_for_phi, compute_immediate_uses_for_stmt,
add_immediate_use, redirect_immediate_use,
redirect_immediate_uses, dump_immediate_uses, debug_immediate_uses,
dump_immediate_uses_for, debug_immediate_uses_for): Delete.
(mark_new_vars_to_rename): Call update_stmt.
* tree-dump.c (dump_option_value_in): Add "stmtaddr".
* tree-flow-inline.h (modify_stmt): Rename to mark_stmt_modified.
Ignore PHI nodes.
(unmodify_stmt): Delete.
(update_stmt): New. Force an update of a stmt.
(update_stmt_if_modified): update a stmt if it is out of date.
(get_stmt_operands): Verify stmt is NOT modified.
(stmt_modified_p): Update comment.
(delink_imm_use): Remove a use node from its immuse list.
(link_imm_use_to_list): Link a use node to a specific list.
(link_imm_use): Link a node to the correct list.
(set_ssa_use_from_ptr): Set a use node to a specific value, and insert
it in the correct list, if appropriate.
(link_imm_use_stmt): Link a use node, and set the stmt pointer.
(relink_imm_use): Link a use node in place of another node in a list.
(relink_imm_use_stmt): LInk a node in place of another node, and set
the stmt pointer.
(end_safe_imm_use_traverse): New. Terminate a safe immuse iterator.
(end_safe_imm_use_p): New. Check for the end of a safe immuse iterator.
(first_safe_imm_use): New. Initialize a safe immuse iterator.
(next_safe_imm_use): New. Proceed to next safe immuse iterator value.
(end_readonly_imm_use_p): New. Check for end of a fast immuse iterator.
(first_readonly_imm_use): New. Initialize a fast immuse iterator.
(next_readonly_imm_use): New. Get the next fast immuse iterator value.
(has_zero_uses): New. Return true if there are no uses of a var.
(has_single_use): New. Return true if there is only a single use of a
variable.
(single_imm_use): New. Return the simgle immediate use.
(num_imm_uses): New. Return the number of immediate uses.
(get_v_must_def_ops): Use is now a pointer.
(use_operand_p, get_v_may_def_op_ptr, get_vuse_op_ptr,
get_v_must_def_kill_ptr, get_phi_arg_def_ptr): Return the address of
the use node.
(get_immediate_uses, num_immediate_uses, immediate_use): Delete.
(delink_stmt_imm_use): Delink all immuses from a stmt.
(phi_arg_index_from_use): New. Return a phi arg index for a use.
* tree-flow.h (struct dataflow_d): Delete.
(immediate_use_iterator_d): New. Immediate use iterator struct.
(FOR_EACH_IMM_USE_FAST): New. Macro for read only immuse iteration.
(FOR_EACH_IMM_USE_SAFE): New. Macro for write-safe immuse iteration.
(BREAK_FROM_SAFE_IMM_USE): New. Macro for earlyu exit from write-safe
iteration.
(struct stmt_ann_d): Remove dataflow_t from struct.
* tree-if-conv.c (tree_if_conversion). Don't call free_df.
(if_convertible_phi_p): Use FAST immuse iterator.
(if_convertible_loop_p): Don't call compute_immediate_uses.
(replace_phi_with_cond_modify_expr): Call update_stmt.
* tree-into-ssa.c (mark_def_sites, ssa_mark_def_sites): Call
update_stmt_if_modified.
(rewrite_all_into_ssa): Initialize ssa operands.
* tree-loop-linear.c (linear_transform_loops): Don't call free_df or
compute_immediate_uses.
* tree-optimize.c (execute_todo): Call verify_ssa whenever the
ssa_property is available.
(execute_one_pass): Change parameters passed to execute_todo.
* tree-outof-ssa.c (rewrite_trees): Don't call modify_stmt.
(remove_ssa_form): Call fini_ssa_operands.
(insert_backedge_copies): Delete call to modify_stmt.
* tree-phinodes.c (make_phi_node): Initialize use nodes.
(release_phi_node): Delink any use nodes before releasing.
(resize_phi_node): Relink any use nodes.
(remove_phi_arg_num): Delink the use node.
(remove_phi_node): Release the ssa_name AFTER releasing the phi node.
(remove_all_phi_nodes_for): Release phi node first.
* tree-pretty-print.c (dump_generic_node): Print stmt address.
* tree-sra.c (mark_all_v_defs): Call update_stmt_if_modified.
(scalarize_use, scalarize_copy): Call update_stmt.
* tree-ssa-alias.c (compute_may_aliases): Update all modified stmts.
(compute_points_to_and_addr_escape): Call mark_stmt_modified.
* tree-ssa-cpp.c (need_imm_uses_for): Delete.
(ccp_initialize): Remove call to compute_immediate_uses.
(substitute_and_fold, execute_fold_all_builtins): Call update_stmt.
* tree-ssa-dom.c (tree_ssa_dominator_optimize): Update all modified
stmts.
(simplify_cond_and_lookup_avail_expr): Call mark_stmt_modified.
(simplify_switch_and_lookup_avail_expr): Call mark_stmt_modified.
(eliminate_redundant_computations): Call mark_stmt_modified.
(cprop_operand): Call mark_stmt_modified.
(optimize_stmt): Call update_stmt_if_modified and mark_stmt_modified.
* tree-ssa-dse.c (fix_phi_uses, fix_stmt_v_may_defs): Delete.
(dse_optimize_stmt): Use new immuse interface.
(tree_ssa_dse): Remove calls to compute_immediate_uses and free_df.
* tree-ssa-forwprop.c (need_imm_uses_for): Delete.
(substitute_single_use_vars): Use new immuse interface.
(tree_ssa_forward_propagate_single_use_vars): Remove calls to free_df
and compute_immediate_uses.
* tree-ssa-loop-im.c (single_reachable_address): Use new immuse
interface.
(rewrite_mem_refs): Call update_stmt.
(determine_lsm): Remove call to compute_imm_uses and free_df.
* tree-ssa-loop-ivcanon.c (create_canonical_iv): Call update_stmt.
(try_unroll_loop_completely): Call update_stmt.
* tree-ssa-loop-ivopts.c (rewrite_address_base): Call update_stmt.
(rewrite_use_compare): Call update_stmt.
(compute_phi_arg_on_exit): Insert each stmt before trying to process.
(rewrite_use) : Call update_stmt.
* tree-ssa-loop-manip.c (verify_loop_closed_ssa): Add arg to call.
* tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Call
update_stmt.
* tree-ssa-operands.c (NULL_USE_OPERAND_P): Remove declaration.
(allocate_use_optype, allocate_vuse_optype): Adjust allocation size.
(free_uses, free_vuses, free_v_may_defs, free_v_must_defs): Delink
use nodes.
(initialize_vuse_operand): New. Initialize a vuse operand.
(initialize_v_may_def_operand): New. Initialize a maydef operand.
(initialize_v_must_def_operand): New. Initialize a mustdef operand.
(finalize_ssa_defs): Use stmt parameter.
(correct_use_link): Ensure a use node is in the correct list, and has
the correct stmt pointer.
(finalize_ssa_uses, finalize_ssa_v_may_defs, finalize_ssa_vuses,
finalize_ssa_v_must_defs): Also initialize use nodes.
(finalize_ssa_stmt_operands): Pass extra stmt operands.
(build_ssa_operands): Seperate parsing from final operand construction.
(parse_ssa_operands): New. Parse entry point for operand building.
(swap_tree_operands): New. Swap 2 tree operands.
(update_stmt_operands): Ranamed from get_stmt_operands. Always builds
operands.
(get_expr_operands): Call swap_tree_operands when needed.
(copy_virtual_operands): Use initialize routines for virtual use ops.
(create_ssa_artficial_load_stmt): Add extra stmt parameter.
(verify_abort): New. Issue imm_use error.
(verify_imm_links): New Verify imm_use links for a var.
(dump_immediate_uses_for): New. Dump imm_uses for a var to file.
(dump_immediate_uses): New. Dump imm_uses for all vars to file.
(debug_immediate_uses): New. Dump imm_uses for all vars to stderr.
(debug_immediate_uses_for): New. Dump imm_uses for a var to stderr.
* tree-ssa-operands.h (struct use_operand_ptr): Delete.
(NULL_USE_OPERAND_P) Define.
(use_optype_d, v_def_use_operand_type, vuse_optype_d): Add immediate
use node.
(struct vuse_operand_type): New struct.
(SET_USE): Call set_ssa_use_from_ptr.
(USE_STMT): Define.
(PHI_ARG_INDEX_FROM_USE): Define.
* tree-ssa-phiopt.c (replace_phi_edge_with_variable): Set the phi
argument via SET_USE, not PHI_ARG_DEF_TREE.
* tree-ssa-pre.c (eliminate): Call update_stmt.
* tree-ssa-propagate.c (cfg_blocks_get): Use imm_use iterators. Don't
call free_df.
* tree-ssa-sink.c (all_immediate_uses_same_place): Use imm_use iterator.
(nearest_common_dominator_of_uses): Use imm_use iterator.
(statement_sink_location): Use imm_use iterator and interface.
(execute_sink_code): Don't call compute_immediate_uses or free-df.
* tree-ssa-threadupdate.c (create_edge_and_update_destination_phis): Use
PHI_ARG_DEF, not PHI_ARG_DEF_TREE.
* tree-ssa.c (verify_use, verify_phi_args): Verify some imm_use info.
(verify_ssa): Ensure no stmt is marked modify after optimization pass
if new parameter is true.
(init_tree_ssa): Don't initialize operand cache here.
(delete_tree_ssa): Don't destroy operand cache here.
(propagate_into_addr): Pass in a use pointer, return true if anything
was changed.
(replace_immediate_uses): Use imm_use iterator, call update_stmt.
(check_phi_redundancy): Use imm_use iterator.
(kill_redundant_phi_nodes): Don't call compute_immediate_uses or
free_df.
* tree-ssanames.c (make_ssa_name): Initialize imm_use node.
(release_ssa_name): Delink node and all elements in its imm_use list.
* tree-tailcall.c (adjust_return_value): Call update_stmt.
* tree-vect-analyze.c (vect_stmt_relevant_p): Use imm_use iterator.
* tree-vectorizer.c (need_imm_uses_for): Delete.
(vectorize_loops): Dont call compute_immediate_uses or free_df.
* tree.h (struct ssa_imm_use_d): Define.
(SSA_NAME_IMM_USE_NODE): Define.
(struct tree_ssa_name): Add imm_use node.
(PHI_DF): Delete.
(PHI_ARG_IMM_USE_NODE): Define.
(struct phi_arg_d): Add imm_use node.
(struct tree_phi_node): Remove struct dataflow_d element.
(TDF_STMTADDR): Define.
From-SVN: r97648
2005-04-05 21:05:20 +02:00
|
|
|
}
|
2006-02-07 19:31:27 +01:00
|
|
|
}
|
2005-04-23 04:23:28 +02:00
|
|
|
|
2006-02-07 19:31:27 +01:00
|
|
|
/* If we exposed any new variables, go ahead and put them into
|
|
|
|
SSA form now, before we handle jump threading. This simplifies
|
|
|
|
interactions between rewriting of _DECL nodes into SSA form
|
|
|
|
and rewriting SSA_NAME nodes into SSA form after block
|
|
|
|
duplication and CFG manipulation. */
|
|
|
|
update_ssa (TODO_update_ssa);
|
2005-03-04 22:35:49 +01:00
|
|
|
|
2006-02-07 19:31:27 +01:00
|
|
|
free_all_edge_infos ();
|
2005-03-04 22:35:49 +01:00
|
|
|
|
2006-02-07 19:31:27 +01:00
|
|
|
/* Thread jumps, creating duplicate blocks as needed. */
|
2007-05-17 10:10:24 +02:00
|
|
|
cfg_altered |= thread_through_all_blocks (first_pass_instance);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2007-05-07 13:42:21 +02:00
|
|
|
if (cfg_altered)
|
|
|
|
free_dominance_info (CDI_DOMINATORS);
|
|
|
|
|
2006-02-07 19:31:27 +01:00
|
|
|
/* Removal of statements may make some EH edges dead. Purge
|
|
|
|
such edges from the CFG as needed. */
|
|
|
|
if (!bitmap_empty_p (need_eh_cleanup))
|
|
|
|
{
|
2008-05-19 00:36:30 +02:00
|
|
|
unsigned i;
|
|
|
|
bitmap_iterator bi;
|
|
|
|
|
|
|
|
/* Jump threading may have created forwarder blocks from blocks
|
|
|
|
needing EH cleanup; the new successor of these blocks, which
|
2012-11-16 23:05:32 +01:00
|
|
|
has inherited from the original block, needs the cleanup.
|
|
|
|
Don't clear bits in the bitmap, as that can break the bitmap
|
|
|
|
iterator. */
|
2008-05-19 00:36:30 +02:00
|
|
|
EXECUTE_IF_SET_IN_BITMAP (need_eh_cleanup, 0, i, bi)
|
|
|
|
{
|
pass cfun to pass::execute
gcc/
* passes.c (opt_pass::execute): Adjust.
(pass_manager::execute_pass_mode_switching): Likewise.
(early_local_passes::execute): Likewise.
(execute_one_pass): Pass cfun to the pass's execute method.
* tree-pass.h (opt_pass::execute): Add function * argument.
* asan.c, auto-inc-dec.c, bb-reorder.c, bt-load.c, cfgcleanup.c,
cfgexpand.c, cfgrtl.c, cgraphbuild.c, combine-stack-adj.c, combine.c,
compare-elim.c, config/arc/arc.c, config/epiphany/mode-switch-use.c,
config/epiphany/resolve-sw-modes.c, config/i386/i386.c,
config/mips/mips.c, config/rl78/rl78.c, config/s390/s390.c,
config/sparc/sparc.c, cprop.c, dce.c, df-core.c, dse.c, dwarf2cfi.c,
except.c, final.c, function.c, fwprop.c, gcse.c, gimple-low.c,
gimple-ssa-isolate-paths.c, gimple-ssa-strength-reduction.c,
graphite.c, ifcvt.c, init-regs.c, ipa-cp.c, ipa-devirt.c,
ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c,
ipa-reference.c, ipa-split.c, ipa.c, ira.c, jump.c, loop-init.c,
lower-subreg.c, mode-switching.c, omp-low.c, postreload-gcse.c,
postreload.c, predict.c, recog.c, ree.c, reg-stack.c, regcprop.c,
reginfo.c, regrename.c, reorg.c, sched-rgn.c, stack-ptr-mod.c,
store-motion.c, tracer.c, trans-mem.c, tree-call-cdce.c, tree-cfg.c,
tree-cfgcleanup.c, tree-complex.c, tree-eh.c, tree-emutls.c,
tree-if-conv.c, tree-into-ssa.c, tree-loop-distribution.c, tree-nrv.c,
tree-object-size.c, tree-parloops.c, tree-predcom.c, tree-ssa-ccp.c,
tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c,
tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c,
tree-ssa-ifcombine.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c,
tree-ssa-loop-ivcanon.c, tree-ssa-loop-prefetch.c,
tree-ssa-loop-unswitch.c, tree-ssa-loop.c, tree-ssa-math-opts.c,
tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-uncprop.c, tree-ssa-uninit.c,
tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c,
tree-tailcall.c, tree-vect-generic.c, tree-vectorizer.c, tree-vrp.c,
tree.c, tsan.c, ubsan.c, var-tracking.c, vtable-verify.c, web.c:
Adjust.
From-SVN: r209482
2014-04-17 14:37:34 +02:00
|
|
|
basic_block bb = BASIC_BLOCK_FOR_FN (fun, i);
|
2012-11-16 23:05:32 +01:00
|
|
|
if (bb == NULL)
|
|
|
|
continue;
|
|
|
|
while (single_succ_p (bb)
|
|
|
|
&& (single_succ_edge (bb)->flags & EDGE_EH) == 0)
|
|
|
|
bb = single_succ (bb);
|
pass cfun to pass::execute
gcc/
* passes.c (opt_pass::execute): Adjust.
(pass_manager::execute_pass_mode_switching): Likewise.
(early_local_passes::execute): Likewise.
(execute_one_pass): Pass cfun to the pass's execute method.
* tree-pass.h (opt_pass::execute): Add function * argument.
* asan.c, auto-inc-dec.c, bb-reorder.c, bt-load.c, cfgcleanup.c,
cfgexpand.c, cfgrtl.c, cgraphbuild.c, combine-stack-adj.c, combine.c,
compare-elim.c, config/arc/arc.c, config/epiphany/mode-switch-use.c,
config/epiphany/resolve-sw-modes.c, config/i386/i386.c,
config/mips/mips.c, config/rl78/rl78.c, config/s390/s390.c,
config/sparc/sparc.c, cprop.c, dce.c, df-core.c, dse.c, dwarf2cfi.c,
except.c, final.c, function.c, fwprop.c, gcse.c, gimple-low.c,
gimple-ssa-isolate-paths.c, gimple-ssa-strength-reduction.c,
graphite.c, ifcvt.c, init-regs.c, ipa-cp.c, ipa-devirt.c,
ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c,
ipa-reference.c, ipa-split.c, ipa.c, ira.c, jump.c, loop-init.c,
lower-subreg.c, mode-switching.c, omp-low.c, postreload-gcse.c,
postreload.c, predict.c, recog.c, ree.c, reg-stack.c, regcprop.c,
reginfo.c, regrename.c, reorg.c, sched-rgn.c, stack-ptr-mod.c,
store-motion.c, tracer.c, trans-mem.c, tree-call-cdce.c, tree-cfg.c,
tree-cfgcleanup.c, tree-complex.c, tree-eh.c, tree-emutls.c,
tree-if-conv.c, tree-into-ssa.c, tree-loop-distribution.c, tree-nrv.c,
tree-object-size.c, tree-parloops.c, tree-predcom.c, tree-ssa-ccp.c,
tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c,
tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c,
tree-ssa-ifcombine.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c,
tree-ssa-loop-ivcanon.c, tree-ssa-loop-prefetch.c,
tree-ssa-loop-unswitch.c, tree-ssa-loop.c, tree-ssa-math-opts.c,
tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-uncprop.c, tree-ssa-uninit.c,
tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c,
tree-tailcall.c, tree-vect-generic.c, tree-vectorizer.c, tree-vrp.c,
tree.c, tsan.c, ubsan.c, var-tracking.c, vtable-verify.c, web.c:
Adjust.
From-SVN: r209482
2014-04-17 14:37:34 +02:00
|
|
|
if (bb == EXIT_BLOCK_PTR_FOR_FN (fun))
|
2012-11-16 23:05:32 +01:00
|
|
|
continue;
|
|
|
|
if ((unsigned) bb->index != i)
|
|
|
|
bitmap_set_bit (need_eh_cleanup, bb->index);
|
2008-05-19 00:36:30 +02:00
|
|
|
}
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
gimple_purge_all_dead_eh_edges (need_eh_cleanup);
|
2012-10-30 01:02:55 +01:00
|
|
|
bitmap_clear (need_eh_cleanup);
|
2006-02-07 19:31:27 +01:00
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2015-03-13 09:47:14 +01:00
|
|
|
/* Fixup stmts that became noreturn calls. This may require splitting
|
|
|
|
blocks and thus isn't possible during the dominator walk or before
|
|
|
|
jump threading finished. Do this in reverse order so we don't
|
|
|
|
inadvertedly remove a stmt we want to fixup by visiting a dominating
|
|
|
|
now noreturn call first. */
|
|
|
|
while (!need_noreturn_fixup.is_empty ())
|
|
|
|
{
|
|
|
|
gimple stmt = need_noreturn_fixup.pop ();
|
|
|
|
if (dump_file && dump_flags & TDF_DETAILS)
|
|
|
|
{
|
|
|
|
fprintf (dump_file, "Fixing up noreturn call ");
|
|
|
|
print_gimple_stmt (dump_file, stmt, 0, 0);
|
|
|
|
fprintf (dump_file, "\n");
|
|
|
|
}
|
|
|
|
fixup_noreturn_call (stmt);
|
|
|
|
}
|
|
|
|
|
pass cfun to pass::execute
gcc/
* passes.c (opt_pass::execute): Adjust.
(pass_manager::execute_pass_mode_switching): Likewise.
(early_local_passes::execute): Likewise.
(execute_one_pass): Pass cfun to the pass's execute method.
* tree-pass.h (opt_pass::execute): Add function * argument.
* asan.c, auto-inc-dec.c, bb-reorder.c, bt-load.c, cfgcleanup.c,
cfgexpand.c, cfgrtl.c, cgraphbuild.c, combine-stack-adj.c, combine.c,
compare-elim.c, config/arc/arc.c, config/epiphany/mode-switch-use.c,
config/epiphany/resolve-sw-modes.c, config/i386/i386.c,
config/mips/mips.c, config/rl78/rl78.c, config/s390/s390.c,
config/sparc/sparc.c, cprop.c, dce.c, df-core.c, dse.c, dwarf2cfi.c,
except.c, final.c, function.c, fwprop.c, gcse.c, gimple-low.c,
gimple-ssa-isolate-paths.c, gimple-ssa-strength-reduction.c,
graphite.c, ifcvt.c, init-regs.c, ipa-cp.c, ipa-devirt.c,
ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c,
ipa-reference.c, ipa-split.c, ipa.c, ira.c, jump.c, loop-init.c,
lower-subreg.c, mode-switching.c, omp-low.c, postreload-gcse.c,
postreload.c, predict.c, recog.c, ree.c, reg-stack.c, regcprop.c,
reginfo.c, regrename.c, reorg.c, sched-rgn.c, stack-ptr-mod.c,
store-motion.c, tracer.c, trans-mem.c, tree-call-cdce.c, tree-cfg.c,
tree-cfgcleanup.c, tree-complex.c, tree-eh.c, tree-emutls.c,
tree-if-conv.c, tree-into-ssa.c, tree-loop-distribution.c, tree-nrv.c,
tree-object-size.c, tree-parloops.c, tree-predcom.c, tree-ssa-ccp.c,
tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c,
tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c,
tree-ssa-ifcombine.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c,
tree-ssa-loop-ivcanon.c, tree-ssa-loop-prefetch.c,
tree-ssa-loop-unswitch.c, tree-ssa-loop.c, tree-ssa-math-opts.c,
tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-uncprop.c, tree-ssa-uninit.c,
tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c,
tree-tailcall.c, tree-vect-generic.c, tree-vectorizer.c, tree-vrp.c,
tree.c, tsan.c, ubsan.c, var-tracking.c, vtable-verify.c, web.c:
Adjust.
From-SVN: r209482
2014-04-17 14:37:34 +02:00
|
|
|
statistics_counter_event (fun, "Redundant expressions eliminated",
|
2008-05-20 14:34:06 +02:00
|
|
|
opt_stats.num_re);
|
pass cfun to pass::execute
gcc/
* passes.c (opt_pass::execute): Adjust.
(pass_manager::execute_pass_mode_switching): Likewise.
(early_local_passes::execute): Likewise.
(execute_one_pass): Pass cfun to the pass's execute method.
* tree-pass.h (opt_pass::execute): Add function * argument.
* asan.c, auto-inc-dec.c, bb-reorder.c, bt-load.c, cfgcleanup.c,
cfgexpand.c, cfgrtl.c, cgraphbuild.c, combine-stack-adj.c, combine.c,
compare-elim.c, config/arc/arc.c, config/epiphany/mode-switch-use.c,
config/epiphany/resolve-sw-modes.c, config/i386/i386.c,
config/mips/mips.c, config/rl78/rl78.c, config/s390/s390.c,
config/sparc/sparc.c, cprop.c, dce.c, df-core.c, dse.c, dwarf2cfi.c,
except.c, final.c, function.c, fwprop.c, gcse.c, gimple-low.c,
gimple-ssa-isolate-paths.c, gimple-ssa-strength-reduction.c,
graphite.c, ifcvt.c, init-regs.c, ipa-cp.c, ipa-devirt.c,
ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c,
ipa-reference.c, ipa-split.c, ipa.c, ira.c, jump.c, loop-init.c,
lower-subreg.c, mode-switching.c, omp-low.c, postreload-gcse.c,
postreload.c, predict.c, recog.c, ree.c, reg-stack.c, regcprop.c,
reginfo.c, regrename.c, reorg.c, sched-rgn.c, stack-ptr-mod.c,
store-motion.c, tracer.c, trans-mem.c, tree-call-cdce.c, tree-cfg.c,
tree-cfgcleanup.c, tree-complex.c, tree-eh.c, tree-emutls.c,
tree-if-conv.c, tree-into-ssa.c, tree-loop-distribution.c, tree-nrv.c,
tree-object-size.c, tree-parloops.c, tree-predcom.c, tree-ssa-ccp.c,
tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c,
tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c,
tree-ssa-ifcombine.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c,
tree-ssa-loop-ivcanon.c, tree-ssa-loop-prefetch.c,
tree-ssa-loop-unswitch.c, tree-ssa-loop.c, tree-ssa-math-opts.c,
tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-uncprop.c, tree-ssa-uninit.c,
tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c,
tree-tailcall.c, tree-vect-generic.c, tree-vectorizer.c, tree-vrp.c,
tree.c, tsan.c, ubsan.c, var-tracking.c, vtable-verify.c, web.c:
Adjust.
From-SVN: r209482
2014-04-17 14:37:34 +02:00
|
|
|
statistics_counter_event (fun, "Constants propagated",
|
2008-05-20 14:34:06 +02:00
|
|
|
opt_stats.num_const_prop);
|
pass cfun to pass::execute
gcc/
* passes.c (opt_pass::execute): Adjust.
(pass_manager::execute_pass_mode_switching): Likewise.
(early_local_passes::execute): Likewise.
(execute_one_pass): Pass cfun to the pass's execute method.
* tree-pass.h (opt_pass::execute): Add function * argument.
* asan.c, auto-inc-dec.c, bb-reorder.c, bt-load.c, cfgcleanup.c,
cfgexpand.c, cfgrtl.c, cgraphbuild.c, combine-stack-adj.c, combine.c,
compare-elim.c, config/arc/arc.c, config/epiphany/mode-switch-use.c,
config/epiphany/resolve-sw-modes.c, config/i386/i386.c,
config/mips/mips.c, config/rl78/rl78.c, config/s390/s390.c,
config/sparc/sparc.c, cprop.c, dce.c, df-core.c, dse.c, dwarf2cfi.c,
except.c, final.c, function.c, fwprop.c, gcse.c, gimple-low.c,
gimple-ssa-isolate-paths.c, gimple-ssa-strength-reduction.c,
graphite.c, ifcvt.c, init-regs.c, ipa-cp.c, ipa-devirt.c,
ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c,
ipa-reference.c, ipa-split.c, ipa.c, ira.c, jump.c, loop-init.c,
lower-subreg.c, mode-switching.c, omp-low.c, postreload-gcse.c,
postreload.c, predict.c, recog.c, ree.c, reg-stack.c, regcprop.c,
reginfo.c, regrename.c, reorg.c, sched-rgn.c, stack-ptr-mod.c,
store-motion.c, tracer.c, trans-mem.c, tree-call-cdce.c, tree-cfg.c,
tree-cfgcleanup.c, tree-complex.c, tree-eh.c, tree-emutls.c,
tree-if-conv.c, tree-into-ssa.c, tree-loop-distribution.c, tree-nrv.c,
tree-object-size.c, tree-parloops.c, tree-predcom.c, tree-ssa-ccp.c,
tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c,
tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c,
tree-ssa-ifcombine.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c,
tree-ssa-loop-ivcanon.c, tree-ssa-loop-prefetch.c,
tree-ssa-loop-unswitch.c, tree-ssa-loop.c, tree-ssa-math-opts.c,
tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-uncprop.c, tree-ssa-uninit.c,
tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c,
tree-tailcall.c, tree-vect-generic.c, tree-vectorizer.c, tree-vrp.c,
tree.c, tsan.c, ubsan.c, var-tracking.c, vtable-verify.c, web.c:
Adjust.
From-SVN: r209482
2014-04-17 14:37:34 +02:00
|
|
|
statistics_counter_event (fun, "Copies propagated",
|
2008-05-20 14:34:06 +02:00
|
|
|
opt_stats.num_copy_prop);
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
/* Debugging dumps. */
|
|
|
|
if (dump_file && (dump_flags & TDF_STATS))
|
|
|
|
dump_dominator_optimization_stats (dump_file);
|
|
|
|
|
2007-05-17 10:10:24 +02:00
|
|
|
loop_optimizer_finalize ();
|
|
|
|
|
2006-02-07 19:31:27 +01:00
|
|
|
/* Delete our main hashtable. */
|
Remove a layer of indirection from hash_table
gcc/
* hash-table.h: Remove a layer of indirection from hash_table so that
it contains the hash table's data instead of a pointer to the data.
* alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c,
config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c,
config/mips/mips.c, config/sol2.c, coverage.c, cselib.c,
data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c,
fold-const.c, gcse.c, ggc-common.c,
gimple-ssa-strength-reduction.c, gimplify.c,
graphite-clast-to-gimple.c, graphite-dependences.c,
graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c,
ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c,
loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c,
lto-streamer.c, lto-streamer.h, passes.c, plugin.c,
postreload-gcse.c, sese.c, statistics.c, store-motion.c,
trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c,
tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c,
tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c,
tree-ssa-live.c, tree-ssa-loop-im.c,
tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-tail-merge.c,
tree-ssa-threadupdate.c, tree-ssa-uncprop.c,
tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c,
tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c,
vtable-verify.c, vtable-verify.h: Adjust.
gcc/c/
* c-decl.c: Adjust.
gcc/cp/
* class.c, semantics.c, tree.c, vtable-class-hierarchy.c:
Adjust.
gcc/java/
* jcf-io.c: Adjust.
gcc/lto/
* lto.c: Adjust.
gcc/objc/
* objc-act.c: Adjust.
From-SVN: r211936
2014-06-24 15:21:35 +02:00
|
|
|
delete avail_exprs;
|
|
|
|
avail_exprs = NULL;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2006-02-17 05:15:32 +01:00
|
|
|
/* Free asserted bitmaps and stacks. */
|
bitmap.h (BITMAP_XMALLOC, [...]): Remove.
* bitmap.h (BITMAP_XMALLOC, BITMAP_XFREE): Remove.
* bb-reorder.c (duplicate_computed_gotos): Use BITMAP_ALLOC and
BITMAP_FREE.
* bt-load.c (btr_def_live_range, combine_btr_defs,
migrate_btr_def, migrate_btr_defs): Likewise.
* cfgcleanup.c (thread_jump): Likewise.
* cfgloop.c (get_loop_body_in_bfs_order): Likewise.
* df.c (df_insn_table_realloc, df_bitmaps_alloc, df_bitmaps_free,
df_alloc, df_free, df_du_chain_create, df_bb_rd_local_compute,
df_rd_local_compute, df_reg_info_compute): Likewise.
* dominance.c (init_dom_info, free_dom_info): Likewise.
* flow.c (init_propagate_block_info,
free_propagate_block_info): Likewise.
* gcse.c (alloc_gcse_mem, free_gcse_mem): Likewise.
* global.c (allocate_bb_info, free_bb_info, calculate_reg_pav,
modify_reg_pav): Likewise.
* loop-invariant.c (find_defs, find_invariant_insn,
find_invariants, free_inv_motion_data): Likewise.
* predict.c (tree_predict_by_opcode,
estimate_bb_frequencies): Likewise.
* stmt.c (expand_case): Likewise.
* tree-cfg.c (tree_duplicate_sese_region): Likewise.
* tree-dfa.c (mark_new_vars_to_rename): Likewise.
* tree-if-conv.c (get_loop_body_in_if_conv_order): Likewise.
* tree-into-ssa.c (insert_phi_nodes_for, def_blocks_free,
get_def_blocks_for, mark_def_site_blocks, rewrite_into_ssa,
rewrite_ssa_into_ssa): Likewise.
* tree-optimize.c (tree_rest_of_compilation): Likewise.
* tree-outof-ssa.c (new_temp_expr_table, free_temp_expr_table,
analyze_edges_for_bb, perform_edge_inserts): Likewise.
* tree-scalar-evolution.c (scev_initialize, scev_finalize): Likewise.
* tree-sra.c (tree_sra): Likewise.
* tree-ssa-alias.c (init_alias_info, delete_alias_info): Likewise.
* tree-ssa-ccp.c (ccp_fold_builtin): Likewise.
* tree-ssa-dce.c (tree_dce_init, tree_dce_done): Likewise.
* tree-ssa-dom.c (tree_ssa_dominator_optimize): Likewise.
* tree-ssa-dse.c (tree_ssa_dse): Likewise.
* tree-ssa-forwprop.c (tree_ssa_forward_propagate_single_use_var):
Likewise.
* tree-ssa-live.c (new_tree_live_info, delete_tree_live_info,
calculate_live_on_entry, calculate_live_on_exit,
build_tree_conflict_graph): Likewise.
* tree-ssa-loop-ivopts.c (tree_ssa_iv_optimize_init, record_use,
record_important_candidates, set_use_iv_cost, find_depends,
determine_use_iv_costs, iv_ca_new, iv_ca_free, free_loop_data,
tree_ssa_iv_optimize_finalize): Likewise.
* tree-ssa-loop-manip.c (add_exit_phis_var, get_loops_exit,
find_uses_to_rename_use, rewrite_into_loop_closed_ssa,
tree_duplicate_loop_to_header_edge): Likewise.
* tree-ssa-pre.c (init_pre, fini_pre): Likewise.
* tree-ssa.c (verify_flow_insensitive_alias_info,
verify_name_tags, verify_ssa, init_tree_ssa,
delete_tree_ssa): Likewise.
* tree-ssanames.c (marked_ssa_names, init_ssanames,
fini_ssanames): Likewise.
* tree-vectorizer.c (slpeel_tree_peel_loop_to_edge): Likewise.
From-SVN: r95172
2005-02-17 17:19:49 +01:00
|
|
|
BITMAP_FREE (need_eh_cleanup);
|
2015-03-13 09:47:14 +01:00
|
|
|
need_noreturn_fixup.release ();
|
2015-09-15 19:03:49 +02:00
|
|
|
delete avail_exprs_stack;
|
2015-04-17 21:24:17 +02:00
|
|
|
delete const_and_copies;
|
2009-11-25 11:55:54 +01:00
|
|
|
|
2009-04-28 10:50:19 +02:00
|
|
|
/* Free the value-handle array. */
|
|
|
|
threadedge_finalize_values ();
|
|
|
|
|
2006-03-02 20:00:11 +01:00
|
|
|
return 0;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2015-08-12 22:09:33 +02:00
|
|
|
} // anon namespace
|
|
|
|
|
2013-08-05 22:16:05 +02:00
|
|
|
gimple_opt_pass *
|
|
|
|
make_pass_dominator (gcc::context *ctxt)
|
|
|
|
{
|
|
|
|
return new pass_dominator (ctxt);
|
|
|
|
}
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
/* Given a conditional statement CONDSTMT, convert the
|
|
|
|
condition to a canonical form. */
|
2005-12-12 20:59:16 +01:00
|
|
|
|
|
|
|
static void
|
2014-11-19 18:00:54 +01:00
|
|
|
canonicalize_comparison (gcond *condstmt)
|
2005-12-12 20:59:16 +01:00
|
|
|
{
|
|
|
|
tree op0;
|
|
|
|
tree op1;
|
2008-07-28 16:33:56 +02:00
|
|
|
enum tree_code code;
|
2005-12-12 20:59:16 +01:00
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
gcc_assert (gimple_code (condstmt) == GIMPLE_COND);
|
2005-12-12 20:59:16 +01:00
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
op0 = gimple_cond_lhs (condstmt);
|
|
|
|
op1 = gimple_cond_rhs (condstmt);
|
|
|
|
|
|
|
|
code = gimple_cond_code (condstmt);
|
2005-12-12 20:59:16 +01:00
|
|
|
|
|
|
|
/* If it would be profitable to swap the operands, then do so to
|
|
|
|
canonicalize the statement, enabling better optimization.
|
|
|
|
|
|
|
|
By placing canonicalization of such expressions here we
|
|
|
|
transparently keep statements in canonical form, even
|
|
|
|
when the statement is modified. */
|
|
|
|
if (tree_swap_operands_p (op0, op1, false))
|
|
|
|
{
|
|
|
|
/* For relationals we need to swap the operands
|
|
|
|
and change the code. */
|
|
|
|
if (code == LT_EXPR
|
|
|
|
|| code == GT_EXPR
|
|
|
|
|| code == LE_EXPR
|
|
|
|
|| code == GE_EXPR)
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
code = swap_tree_comparison (code);
|
|
|
|
|
|
|
|
gimple_cond_set_code (condstmt, code);
|
|
|
|
gimple_cond_set_lhs (condstmt, op1);
|
|
|
|
gimple_cond_set_rhs (condstmt, op0);
|
|
|
|
|
|
|
|
update_stmt (condstmt);
|
2005-12-12 20:59:16 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
/* Initialize local stacks for this optimizer and record equivalences
|
|
|
|
upon entry to BB. Equivalences can come from the edge traversed to
|
|
|
|
reach BB or they may come from PHI nodes at the start of BB. */
|
|
|
|
|
|
|
|
/* Remove all the expressions in LOCALS from TABLE, stopping when there are
|
|
|
|
LIMIT entries left in LOCALs. */
|
|
|
|
|
2015-09-15 19:03:49 +02:00
|
|
|
void
|
|
|
|
avail_exprs_stack::pop_to_marker ()
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
|
|
|
/* Remove all the expressions made available in this block. */
|
2015-09-15 19:03:49 +02:00
|
|
|
while (m_stack.length () > 0)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2015-09-15 19:03:49 +02:00
|
|
|
std::pair<expr_hash_elt_t, expr_hash_elt_t> victim = m_stack.pop ();
|
2013-04-26 02:28:35 +02:00
|
|
|
expr_hash_elt **slot;
|
2004-09-15 06:38:04 +02:00
|
|
|
|
2014-11-20 09:40:52 +01:00
|
|
|
if (victim.first == NULL)
|
2004-09-15 06:38:04 +02:00
|
|
|
break;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
/* This must precede the actual removal from the hash table,
|
|
|
|
as ELEMENT and the table entry may share a call argument
|
|
|
|
vector which will be freed during removal. */
|
|
|
|
if (dump_file && (dump_flags & TDF_DETAILS))
|
|
|
|
{
|
|
|
|
fprintf (dump_file, "<<<< ");
|
2015-09-15 19:03:49 +02:00
|
|
|
victim.first->print (dump_file);
|
2008-07-28 16:33:56 +02:00
|
|
|
}
|
|
|
|
|
2015-09-15 19:03:49 +02:00
|
|
|
slot = m_avail_exprs->find_slot (victim.first, NO_INSERT);
|
2014-11-20 09:40:52 +01:00
|
|
|
gcc_assert (slot && *slot == victim.first);
|
|
|
|
if (victim.second != NULL)
|
|
|
|
{
|
|
|
|
free_expr_hash_elt (*slot);
|
|
|
|
*slot = victim.second;
|
|
|
|
}
|
|
|
|
else
|
2015-09-15 19:03:49 +02:00
|
|
|
m_avail_exprs->clear_slot (slot);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
avail_exprs_stack::record_expr (class expr_hash_elt *elt1,
|
|
|
|
class expr_hash_elt *elt2,
|
|
|
|
char type)
|
|
|
|
{
|
|
|
|
if (elt1 && dump_file && (dump_flags & TDF_DETAILS))
|
|
|
|
{
|
|
|
|
fprintf (dump_file, "%c>>> ", type);
|
|
|
|
elt1->print (dump_file);
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
2015-09-15 19:03:49 +02:00
|
|
|
|
|
|
|
m_stack.safe_push (std::pair<expr_hash_elt_t, expr_hash_elt_t> (elt1, elt2));
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2015-09-15 19:03:49 +02:00
|
|
|
|
2006-02-07 19:31:27 +01:00
|
|
|
/* A trivial wrapper so that we can present the generic jump
|
|
|
|
threading code with a simple API for simplifying statements. */
|
|
|
|
static tree
|
2008-07-28 16:33:56 +02:00
|
|
|
simplify_stmt_for_jump_threading (gimple stmt,
|
|
|
|
gimple within_stmt ATTRIBUTE_UNUSED)
|
2006-02-07 19:31:27 +01:00
|
|
|
{
|
|
|
|
return lookup_avail_expr (stmt, false);
|
|
|
|
}
|
|
|
|
|
2015-07-16 09:19:24 +02:00
|
|
|
/* Valueize hook for gimple_fold_stmt_to_constant_1. */
|
|
|
|
|
|
|
|
static tree
|
|
|
|
dom_valueize (tree t)
|
|
|
|
{
|
|
|
|
if (TREE_CODE (t) == SSA_NAME)
|
|
|
|
{
|
|
|
|
tree tem = SSA_NAME_VALUE (t);
|
|
|
|
if (tem)
|
|
|
|
return tem;
|
|
|
|
}
|
|
|
|
return t;
|
|
|
|
}
|
|
|
|
|
2013-09-20 19:43:08 +02:00
|
|
|
/* Record into the equivalence tables any equivalences implied by
|
|
|
|
traversing edge E (which are cached in E->aux).
|
|
|
|
|
|
|
|
Callers are responsible for managing the unwinding markers. */
|
2013-09-19 14:49:30 +02:00
|
|
|
static void
|
|
|
|
record_temporary_equivalences (edge e)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
struct edge_info *edge_info = (struct edge_info *) e->aux;
|
|
|
|
|
|
|
|
/* If we have info associated with this edge, record it into
|
|
|
|
our equivalence tables. */
|
|
|
|
if (edge_info)
|
|
|
|
{
|
|
|
|
cond_equivalence *eq;
|
|
|
|
tree lhs = edge_info->lhs;
|
|
|
|
tree rhs = edge_info->rhs;
|
|
|
|
|
|
|
|
/* If we have a simple NAME = VALUE equivalence, record it. */
|
2015-07-14 09:27:04 +02:00
|
|
|
if (lhs)
|
|
|
|
record_equality (lhs, rhs);
|
|
|
|
|
|
|
|
/* If LHS is an SSA_NAME and RHS is a constant integer and LHS was
|
|
|
|
set via a widening type conversion, then we may be able to record
|
|
|
|
additional equivalences. */
|
|
|
|
if (lhs
|
|
|
|
&& TREE_CODE (lhs) == SSA_NAME
|
|
|
|
&& TREE_CODE (rhs) == INTEGER_CST)
|
|
|
|
{
|
|
|
|
gimple defstmt = SSA_NAME_DEF_STMT (lhs);
|
|
|
|
|
|
|
|
if (defstmt
|
|
|
|
&& is_gimple_assign (defstmt)
|
|
|
|
&& CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (defstmt)))
|
|
|
|
{
|
|
|
|
tree old_rhs = gimple_assign_rhs1 (defstmt);
|
|
|
|
|
|
|
|
/* If the conversion widens the original value and
|
|
|
|
the constant is in the range of the type of OLD_RHS,
|
|
|
|
then convert the constant and record the equivalence.
|
|
|
|
|
|
|
|
Note that int_fits_type_p does not check the precision
|
|
|
|
if the upper and lower bounds are OK. */
|
|
|
|
if (INTEGRAL_TYPE_P (TREE_TYPE (old_rhs))
|
|
|
|
&& (TYPE_PRECISION (TREE_TYPE (lhs))
|
|
|
|
> TYPE_PRECISION (TREE_TYPE (old_rhs)))
|
|
|
|
&& int_fits_type_p (rhs, TREE_TYPE (old_rhs)))
|
|
|
|
{
|
|
|
|
tree newval = fold_convert (TREE_TYPE (old_rhs), rhs);
|
|
|
|
record_equality (old_rhs, newval);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-09-19 14:49:30 +02:00
|
|
|
|
2015-07-16 09:19:24 +02:00
|
|
|
/* If LHS is an SSA_NAME with a new equivalency then try if
|
|
|
|
stmts with uses of that LHS that dominate the edge destination
|
|
|
|
simplify and allow further equivalences to be recorded. */
|
|
|
|
if (lhs && TREE_CODE (lhs) == SSA_NAME)
|
|
|
|
{
|
|
|
|
use_operand_p use_p;
|
|
|
|
imm_use_iterator iter;
|
|
|
|
FOR_EACH_IMM_USE_FAST (use_p, iter, lhs)
|
|
|
|
{
|
|
|
|
gimple use_stmt = USE_STMT (use_p);
|
|
|
|
|
|
|
|
/* Only bother to record more equivalences for lhs that
|
|
|
|
can be directly used by e->dest.
|
|
|
|
??? If the code gets re-organized to a worklist to
|
|
|
|
catch more indirect opportunities and it is made to
|
|
|
|
handle PHIs then this should only consider use_stmts
|
|
|
|
in basic-blocks we have already visited. */
|
|
|
|
if (e->dest == gimple_bb (use_stmt)
|
|
|
|
|| !dominated_by_p (CDI_DOMINATORS,
|
|
|
|
e->dest, gimple_bb (use_stmt)))
|
|
|
|
continue;
|
|
|
|
tree lhs2 = gimple_get_lhs (use_stmt);
|
|
|
|
if (lhs2 && TREE_CODE (lhs2) == SSA_NAME)
|
|
|
|
{
|
|
|
|
tree res
|
|
|
|
= gimple_fold_stmt_to_constant_1 (use_stmt, dom_valueize,
|
|
|
|
no_follow_ssa_edges);
|
|
|
|
if (res
|
|
|
|
&& (TREE_CODE (res) == SSA_NAME
|
|
|
|
|| is_gimple_min_invariant (res)))
|
|
|
|
record_equality (lhs2, res);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-09-19 14:49:30 +02:00
|
|
|
/* If we have 0 = COND or 1 = COND equivalences, record them
|
|
|
|
into our expression hash tables. */
|
|
|
|
for (i = 0; edge_info->cond_equivalences.iterate (i, &eq); ++i)
|
|
|
|
record_cond (eq);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-02-07 19:31:27 +01:00
|
|
|
/* Wrapper for common code to attempt to thread an edge. For example,
|
|
|
|
it handles lazily building the dummy condition and the bookkeeping
|
|
|
|
when jump threading is successful. */
|
|
|
|
|
2013-09-18 04:39:50 +02:00
|
|
|
void
|
|
|
|
dom_opt_dom_walker::thread_across_edge (edge e)
|
2006-02-07 19:31:27 +01:00
|
|
|
{
|
2013-09-30 22:35:40 +02:00
|
|
|
if (! m_dummy_cond)
|
|
|
|
m_dummy_cond =
|
2008-07-28 16:33:56 +02:00
|
|
|
gimple_build_cond (NE_EXPR,
|
|
|
|
integer_zero_node, integer_zero_node,
|
|
|
|
NULL, NULL);
|
2006-02-07 19:31:27 +01:00
|
|
|
|
2013-09-19 14:49:30 +02:00
|
|
|
/* Push a marker on both stacks so we can unwind the tables back to their
|
|
|
|
current state. */
|
2015-09-15 19:03:49 +02:00
|
|
|
avail_exprs_stack->push_marker ();
|
2015-04-17 21:24:17 +02:00
|
|
|
const_and_copies->push_marker ();
|
2013-09-19 14:49:30 +02:00
|
|
|
|
|
|
|
/* Traversing E may result in equivalences we can utilize. */
|
|
|
|
record_temporary_equivalences (e);
|
|
|
|
|
|
|
|
/* With all the edge equivalences in the tables, go ahead and attempt
|
|
|
|
to thread through E->dest. */
|
2013-09-30 22:35:40 +02:00
|
|
|
::thread_across_edge (m_dummy_cond, e, false,
|
2015-04-17 21:24:17 +02:00
|
|
|
const_and_copies,
|
2013-09-18 04:39:50 +02:00
|
|
|
simplify_stmt_for_jump_threading);
|
2013-09-19 14:49:30 +02:00
|
|
|
|
|
|
|
/* And restore the various tables to their state before
|
2015-09-15 19:03:49 +02:00
|
|
|
we threaded this edge.
|
2013-09-19 14:49:30 +02:00
|
|
|
|
|
|
|
XXX The code in tree-ssa-threadedge.c will restore the state of
|
|
|
|
the const_and_copies table. We we just have to restore the expression
|
|
|
|
table. */
|
2015-09-15 19:03:49 +02:00
|
|
|
avail_exprs_stack->pop_to_marker ();
|
2006-02-07 19:31:27 +01:00
|
|
|
}
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
/* PHI nodes can create equivalences too.
|
|
|
|
|
|
|
|
Ignoring any alternatives which are the same as the result, if
|
|
|
|
all the alternatives are equal, then the PHI node creates an
|
2006-02-17 05:15:32 +01:00
|
|
|
equivalence. */
|
2004-05-18 04:53:55 +02:00
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
static void
|
2004-10-30 02:06:22 +02:00
|
|
|
record_equivalences_from_phis (basic_block bb)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2014-11-19 18:00:54 +01:00
|
|
|
gphi_iterator gsi;
|
2009-11-25 11:55:54 +01:00
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2014-11-19 18:00:54 +01:00
|
|
|
gphi *phi = gsi.phi ();
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
|
|
tree lhs = gimple_phi_result (phi);
|
2004-05-13 08:41:07 +02:00
|
|
|
tree rhs = NULL;
|
2008-07-28 16:33:56 +02:00
|
|
|
size_t i;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
for (i = 0; i < gimple_phi_num_args (phi); i++)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
tree t = gimple_phi_arg_def (phi, i);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2004-12-13 16:43:13 +01:00
|
|
|
/* Ignore alternatives which are the same as our LHS. Since
|
|
|
|
LHS is a PHI_RESULT, it is known to be a SSA_NAME, so we
|
|
|
|
can simply compare pointers. */
|
2004-12-13 16:15:48 +01:00
|
|
|
if (lhs == t)
|
2004-12-03 08:38:39 +01:00
|
|
|
continue;
|
|
|
|
|
2015-09-01 12:51:43 +02:00
|
|
|
t = dom_valueize (t);
|
2015-04-27 14:46:58 +02:00
|
|
|
|
2004-12-03 08:38:39 +01:00
|
|
|
/* If we have not processed an alternative yet, then set
|
|
|
|
RHS to this alternative. */
|
|
|
|
if (rhs == NULL)
|
|
|
|
rhs = t;
|
|
|
|
/* If we have processed an alternative (stored in RHS), then
|
|
|
|
see if it is equal to this one. If it isn't, then stop
|
|
|
|
the search. */
|
|
|
|
else if (! operand_equal_for_phi_arg_p (rhs, t))
|
2004-05-13 08:41:07 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If we had no interesting alternatives, then all the RHS alternatives
|
|
|
|
must have been the same as LHS. */
|
|
|
|
if (!rhs)
|
|
|
|
rhs = lhs;
|
|
|
|
|
|
|
|
/* If we managed to iterate through each PHI alternative without
|
|
|
|
breaking out of the loop, then we have a PHI which may create
|
|
|
|
a useful equivalence. We do not need to record unwind data for
|
|
|
|
this, since this is a true assignment and not an equivalence
|
c-common.c, [...]: Fix comment typos.
* c-common.c, calls.c, cfgcleanup.c, cgraph.c, cgraphunit.c,
ddg.c, ddg.h, df.c, df.h, except.c, expr.c, flags.h,
fold-const.c, gcc.c, gimplify.c, haifa-sched.c,
modulo-sched.c, tree-inline.c, tree-into-ssa.c, tree-nested.c,
tree-nrv.c, tree-ssa-ccp.c, tree-ssa-dom.c, tree-ssa-live.c,
tree-ssa-loop.c, tree-ssa-pre.c, tree-tailcall.c, tree.h: Fix
comment typos. Follow spelling conventions.
From-SVN: r82439
2004-05-30 09:12:58 +02:00
|
|
|
inferred from a comparison. All uses of this ssa name are dominated
|
2004-05-13 08:41:07 +02:00
|
|
|
by this assignment, so unwinding just costs time and space. */
|
2014-06-26 13:29:34 +02:00
|
|
|
if (i == gimple_phi_num_args (phi)
|
2014-07-08 11:22:54 +02:00
|
|
|
&& may_propagate_copy (lhs, rhs))
|
2009-04-28 10:50:19 +02:00
|
|
|
set_ssa_name_value (lhs, rhs);
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-07-19 21:01:55 +02:00
|
|
|
/* Ignoring loop backedges, if BB has precisely one incoming edge then
|
|
|
|
return that edge. Otherwise return NULL. */
|
|
|
|
static edge
|
|
|
|
single_incoming_edge_ignoring_loop_edges (basic_block bb)
|
|
|
|
{
|
|
|
|
edge retval = NULL;
|
|
|
|
edge e;
|
backport: basic-block.h: Include vec.h, errors.h.
2004-09-24 Ben Elliston <bje@au.ibm.com>
Steven Bosscher <stevenb@suse.de>
Andrew Pinski <pinskia@physics.uc.edu>
Merge from edge-vector-branch:
* basic-block.h: Include vec.h, errors.h. Instantiate a VEC(edge).
(struct edge_def): Remove pred_next, succ_next members.
(struct basic_block_def): Remove pred, succ members. Add preds
and succs members of type VEC(edge).
(FALLTHRU_EDGE): Redefine using EDGE_SUCC.
(BRANCH_EDGE): Likewise.
(EDGE_CRITICAL_P): Redefine using EDGE_COUNT.
(EDGE_COUNT, EDGE_I, EDGE_PRED, EDGE_SUCC): New.
(edge_iterator): New.
(ei_start, ei_last, ei_end_p, ei_one_before_end_p): New.
(ei_next, ei_prev, ei_edge, ei_safe_edge): Likewise.
(FOR_EACH_EDGE): New.
* bb-reorder.c (find_traces): Use FOR_EACH_EDGE and EDGE_* macros
where applicable.
(rotate_loop): Likewise.
(find_traces_1_route): Likewise.
(bb_to_key): Likewise.
(connect_traces): Likewise.
(copy_bb_p): Likewise.
(find_rarely_executed_basic_blocks_and_crossing_edges): Likewise.
(add_labels_and_missing_jumps): Likewise.
(fix_up_fall_thru_edges): Likewise.
(find_jump_block): Likewise.
(fix_crossing_conditional_branches): Likewise.
(fix_crossing_unconditional_branches): Likewise.
(add_reg_crossing_jump_notes): Likewise.
* bt-load.c (augment_live_range): Likewise.
* cfg.c (clear_edges): Likewise.
(unchecked_make_edge): Likewise.
(cached_make_edge): Likewise.
(make_single_succ_edge): Likewise.
(remove_edge): Likewise.
(redirect_edge_succ_nodup): Likewise.
(check_bb_profile): Likewise.
(dump_flow_info): Likewise.
(alloc_aux_for_edges): Likewise.
(clear_aux_for_edges): Likewise.
(dump_cfg_bb_info): Likewise.
* cfganal.c (forwarder_block_p): Likewise.
(can_fallthru): Likewise.
(could_fall_through): Likewise.
(mark_dfs_back_edges): Likewise.
(set_edge_can_fallthru_flag): Likewise.
(find_unreachable_blocks): Likewise.
(create_edge_list): Likewise.
(verify_edge_list): Likewise.
(add_noreturn_fake_exit_edges): Likewise.
(connect_infinite_loops_to_exit): Likewise.
(flow_reverse_top_sort_order_compute): Likewise.
(flow_depth_first_order_compute): Likewise.
(flow_preorder_transversal_compute): Likewise.
(flow_dfs_compute_reverse_execute): Likewise.
(dfs_enumerate_from): Likewise.
(compute_dominance_frontiers_1): Likewise.
* cfgbuild.c (make_edges): Likewise.
(compute_outgoing_frequencies): Likewise.
(find_many_sub_basic_blocks): Likewise.
(find_sub_basic_blocks): Likewise.
* cfgcleanup.c (try_simplify_condjump): Likewise.
(thread_jump): Likewise.
(try_forward_edges): Likewise.
(merge_blocks_move): Likewise.
(outgoing_edges_match): Likewise.
(try_crossjump_to_edge): Likewise.
(try_crossjump_bb): Likewise.
(try_optimize_cfg): Likewise.
(merge_seq_blocks): Likewise.
* cfgexpand.c (expand_gimple_tailcall): Likewise.
(expand_gimple_basic_block): Likewise.
(construct_init_block): Likewise.
(construct_exit_block): Likewise.
* cfghooks.c (verify_flow_info): Likewise.
(dump_bb): Likewise.
(delete_basic_block): Likewise.
(split_edge): Likewise.
(merge_blocks): Likewise.
(make_forwarder_block): Likewise.
(tidy_fallthru_edges): Likewise.
(can_duplicate_block_p): Likewise.
(duplicate_block): Likewise.
* cfglayout.c (fixup_reorder_chain): Likewise.
(fixup_fallthru_exit_predecessor): Likewise.
(can_copy_bbs_p): Likewise.
(copy_bbs): Likewise.
* cfgloop.c (flow_loops_cfg_dump): Likewise.
(flow_loop_entry_edges_find): Likewise.
(flow_loop_exit_edges_find): Likewise.
(flow_loop_nodes_find): Likewise.
(mark_single_exit_loops): Likewise.
(flow_loop_pre_header_scan): Likewise.
(flow_loop_pre_header_find): Likewise.
(update_latch_info): Likewise.
(canonicalize_loop_headers): Likewise.
(flow_loops_find): Likewise.
(get_loop_body_in_bfs_order): Likewise.
(get_loop_exit_edges): Likewise.
(num_loop_branches): Likewise.
(verify_loop_structure): Likewise.
(loop_latch_edge): Likewise.
(loop_preheader_edge): Likewise.
* cfgloopanal.c (mark_irreducible_loops): Likewise.
(expected_loop_iterations): Likewise.
* cfgloopmanip.c (remove_bbs): Likewise.
(fix_bb_placement): Likewise.
(fix_irreducible_loops): Likewise.
(remove_path): Likewise.
(scale_bbs_frequencies): Likewise.
(loopify): Likewise.
(unloop): Likewise.
(fix_loop_placement): Likewise.
(loop_delete_branch_edge): Likewise.
(duplicate_loop_to_header_edge): Likewise.
(mfb_keep_just): Likewise.
(create_preheader): Likewise.
(force_single_succ_latches): Likewise.
(loop_split_edge_with): Likewise.
(create_loop_notes): Likewise.
* cfgrtl.c (rtl_split_block): Likewise.
(rtl_merge_blocks): Likewise.
(rtl_can_merge_blocks): Likewise.
(try_redirect_by_replacing_jump): Likewise.
(force_nonfallthru_and_redirect): Likewise.
(rtl_tidy_fallthru_edge): Likewise.
(commit_one_edge_insertion): Likewise.
(commit_edge_insertions): Likewise.
(commit_edge_insertions_watch_calls): Likewise.
(rtl_verify_flow_info_1): Likewise.
(rtl_verify_flow_info): Likewise.
(purge_dead_edges): Likewise.
(cfg_layout_redirect_edge_and_branch): Likewise.
(cfg_layout_can_merge_blocks_p): Likewise.
(rtl_flow_call_edges_add): Likewise.
* cse.c (cse_cc_succs): Likewise.
* df.c (hybrid_search): Likewise.
* dominance.c (calc_dfs_tree_nonrec): Likewise.
(calc_dfs_tree): Likewise.
(calc_idoms): Likewise.
(recount_dominator): Likewise.
* domwalk.c (walk_dominator_tree): Likewise.
* except.c (emit_to_new_bb_before): Likewise.
(connect_post_landing_pads): Likewise.
(sjlj_emit_function_enter): Likewise.
(sjlj_emit_function_exit): Likewise.
(finish_eh_generation): Likewise.
* final.c (compute_alignments): Likewise.
* flow.c (calculate_global_regs_live): Likewise.
(initialize_uninitialized_subregs): Likewise.
(init_propagate_block_info): Likewise.
* function.c (thread_prologue_and_epilogue_insns): Likewise.
* gcse.c (find_implicit_sets): Likewise.
(bypass_block): Likewise.
(bypass_conditional_jumps): Likewise.
(compute_pre_data): Likewise.
(insert_insn_end_bb): Likewise.
(insert_store): Likewise.
(remove_reachable_equiv_notes): Likewise.
* global.c (global_conflicts): Likewise.
(calculate_reg_pav): Likewise.
* graph.c (print_rtl_graph_with_bb): Likewise.
* ifcvt.c (mark_loop_exit_edges): Likewise.
(merge_if_block): Likewise.
(find_if_header): Likewise.
(block_jumps_and_fallthru_p): Likewise.
(find_if_block): Likewise.
(find_cond_trap): Likewise.
(block_has_only_trap): Likewise.
(find_if_case1): Likewise.
(find_if_case_2): Likewise.
* lambda-code.c (lambda_loopnest_to_gcc_loopnest): Likewise.
(perfect_nestify): Likewise.
* lcm.c (compute_antinout_edge): Likewise.
(compute_laterin): Likewise.
(compute_available): Likewise.
(compute_nearerout): Likewise.
* loop-doloop.c (doloop_modify): Likewise.
* loop-init.c (loop_optimizer_init): Likewise.
* loop-invariant.c (find_exits): Likewise.
* loop-iv.c (simplify_using_initial_values): Likewise.
(check_simple_exit): Likewise.
(find_simple_exit): Likewise.
* loop-unroll.c (peel_loop_completely): Likewise.
(unroll_loop_constant_iterations): Likewise.
(unroll_loop_runtime_iterations): Likewise.
* loop-unswitch.c (may_unswitch_on): Likewise.
(unswitch_loop): Likewise.
* modulo-sched.c (generate_prolog_epilog): Likewise.
(sms_schedule): Likewise.
* postreload-gcse.c (eliminate_partially_redundant_load):
Likewise.
* predict.c (can_predict_insn_p): Likewise.
(set_even_probabilities): Likewise.
(combine_predictions_for_bb): Likewise.
(predict_loops): Likewise.
(estimate_probability): Likewise.
(tree_predict_by_opcode): Likewise.
(tree_estimate_probability): Likewise.
(last_basic_block_p): Likewise.
(propagate_freq): Likewise.
(estimate_loops_at_level): Likewise.
(estimate_bb_frequencies): Likewise.
* profile.c (instrument_edges): Likewise.
(get_exec_counts): Likewise.
(compute_branch_probabilities): Likewise.
(branch_prob): Likewise.
* ra-build.c (live_in): Likewise.
* ra-rewrite.c (rewrite_program2): Likewise.
* ra.c (reg_alloc): Likewise.
* reg-stack.c (reg_to_stack): Likewise.
(convert_regs_entry): Likewise.
(compensate_edge): Likewise.
(convert_regs_1): Likewise,
(convert_regs_2): Likewise.
(convert_regs): Likewise.
* regrename.c (copyprop_hardreg_forward): Likewise.
* reload1.c (fixup_abnormal_edges): Likewise.
* sbitmap.c (sbitmap_intersection_of_succs): Likewise.
(sbitmap_insersection_of_preds): Likewise.
(sbitmap_union_of_succs): Likewise.
(sbitmap_union_of_preds): Likewise.
* sched-ebb.c (compute_jump_reg_dependencies): Likewise.
(fix_basic_block_boundaries): Likewise.
(sched_ebbs): Likewise.
* sched-rgn.c (build_control_flow): Likewise.
(find_rgns): Likewise.
* tracer.c (find_best_successor): Likewise.
(find_best_predecessor): Likewise.
(tail_duplicate): Likewise.
* tree-cfg.c (make_edges): Likewise.
(make_ctrl_stmt_edges): Likewise.
(make_goto_expr_edges): Likewise.
(tree_can_merge_blocks_p): Likewise.
(tree_merge_blocks): Likewise.
(cfg_remove_useless_stmts_bb): Likewise.
(remove_phi_nodes_and_edges_for_unreachable_block): Likewise.
(tree_block_forwards_to): Likewise.
(cleanup_control_expr_graph): Likewise.
(find_taken_edge): Likewise.
(dump_cfg_stats): Likewise.
(tree_cfg2vcg): Likewise.
(disband_implicit_edges): Likewise.
(tree_find_edge_insert_loc): Likewise.
(bsi_commit_edge_inserts): Likewise.
(tree_split_edge): Likewise.
(tree_verify_flow_info): Likewise.
(tree_make_forwarder_block): Likewise.
(tree_forwarder_block_p): Likewise.
(thread_jumps): Likewise.
(tree_try_redirect_by_replacing_jump): Likewise.
(tree_split_block): Likewise.
(add_phi_args_after_copy_bb): Likewise.
(rewrite_to_new_ssa_names_bb): Likewise.
(dump_function_to_file): Likewise.
(print_pred_bbs): Likewise.
(print_loop): Likewise.
(tree_flow_call_edges_add): Likewise.
(split_critical_edges): Likewise.
(execute_warn_function_return): Likewise.
(extract_true_false_edges_from_block): Likewise.
* tree-if-conv.c (tree_if_conversion): Likewise.
(if_convertable_bb_p): Likewise.
(find_phi_replacement_condition): Likewise.
(combine_blocks): Likewise.
* tree-into-ssa.c (compute_global_livein): Likewise.
(ssa_mark_phi_uses): Likewise.
(ssa_rewrite_initialize_block): Likewise.
(rewrite_add_phi_arguments): Likewise.
(ssa_rewrite_phi_arguments): Likewise.
(insert_phi_nodes_for): Likewise.
(rewrite_into_ssa): Likewise.
(rewrite_ssa_into_ssa): Likewise.
* tree-mudflap.c (mf_build_check_statement_for): Likewise.
* tree-outof-ssa.c (coalesce_abnormal_edges): Likewise.
(rewrite_trees): Likewise.
* tree-pretty-print.c (dump_bb_header): Likewise.
(dump_implicit_edges): Likewise.
* tree-sra.c (insert_edge_copies): Likewise.
(find_obviously_necessary_stmts): Likewise.
(remove_data_stmt): Likewise.
* tree-ssa-dom.c (thread_across_edge): Likewise.
(dom_opt_finalize_block): Likewise.
(single_incoming_edge_ignoring_loop_edges): Likewise.
(record_equivalences_from_incoming_edges): Likewise.
(cprop_into_successor_phis): Likewise.
* tree-ssa-live.c (live_worklist): Likewise.
(calculate_live_on_entry): Likewise.
(calculate_live_on_exit): Likewise.
* tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise.
(copy_loop_headers): Likewise.
* tree-ssa-loop-im.c (loop_commit_inserts): Likewise.
(fill_always_executed_in): Likewise.
* tree-ssa-loop-ivcanon.c (create_canonical_iv): Likewise.
* tree-ssa-loop-ivopts.c (find_interesting_uses): Likewise.
(compute_phi_arg_on_exit): Likewise.
* tree-ssa-loop-manip.c (add_exit_phis_edge): Likewise.
(get_loops_exit): Likewise.
(split_loop_exit_edge): Likewise.
(ip_normal_pos): Likewise.
* tree-ssa-loop-niter.c (simplify_using_initial_conditions):
Likewise.
* tree-ssa-phiopt.c (candidate_bb_for_phi_optimization): Likewise.
(replace_phi_with_stmt): Likewise.
(value_replacement): Likewise.
* tree-ssa-pre.c (compute_antic_aux): Likewise.
(insert_aux): Likewise.
(init_pre): Likewise.
* tree-ssa-propagate.c (simulate_stmt): Likewise.
(simulate_block): Likewise.
(ssa_prop_init): Likewise.
* tree-ssa-threadupdate.c (thread_block): Likewise.
(create_block_for_threading): Likewise.
(remove_last_stmt_and_useless_edges): Likewise.
* tree-ssa.c (verify_phi_args): Likewise.
(verify_ssa): Likewise.
* tree_tailcall.c (independent_of_stmt_p): Likewise.
(find_tail_calls): Likewise.
(eliminate_tail_call): Likewise.
(tree_optimize_tail_calls_1): Likewise.
* tree-vectorizer.c (vect_transform_loop): Likewise.
* var-tracking.c (prologue_stack_adjust): Likewise.
(vt_stack_adjustments): Likewise.
(vt_find_locations): Likewise.
* config/frv/frv.c (frv_ifcvt_modify_tests): Likewise.
* config/i386/i386.c (ix86_pad_returns): Likewise.
* config/ia64/ia64.c (ia64_expand_prologue): Likewise.
* config/rs6000/rs6000.c (rs6000_emit_prologue): Likewise.
Co-Authored-By: Andrew Pinski <pinskia@physics.uc.edu>
Co-Authored-By: Steven Bosscher <stevenb@suse.de>
From-SVN: r88222
2004-09-28 09:59:54 +02:00
|
|
|
edge_iterator ei;
|
2004-07-19 21:01:55 +02:00
|
|
|
|
backport: basic-block.h: Include vec.h, errors.h.
2004-09-24 Ben Elliston <bje@au.ibm.com>
Steven Bosscher <stevenb@suse.de>
Andrew Pinski <pinskia@physics.uc.edu>
Merge from edge-vector-branch:
* basic-block.h: Include vec.h, errors.h. Instantiate a VEC(edge).
(struct edge_def): Remove pred_next, succ_next members.
(struct basic_block_def): Remove pred, succ members. Add preds
and succs members of type VEC(edge).
(FALLTHRU_EDGE): Redefine using EDGE_SUCC.
(BRANCH_EDGE): Likewise.
(EDGE_CRITICAL_P): Redefine using EDGE_COUNT.
(EDGE_COUNT, EDGE_I, EDGE_PRED, EDGE_SUCC): New.
(edge_iterator): New.
(ei_start, ei_last, ei_end_p, ei_one_before_end_p): New.
(ei_next, ei_prev, ei_edge, ei_safe_edge): Likewise.
(FOR_EACH_EDGE): New.
* bb-reorder.c (find_traces): Use FOR_EACH_EDGE and EDGE_* macros
where applicable.
(rotate_loop): Likewise.
(find_traces_1_route): Likewise.
(bb_to_key): Likewise.
(connect_traces): Likewise.
(copy_bb_p): Likewise.
(find_rarely_executed_basic_blocks_and_crossing_edges): Likewise.
(add_labels_and_missing_jumps): Likewise.
(fix_up_fall_thru_edges): Likewise.
(find_jump_block): Likewise.
(fix_crossing_conditional_branches): Likewise.
(fix_crossing_unconditional_branches): Likewise.
(add_reg_crossing_jump_notes): Likewise.
* bt-load.c (augment_live_range): Likewise.
* cfg.c (clear_edges): Likewise.
(unchecked_make_edge): Likewise.
(cached_make_edge): Likewise.
(make_single_succ_edge): Likewise.
(remove_edge): Likewise.
(redirect_edge_succ_nodup): Likewise.
(check_bb_profile): Likewise.
(dump_flow_info): Likewise.
(alloc_aux_for_edges): Likewise.
(clear_aux_for_edges): Likewise.
(dump_cfg_bb_info): Likewise.
* cfganal.c (forwarder_block_p): Likewise.
(can_fallthru): Likewise.
(could_fall_through): Likewise.
(mark_dfs_back_edges): Likewise.
(set_edge_can_fallthru_flag): Likewise.
(find_unreachable_blocks): Likewise.
(create_edge_list): Likewise.
(verify_edge_list): Likewise.
(add_noreturn_fake_exit_edges): Likewise.
(connect_infinite_loops_to_exit): Likewise.
(flow_reverse_top_sort_order_compute): Likewise.
(flow_depth_first_order_compute): Likewise.
(flow_preorder_transversal_compute): Likewise.
(flow_dfs_compute_reverse_execute): Likewise.
(dfs_enumerate_from): Likewise.
(compute_dominance_frontiers_1): Likewise.
* cfgbuild.c (make_edges): Likewise.
(compute_outgoing_frequencies): Likewise.
(find_many_sub_basic_blocks): Likewise.
(find_sub_basic_blocks): Likewise.
* cfgcleanup.c (try_simplify_condjump): Likewise.
(thread_jump): Likewise.
(try_forward_edges): Likewise.
(merge_blocks_move): Likewise.
(outgoing_edges_match): Likewise.
(try_crossjump_to_edge): Likewise.
(try_crossjump_bb): Likewise.
(try_optimize_cfg): Likewise.
(merge_seq_blocks): Likewise.
* cfgexpand.c (expand_gimple_tailcall): Likewise.
(expand_gimple_basic_block): Likewise.
(construct_init_block): Likewise.
(construct_exit_block): Likewise.
* cfghooks.c (verify_flow_info): Likewise.
(dump_bb): Likewise.
(delete_basic_block): Likewise.
(split_edge): Likewise.
(merge_blocks): Likewise.
(make_forwarder_block): Likewise.
(tidy_fallthru_edges): Likewise.
(can_duplicate_block_p): Likewise.
(duplicate_block): Likewise.
* cfglayout.c (fixup_reorder_chain): Likewise.
(fixup_fallthru_exit_predecessor): Likewise.
(can_copy_bbs_p): Likewise.
(copy_bbs): Likewise.
* cfgloop.c (flow_loops_cfg_dump): Likewise.
(flow_loop_entry_edges_find): Likewise.
(flow_loop_exit_edges_find): Likewise.
(flow_loop_nodes_find): Likewise.
(mark_single_exit_loops): Likewise.
(flow_loop_pre_header_scan): Likewise.
(flow_loop_pre_header_find): Likewise.
(update_latch_info): Likewise.
(canonicalize_loop_headers): Likewise.
(flow_loops_find): Likewise.
(get_loop_body_in_bfs_order): Likewise.
(get_loop_exit_edges): Likewise.
(num_loop_branches): Likewise.
(verify_loop_structure): Likewise.
(loop_latch_edge): Likewise.
(loop_preheader_edge): Likewise.
* cfgloopanal.c (mark_irreducible_loops): Likewise.
(expected_loop_iterations): Likewise.
* cfgloopmanip.c (remove_bbs): Likewise.
(fix_bb_placement): Likewise.
(fix_irreducible_loops): Likewise.
(remove_path): Likewise.
(scale_bbs_frequencies): Likewise.
(loopify): Likewise.
(unloop): Likewise.
(fix_loop_placement): Likewise.
(loop_delete_branch_edge): Likewise.
(duplicate_loop_to_header_edge): Likewise.
(mfb_keep_just): Likewise.
(create_preheader): Likewise.
(force_single_succ_latches): Likewise.
(loop_split_edge_with): Likewise.
(create_loop_notes): Likewise.
* cfgrtl.c (rtl_split_block): Likewise.
(rtl_merge_blocks): Likewise.
(rtl_can_merge_blocks): Likewise.
(try_redirect_by_replacing_jump): Likewise.
(force_nonfallthru_and_redirect): Likewise.
(rtl_tidy_fallthru_edge): Likewise.
(commit_one_edge_insertion): Likewise.
(commit_edge_insertions): Likewise.
(commit_edge_insertions_watch_calls): Likewise.
(rtl_verify_flow_info_1): Likewise.
(rtl_verify_flow_info): Likewise.
(purge_dead_edges): Likewise.
(cfg_layout_redirect_edge_and_branch): Likewise.
(cfg_layout_can_merge_blocks_p): Likewise.
(rtl_flow_call_edges_add): Likewise.
* cse.c (cse_cc_succs): Likewise.
* df.c (hybrid_search): Likewise.
* dominance.c (calc_dfs_tree_nonrec): Likewise.
(calc_dfs_tree): Likewise.
(calc_idoms): Likewise.
(recount_dominator): Likewise.
* domwalk.c (walk_dominator_tree): Likewise.
* except.c (emit_to_new_bb_before): Likewise.
(connect_post_landing_pads): Likewise.
(sjlj_emit_function_enter): Likewise.
(sjlj_emit_function_exit): Likewise.
(finish_eh_generation): Likewise.
* final.c (compute_alignments): Likewise.
* flow.c (calculate_global_regs_live): Likewise.
(initialize_uninitialized_subregs): Likewise.
(init_propagate_block_info): Likewise.
* function.c (thread_prologue_and_epilogue_insns): Likewise.
* gcse.c (find_implicit_sets): Likewise.
(bypass_block): Likewise.
(bypass_conditional_jumps): Likewise.
(compute_pre_data): Likewise.
(insert_insn_end_bb): Likewise.
(insert_store): Likewise.
(remove_reachable_equiv_notes): Likewise.
* global.c (global_conflicts): Likewise.
(calculate_reg_pav): Likewise.
* graph.c (print_rtl_graph_with_bb): Likewise.
* ifcvt.c (mark_loop_exit_edges): Likewise.
(merge_if_block): Likewise.
(find_if_header): Likewise.
(block_jumps_and_fallthru_p): Likewise.
(find_if_block): Likewise.
(find_cond_trap): Likewise.
(block_has_only_trap): Likewise.
(find_if_case1): Likewise.
(find_if_case_2): Likewise.
* lambda-code.c (lambda_loopnest_to_gcc_loopnest): Likewise.
(perfect_nestify): Likewise.
* lcm.c (compute_antinout_edge): Likewise.
(compute_laterin): Likewise.
(compute_available): Likewise.
(compute_nearerout): Likewise.
* loop-doloop.c (doloop_modify): Likewise.
* loop-init.c (loop_optimizer_init): Likewise.
* loop-invariant.c (find_exits): Likewise.
* loop-iv.c (simplify_using_initial_values): Likewise.
(check_simple_exit): Likewise.
(find_simple_exit): Likewise.
* loop-unroll.c (peel_loop_completely): Likewise.
(unroll_loop_constant_iterations): Likewise.
(unroll_loop_runtime_iterations): Likewise.
* loop-unswitch.c (may_unswitch_on): Likewise.
(unswitch_loop): Likewise.
* modulo-sched.c (generate_prolog_epilog): Likewise.
(sms_schedule): Likewise.
* postreload-gcse.c (eliminate_partially_redundant_load):
Likewise.
* predict.c (can_predict_insn_p): Likewise.
(set_even_probabilities): Likewise.
(combine_predictions_for_bb): Likewise.
(predict_loops): Likewise.
(estimate_probability): Likewise.
(tree_predict_by_opcode): Likewise.
(tree_estimate_probability): Likewise.
(last_basic_block_p): Likewise.
(propagate_freq): Likewise.
(estimate_loops_at_level): Likewise.
(estimate_bb_frequencies): Likewise.
* profile.c (instrument_edges): Likewise.
(get_exec_counts): Likewise.
(compute_branch_probabilities): Likewise.
(branch_prob): Likewise.
* ra-build.c (live_in): Likewise.
* ra-rewrite.c (rewrite_program2): Likewise.
* ra.c (reg_alloc): Likewise.
* reg-stack.c (reg_to_stack): Likewise.
(convert_regs_entry): Likewise.
(compensate_edge): Likewise.
(convert_regs_1): Likewise,
(convert_regs_2): Likewise.
(convert_regs): Likewise.
* regrename.c (copyprop_hardreg_forward): Likewise.
* reload1.c (fixup_abnormal_edges): Likewise.
* sbitmap.c (sbitmap_intersection_of_succs): Likewise.
(sbitmap_insersection_of_preds): Likewise.
(sbitmap_union_of_succs): Likewise.
(sbitmap_union_of_preds): Likewise.
* sched-ebb.c (compute_jump_reg_dependencies): Likewise.
(fix_basic_block_boundaries): Likewise.
(sched_ebbs): Likewise.
* sched-rgn.c (build_control_flow): Likewise.
(find_rgns): Likewise.
* tracer.c (find_best_successor): Likewise.
(find_best_predecessor): Likewise.
(tail_duplicate): Likewise.
* tree-cfg.c (make_edges): Likewise.
(make_ctrl_stmt_edges): Likewise.
(make_goto_expr_edges): Likewise.
(tree_can_merge_blocks_p): Likewise.
(tree_merge_blocks): Likewise.
(cfg_remove_useless_stmts_bb): Likewise.
(remove_phi_nodes_and_edges_for_unreachable_block): Likewise.
(tree_block_forwards_to): Likewise.
(cleanup_control_expr_graph): Likewise.
(find_taken_edge): Likewise.
(dump_cfg_stats): Likewise.
(tree_cfg2vcg): Likewise.
(disband_implicit_edges): Likewise.
(tree_find_edge_insert_loc): Likewise.
(bsi_commit_edge_inserts): Likewise.
(tree_split_edge): Likewise.
(tree_verify_flow_info): Likewise.
(tree_make_forwarder_block): Likewise.
(tree_forwarder_block_p): Likewise.
(thread_jumps): Likewise.
(tree_try_redirect_by_replacing_jump): Likewise.
(tree_split_block): Likewise.
(add_phi_args_after_copy_bb): Likewise.
(rewrite_to_new_ssa_names_bb): Likewise.
(dump_function_to_file): Likewise.
(print_pred_bbs): Likewise.
(print_loop): Likewise.
(tree_flow_call_edges_add): Likewise.
(split_critical_edges): Likewise.
(execute_warn_function_return): Likewise.
(extract_true_false_edges_from_block): Likewise.
* tree-if-conv.c (tree_if_conversion): Likewise.
(if_convertable_bb_p): Likewise.
(find_phi_replacement_condition): Likewise.
(combine_blocks): Likewise.
* tree-into-ssa.c (compute_global_livein): Likewise.
(ssa_mark_phi_uses): Likewise.
(ssa_rewrite_initialize_block): Likewise.
(rewrite_add_phi_arguments): Likewise.
(ssa_rewrite_phi_arguments): Likewise.
(insert_phi_nodes_for): Likewise.
(rewrite_into_ssa): Likewise.
(rewrite_ssa_into_ssa): Likewise.
* tree-mudflap.c (mf_build_check_statement_for): Likewise.
* tree-outof-ssa.c (coalesce_abnormal_edges): Likewise.
(rewrite_trees): Likewise.
* tree-pretty-print.c (dump_bb_header): Likewise.
(dump_implicit_edges): Likewise.
* tree-sra.c (insert_edge_copies): Likewise.
(find_obviously_necessary_stmts): Likewise.
(remove_data_stmt): Likewise.
* tree-ssa-dom.c (thread_across_edge): Likewise.
(dom_opt_finalize_block): Likewise.
(single_incoming_edge_ignoring_loop_edges): Likewise.
(record_equivalences_from_incoming_edges): Likewise.
(cprop_into_successor_phis): Likewise.
* tree-ssa-live.c (live_worklist): Likewise.
(calculate_live_on_entry): Likewise.
(calculate_live_on_exit): Likewise.
* tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise.
(copy_loop_headers): Likewise.
* tree-ssa-loop-im.c (loop_commit_inserts): Likewise.
(fill_always_executed_in): Likewise.
* tree-ssa-loop-ivcanon.c (create_canonical_iv): Likewise.
* tree-ssa-loop-ivopts.c (find_interesting_uses): Likewise.
(compute_phi_arg_on_exit): Likewise.
* tree-ssa-loop-manip.c (add_exit_phis_edge): Likewise.
(get_loops_exit): Likewise.
(split_loop_exit_edge): Likewise.
(ip_normal_pos): Likewise.
* tree-ssa-loop-niter.c (simplify_using_initial_conditions):
Likewise.
* tree-ssa-phiopt.c (candidate_bb_for_phi_optimization): Likewise.
(replace_phi_with_stmt): Likewise.
(value_replacement): Likewise.
* tree-ssa-pre.c (compute_antic_aux): Likewise.
(insert_aux): Likewise.
(init_pre): Likewise.
* tree-ssa-propagate.c (simulate_stmt): Likewise.
(simulate_block): Likewise.
(ssa_prop_init): Likewise.
* tree-ssa-threadupdate.c (thread_block): Likewise.
(create_block_for_threading): Likewise.
(remove_last_stmt_and_useless_edges): Likewise.
* tree-ssa.c (verify_phi_args): Likewise.
(verify_ssa): Likewise.
* tree_tailcall.c (independent_of_stmt_p): Likewise.
(find_tail_calls): Likewise.
(eliminate_tail_call): Likewise.
(tree_optimize_tail_calls_1): Likewise.
* tree-vectorizer.c (vect_transform_loop): Likewise.
* var-tracking.c (prologue_stack_adjust): Likewise.
(vt_stack_adjustments): Likewise.
(vt_find_locations): Likewise.
* config/frv/frv.c (frv_ifcvt_modify_tests): Likewise.
* config/i386/i386.c (ix86_pad_returns): Likewise.
* config/ia64/ia64.c (ia64_expand_prologue): Likewise.
* config/rs6000/rs6000.c (rs6000_emit_prologue): Likewise.
Co-Authored-By: Andrew Pinski <pinskia@physics.uc.edu>
Co-Authored-By: Steven Bosscher <stevenb@suse.de>
From-SVN: r88222
2004-09-28 09:59:54 +02:00
|
|
|
FOR_EACH_EDGE (e, ei, bb->preds)
|
2004-07-19 21:01:55 +02:00
|
|
|
{
|
|
|
|
/* A loop back edge can be identified by the destination of
|
|
|
|
the edge dominating the source of the edge. */
|
|
|
|
if (dominated_by_p (CDI_DOMINATORS, e->src, e->dest))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
/* If we have already seen a non-loop edge, then we must have
|
|
|
|
multiple incoming non-loop edges and thus we return NULL. */
|
|
|
|
if (retval)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
/* This is the first non-loop incoming edge we have found. Record
|
|
|
|
it. */
|
|
|
|
retval = e;
|
|
|
|
}
|
|
|
|
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
/* Record any equivalences created by the incoming edge to BB. If BB
|
|
|
|
has more than one incoming edge, then no equivalence is created. */
|
|
|
|
|
|
|
|
static void
|
2004-10-30 02:06:22 +02:00
|
|
|
record_equivalences_from_incoming_edge (basic_block bb)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2004-10-30 02:06:22 +02:00
|
|
|
edge e;
|
2004-05-13 08:41:07 +02:00
|
|
|
basic_block parent;
|
|
|
|
|
alias.c, [...]: Fix comment typos.
* alias.c, c-common.h, c-incpath.c, c-incpath.h, expr.c,
fold-const.c, gimplify.c, params.h, tree-data-ref.c,
tree-if-conv.c, tree-nested.c, tree-outof-ssa.c,
tree-ssa-dom.c, tree-vectorizer.c, tree.def, config/darwin.c,
config/freebsd-spec.h, config/arm/arm.h,
config/h8300/h8300.md, config/i386/i386.md,
config/i386/predicates.md, config/i386/sse.md,
config/ia64/ia64.c, config/ip2k/ip2k.c, config/s390/s390.c,
config/vax/vax.md: Fix comment typos. Follow spelling
conventions.
From-SVN: r94112
2005-01-23 16:05:49 +01:00
|
|
|
/* If our parent block ended with a control statement, then we may be
|
2004-05-13 08:41:07 +02:00
|
|
|
able to record some equivalences based on which outgoing edge from
|
|
|
|
the parent was followed. */
|
|
|
|
parent = get_immediate_dominator (CDI_DOMINATORS, bb);
|
|
|
|
|
2004-10-30 02:06:22 +02:00
|
|
|
e = single_incoming_edge_ignoring_loop_edges (bb);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2004-10-30 02:06:22 +02:00
|
|
|
/* If we had a single incoming edge from our parent block, then enter
|
|
|
|
any data associated with the edge into our tables. */
|
|
|
|
if (e && e->src == parent)
|
2015-07-14 09:27:04 +02:00
|
|
|
record_temporary_equivalences (e);
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Dump SSA statistics on FILE. */
|
|
|
|
|
|
|
|
void
|
|
|
|
dump_dominator_optimization_stats (FILE *file)
|
|
|
|
{
|
|
|
|
fprintf (file, "Total number of statements: %6ld\n\n",
|
|
|
|
opt_stats.num_stmts);
|
|
|
|
fprintf (file, "Exprs considered for dominator optimizations: %6ld\n",
|
|
|
|
opt_stats.num_exprs_considered);
|
|
|
|
|
|
|
|
fprintf (file, "\nHash table statistics:\n");
|
|
|
|
|
|
|
|
fprintf (file, " avail_exprs: ");
|
Remove a layer of indirection from hash_table
gcc/
* hash-table.h: Remove a layer of indirection from hash_table so that
it contains the hash table's data instead of a pointer to the data.
* alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c,
config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c,
config/mips/mips.c, config/sol2.c, coverage.c, cselib.c,
data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c,
fold-const.c, gcse.c, ggc-common.c,
gimple-ssa-strength-reduction.c, gimplify.c,
graphite-clast-to-gimple.c, graphite-dependences.c,
graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c,
ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c,
loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c,
lto-streamer.c, lto-streamer.h, passes.c, plugin.c,
postreload-gcse.c, sese.c, statistics.c, store-motion.c,
trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c,
tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c,
tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c,
tree-ssa-live.c, tree-ssa-loop-im.c,
tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-tail-merge.c,
tree-ssa-threadupdate.c, tree-ssa-uncprop.c,
tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c,
tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c,
vtable-verify.c, vtable-verify.h: Adjust.
gcc/c/
* c-decl.c: Adjust.
gcc/cp/
* class.c, semantics.c, tree.c, vtable-class-hierarchy.c:
Adjust.
gcc/java/
* jcf-io.c: Adjust.
gcc/lto/
* lto.c: Adjust.
gcc/objc/
* objc-act.c: Adjust.
From-SVN: r211936
2014-06-24 15:21:35 +02:00
|
|
|
htab_statistics (file, *avail_exprs);
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Dump SSA statistics on stderr. */
|
|
|
|
|
tree-vrp.c (debug_value_range, [...]): Annotate with DEBUG_FUNCTION.
* tree-vrp.c (debug_value_range, debug_all_value_ranges,
debug_asserts_for, debug_all_asserts): Annotate with DEBUG_FUNCTION.
* tree-into-ssa.c (debug_decl_set, debug_defs_stack, debug_currdefs,
debug_tree_ssa, debug_tree_ssa_stats, debug_def_blocks,
debug_names_replaced_by, debug_update_ssa): Likewise.
* sbitmap.c (debug_sbitmap): Likewise.
* genrecog.c (debug_decision, debug_decision_list): Likewise.
* tree-pretty-print.c (debug_generic_expr, debug_generic_stmt,
debug_tree_chain): Likewise.
* tree-loop-distribution.c (debug_rdg_partitions): Likewise.
* cgraph.c (debug_cgraph_node, debug_cgraph): Likewise.
* optabs.c (debug_optab_libfuncs): Likewise.
(verify_loop_closed_ssa): Likewise.
* value-prof.c (verify_histograms): Likewise.
* reload.c (debug_reload_to_stream, debug_reload): Likewise.
* bitmap.c (debug_bitmap_file, debug_bitmap, bitmap_print): Likewise.
* cfghooks.c (verify_flow_info): Likewise.
* fold-const.c (debug_fold_checksum): Likewise.
* omp-low.c (debug_omp_region, debug_all_omp_regions): Likewise.
* cfg.c (debug_regset, debug_flow_info, debug_bb, debug_bb_n):
Likewise.
* omega.c (debug_omega_problem): Likewise.
* cgraphunit.c (verify_cgraph_node, verify_cgraph): Likewise.
* tree-ssa-ccp.c (debug_lattice_value): Likewise.
* dominance.c (verify_dominators, debug_dominance_info,
debug_dominance_tree): Likewise.
* df-core.c (df_insn_uid_debug, df_insn_debug, df_insn_debug_regno,
* df_regno_debug, df_ref_debug,
debug_df_insn, debug_df_reg, debug_df_regno, debug_df_ref,
debug_df_defno, debug_df_useno, debug_df_chain): Likewise.
* tree-ssa-dom.c (debug_dominator_optimization_stats): Likewise.
* sel-sched.c (debug_state): Likewise.
* tree-ssa-alias.c (debug_alias_info, debug_points_to_info_for): Likewise.
* cfganal.c (print_edge_list, verify_edge_list): Likewise.
* dwarf2out.c (debug_dwarf_die, debug_dwarf): Likewise.
* tree-eh.c (verify_eh_edges, verify_eh_dispatch_edge): Likewise.
* gimple-pretty-print.c (debug_gimple_stmt, debug_gimple_seq): Likewise.
* c-pretty-print.c (debug_c_tree): Likewise.
* sel-sched-dump.c (debug_insn_rtx, debug_vinsn, debug_expr, debug_insn
debug_av_set, debug_lv_set, debug_ilist, debug_blist, debug_insn_vector,
debug_hard_reg_set, debug_mem_addr_value): Likewise.
* ebitmap.c (debug_ebitmap): Likewise.
* function.c (debug_find_var_in_block_tree): Likewise.
* print-rtl.c (debug_rtx): Likewise.
(debug_rtx_count): Likewise.
(debug_rtx_list, debug_rtx_range, debug_rtx_find): Likewise.
* stor-layout.c (debug_rli): Likewise.
* ipa.c (debug_cgraph_node_set, debug_varpool_node_set): Likewise.
* tree-data-ref.c (debug_data_references, debug_data_dependence_relations,
debug_data_reference, debug_data_dependence_relation, debug_rdg_vertex,
debug_rdg_component, debug_rdg): Likewise.
* tree-affine.c (debug_aff): Likewise.
* tree-dfa.c (debug_referenced_vars, debug_variable, debug_dfa_stats): Likewise.
* except.c (debug_eh_tree, verify_eh_tree): Likewise.
* emit-rtl.c (verify_rtl_sharing): Likewise.
* tree-ssa-pre.c (debug_pre_expr, debug_bitmap_set,
debug_value_expressions): Likewise.
* tree-ssa-live.c (debug_scope_block, debug_scope_blocks): Likewise.
* sese.c (debug_rename_map, debug_ivtype_map): Likewise.
* print-tree.c (debug_tree, debug_vec_tree): Likewise.
* cfglayout.c (verify_insn_chain): Likewise.
* graphite-clast-to-gimple.c (debug_clast_name_indexes,
debug_clast_stmt, debug_generated_program): Likewise.
* ggc-page.c (debug_print_page_list): Likewise.
* tree-ssa-ter.c (debug_ter): Likewise.
* graphite-dependences.c (debug_pddr): Likewise.
* sched-deps.c (debug_ds): Likewise.
* tree-ssa.c (verify_ssa): Likewise.
* graphite-poly.c (debug_scattering_function, debug_iteration_domain,
debug_scattering_functions, debug_iteration_domains, debug_pdr,
debug_pdrs, debug_pbb_domain, debug_pbb, debug_scop_context, debug_scop,
debug_cloog, debug_scop_params, debug_lst): Likewise.
* tree-inline.c (debug_find_tree): Likewise.
* graphite-ppl.c (debug_ppl_linear_expr, debug_ppl_polyhedron_matrix,
debug_ppl_powerset_matrix): Likewise.
* var-tracking.c (debug_dv): Likewise.
* system.h (DEBUG_FUNCTION, DEBUG_VARIABLE): Define.
* cfgloop.c (verify_loop_structure): Likewise.
* plugin.c (dump_active_plugins, debug_active_plugins): Likewise.
* c-common.c (verify_sequence_points): Likewise.
* sched-rgn.c (debug_regions, debug_region, debug_candidate,
debug_candidates, debug_rgn_dependencies): Likewise.
* tree-ssa-structalias.c (debug_constraint, debug_constraints,
* debug_constraint_graph, debug_solution_for_var,
debug_sa_points_to_info): Likewise.
* sched-vis.c (debug_insn_slim, debug_bb_slim, debug_bb_n_slim):
Likewie.
* tree-cfg.c (debug_cfg_stats, verify_stmts, debug_function,
debug_loops, debug_loop, debug_loop_num): Likewise.
* passes.c (debug_pass): Likewise.
(dump_properties): Likewise; add cfglayout property.
(debug_properties): Likewise.
* tree-ssa-reassoc.c (debug_ops_vector): Likewise.
* varpool.c (debug_varpool): Likewise.
* regcprop.c (debug_value_data): Likewise.
* tree-ssa-operands.c (verify_imm_links, debug_immediate_uses,
debug_immediate_uses_for): Likewise.
From-SVN: r160036
2010-05-29 22:31:45 +02:00
|
|
|
DEBUG_FUNCTION void
|
2004-05-13 08:41:07 +02:00
|
|
|
debug_dominator_optimization_stats (void)
|
|
|
|
{
|
|
|
|
dump_dominator_optimization_stats (stderr);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-04-15 20:51:49 +02:00
|
|
|
/* Dump statistics for the hash table HTAB. */
|
2004-06-24 17:59:52 +02:00
|
|
|
|
2015-04-15 20:51:49 +02:00
|
|
|
static void
|
|
|
|
htab_statistics (FILE *file, const hash_table<expr_elt_hasher> &htab)
|
|
|
|
{
|
|
|
|
fprintf (file, "size %ld, %ld elements, %f collision/search ratio\n",
|
|
|
|
(long) htab.size (),
|
|
|
|
(long) htab.elements (),
|
|
|
|
htab.collisions ());
|
|
|
|
}
|
2004-06-24 17:59:52 +02:00
|
|
|
|
|
|
|
|
2015-04-15 20:51:49 +02:00
|
|
|
/* Enter condition equivalence into the expression hash table.
|
|
|
|
This indicates that a conditional expression has a known
|
|
|
|
boolean value. */
|
2004-10-30 02:06:22 +02:00
|
|
|
|
2015-04-15 20:51:49 +02:00
|
|
|
static void
|
|
|
|
record_cond (cond_equivalence *p)
|
|
|
|
{
|
2015-09-15 19:03:49 +02:00
|
|
|
class expr_hash_elt *element = new expr_hash_elt (&p->cond, p->value);
|
2015-04-15 20:51:49 +02:00
|
|
|
expr_hash_elt **slot;
|
2008-07-28 16:33:56 +02:00
|
|
|
|
2015-09-15 19:03:49 +02:00
|
|
|
slot = avail_exprs->find_slot_with_hash (element, element->hash (), INSERT);
|
2015-04-15 20:51:49 +02:00
|
|
|
if (*slot == NULL)
|
|
|
|
{
|
|
|
|
*slot = element;
|
|
|
|
|
2015-09-15 19:03:49 +02:00
|
|
|
avail_exprs_stack->record_expr (element, NULL, '1');
|
2015-04-15 20:51:49 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
free_expr_hash_elt (element);
|
2004-06-24 17:59:52 +02:00
|
|
|
}
|
|
|
|
|
2014-07-14 12:50:46 +02:00
|
|
|
/* Return the loop depth of the basic block of the defining statement of X.
|
|
|
|
This number should not be treated as absolutely correct because the loop
|
|
|
|
information may not be completely up-to-date when dom runs. However, it
|
|
|
|
will be relatively correct, and as more passes are taught to keep loop info
|
|
|
|
up to date, the result will become more and more accurate. */
|
|
|
|
|
|
|
|
static int
|
|
|
|
loop_depth_of_name (tree x)
|
|
|
|
{
|
|
|
|
gimple defstmt;
|
|
|
|
basic_block defbb;
|
|
|
|
|
|
|
|
/* If it's not an SSA_NAME, we have no clue where the definition is. */
|
|
|
|
if (TREE_CODE (x) != SSA_NAME)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
/* Otherwise return the loop depth of the defining statement's bb.
|
|
|
|
Note that there may not actually be a bb for this statement, if the
|
|
|
|
ssa_name is live on entry. */
|
|
|
|
defstmt = SSA_NAME_DEF_STMT (x);
|
|
|
|
defbb = gimple_bb (defstmt);
|
|
|
|
if (!defbb)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
return bb_loop_depth (defbb);
|
|
|
|
}
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
/* Similarly, but assume that X and Y are the two operands of an EQ_EXPR.
|
|
|
|
This constrains the cases in which we may treat this as assignment. */
|
|
|
|
|
|
|
|
static void
|
2004-09-17 23:16:07 +02:00
|
|
|
record_equality (tree x, tree y)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
|
|
|
tree prev_x = NULL, prev_y = NULL;
|
|
|
|
|
2015-04-27 14:46:58 +02:00
|
|
|
if (tree_swap_operands_p (x, y, false))
|
|
|
|
std::swap (x, y);
|
|
|
|
|
2015-04-29 01:18:27 +02:00
|
|
|
/* Most of the time tree_swap_operands_p does what we want. But there
|
|
|
|
are cases where we know one operand is better for copy propagation than
|
2015-04-28 06:01:28 +02:00
|
|
|
the other. Given no other code cares about ordering of equality
|
|
|
|
comparison operators for that purpose, we just handle the special cases
|
|
|
|
here. */
|
|
|
|
if (TREE_CODE (x) == SSA_NAME && TREE_CODE (y) == SSA_NAME)
|
|
|
|
{
|
|
|
|
/* If one operand is a single use operand, then make it
|
|
|
|
X. This will preserve its single use properly and if this
|
|
|
|
conditional is eliminated, the computation of X can be
|
|
|
|
eliminated as well. */
|
|
|
|
if (has_single_use (y) && ! has_single_use (x))
|
|
|
|
std::swap (x, y);
|
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
if (TREE_CODE (x) == SSA_NAME)
|
2004-09-23 22:15:30 +02:00
|
|
|
prev_x = SSA_NAME_VALUE (x);
|
2004-05-13 08:41:07 +02:00
|
|
|
if (TREE_CODE (y) == SSA_NAME)
|
2004-09-23 22:15:30 +02:00
|
|
|
prev_y = SSA_NAME_VALUE (y);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2004-10-23 20:00:01 +02:00
|
|
|
/* If one of the previous values is invariant, or invariant in more loops
|
|
|
|
(by depth), then use that.
|
2004-05-13 08:41:07 +02:00
|
|
|
Otherwise it doesn't matter which value we choose, just so
|
|
|
|
long as we canonicalize on one value. */
|
2008-03-21 00:14:35 +01:00
|
|
|
if (is_gimple_min_invariant (y))
|
2004-05-13 08:41:07 +02:00
|
|
|
;
|
2014-07-14 12:50:46 +02:00
|
|
|
else if (is_gimple_min_invariant (x)
|
|
|
|
/* ??? When threading over backedges the following is important
|
|
|
|
for correctness. See PR61757. */
|
2015-04-27 14:46:58 +02:00
|
|
|
|| (loop_depth_of_name (x) < loop_depth_of_name (y)))
|
2004-05-13 08:41:07 +02:00
|
|
|
prev_x = x, x = y, y = prev_x, prev_x = prev_y;
|
2008-03-21 00:14:35 +01:00
|
|
|
else if (prev_x && is_gimple_min_invariant (prev_x))
|
2004-05-13 08:41:07 +02:00
|
|
|
x = y, y = prev_x, prev_x = prev_y;
|
2008-07-08 18:11:06 +02:00
|
|
|
else if (prev_y)
|
2004-05-13 08:41:07 +02:00
|
|
|
y = prev_y;
|
|
|
|
|
|
|
|
/* After the swapping, we must have one SSA_NAME. */
|
|
|
|
if (TREE_CODE (x) != SSA_NAME)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* For IEEE, -0.0 == 0.0, so we don't necessarily know the sign of a
|
|
|
|
variable compared against zero. If we're honoring signed zeros,
|
|
|
|
then we cannot record this value unless we know that the value is
|
c-common.c, [...]: Fix comment typos.
* c-common.c, calls.c, cfgcleanup.c, cgraph.c, cgraphunit.c,
ddg.c, ddg.h, df.c, df.h, except.c, expr.c, flags.h,
fold-const.c, gcc.c, gimplify.c, haifa-sched.c,
modulo-sched.c, tree-inline.c, tree-into-ssa.c, tree-nested.c,
tree-nrv.c, tree-ssa-ccp.c, tree-ssa-dom.c, tree-ssa-live.c,
tree-ssa-loop.c, tree-ssa-pre.c, tree-tailcall.c, tree.h: Fix
comment typos. Follow spelling conventions.
From-SVN: r82439
2004-05-30 09:12:58 +02:00
|
|
|
nonzero. */
|
real.h (HONOR_SNANS, [...]): Replace macros with 3 overloaded declarations.
2014-12-12 Marc Glisse <marc.glisse@inria.fr>
* real.h (HONOR_SNANS, HONOR_INFINITIES, HONOR_SIGNED_ZEROS,
HONOR_SIGN_DEPENDENT_ROUNDING): Replace macros with 3 overloaded
declarations.
* real.c (HONOR_NANS): Fix indentation.
(HONOR_SNANS, HONOR_INFINITIES, HONOR_SIGNED_ZEROS,
HONOR_SIGN_DEPENDENT_ROUNDING): Define three overloads.
* builtins.c (fold_builtin_cproj, fold_builtin_signbit,
fold_builtin_fmin_fmax, fold_builtin_classify): Simplify argument
of HONOR_*.
* fold-const.c (operand_equal_p, fold_comparison, fold_binary_loc):
Likewise.
* gimple-fold.c (gimple_val_nonnegative_real_p): Likewise.
* ifcvt.c (noce_try_move, noce_try_minmax, noce_try_abs): Likewise.
* omp-low.c (omp_reduction_init): Likewise.
* rtlanal.c (may_trap_p_1): Likewise.
* simplify-rtx.c (simplify_const_relational_operation): Likewise.
* tree-ssa-dom.c (record_equality, record_edge_info): Likewise.
* tree-ssa-phiopt.c (value_replacement, abs_replacement): Likewise.
* tree-ssa-reassoc.c (eliminate_using_constants): Likewise.
* tree-ssa-uncprop.c (associate_equivalences_with_edges): Likewise.
From-SVN: r218663
2014-12-12 11:46:00 +01:00
|
|
|
if (HONOR_SIGNED_ZEROS (x)
|
2004-05-13 08:41:07 +02:00
|
|
|
&& (TREE_CODE (y) != REAL_CST
|
|
|
|
|| REAL_VALUES_EQUAL (dconst0, TREE_REAL_CST (y))))
|
|
|
|
return;
|
|
|
|
|
2015-04-17 21:24:17 +02:00
|
|
|
const_and_copies->record_const_or_copy (x, y, prev_x);
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2005-02-26 08:55:28 +01:00
|
|
|
/* Returns true when STMT is a simple iv increment. It detects the
|
|
|
|
following situation:
|
2009-11-25 11:55:54 +01:00
|
|
|
|
2005-02-26 08:55:28 +01:00
|
|
|
i_1 = phi (..., i_2)
|
|
|
|
i_2 = i_1 +/- ... */
|
|
|
|
|
2011-09-07 13:28:39 +02:00
|
|
|
bool
|
2008-07-28 16:33:56 +02:00
|
|
|
simple_iv_increment_p (gimple stmt)
|
2005-02-26 08:55:28 +01:00
|
|
|
{
|
2011-09-07 13:28:39 +02:00
|
|
|
enum tree_code code;
|
2008-07-28 16:33:56 +02:00
|
|
|
tree lhs, preinc;
|
|
|
|
gimple phi;
|
|
|
|
size_t i;
|
2005-02-26 08:55:28 +01:00
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
if (gimple_code (stmt) != GIMPLE_ASSIGN)
|
2005-02-26 08:55:28 +01:00
|
|
|
return false;
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
lhs = gimple_assign_lhs (stmt);
|
2005-02-26 08:55:28 +01:00
|
|
|
if (TREE_CODE (lhs) != SSA_NAME)
|
|
|
|
return false;
|
|
|
|
|
2011-09-07 13:28:39 +02:00
|
|
|
code = gimple_assign_rhs_code (stmt);
|
|
|
|
if (code != PLUS_EXPR
|
|
|
|
&& code != MINUS_EXPR
|
|
|
|
&& code != POINTER_PLUS_EXPR)
|
2005-02-26 08:55:28 +01:00
|
|
|
return false;
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
preinc = gimple_assign_rhs1 (stmt);
|
2005-02-26 08:55:28 +01:00
|
|
|
if (TREE_CODE (preinc) != SSA_NAME)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
phi = SSA_NAME_DEF_STMT (preinc);
|
2008-07-28 16:33:56 +02:00
|
|
|
if (gimple_code (phi) != GIMPLE_PHI)
|
2005-02-26 08:55:28 +01:00
|
|
|
return false;
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
for (i = 0; i < gimple_phi_num_args (phi); i++)
|
|
|
|
if (gimple_phi_arg_def (phi, i) == lhs)
|
2005-02-26 08:55:28 +01:00
|
|
|
return true;
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2004-06-29 03:53:04 +02:00
|
|
|
/* CONST_AND_COPIES is a table which maps an SSA_NAME to the current
|
2009-11-25 11:55:54 +01:00
|
|
|
known value for that SSA_NAME (or NULL if no value is known).
|
2004-06-29 03:53:04 +02:00
|
|
|
|
2006-02-17 05:15:32 +01:00
|
|
|
Propagate values from CONST_AND_COPIES into the PHI nodes of the
|
|
|
|
successors of BB. */
|
2004-06-29 03:53:04 +02:00
|
|
|
|
|
|
|
static void
|
2006-02-17 05:15:32 +01:00
|
|
|
cprop_into_successor_phis (basic_block bb)
|
2004-06-29 03:53:04 +02:00
|
|
|
{
|
|
|
|
edge e;
|
backport: basic-block.h: Include vec.h, errors.h.
2004-09-24 Ben Elliston <bje@au.ibm.com>
Steven Bosscher <stevenb@suse.de>
Andrew Pinski <pinskia@physics.uc.edu>
Merge from edge-vector-branch:
* basic-block.h: Include vec.h, errors.h. Instantiate a VEC(edge).
(struct edge_def): Remove pred_next, succ_next members.
(struct basic_block_def): Remove pred, succ members. Add preds
and succs members of type VEC(edge).
(FALLTHRU_EDGE): Redefine using EDGE_SUCC.
(BRANCH_EDGE): Likewise.
(EDGE_CRITICAL_P): Redefine using EDGE_COUNT.
(EDGE_COUNT, EDGE_I, EDGE_PRED, EDGE_SUCC): New.
(edge_iterator): New.
(ei_start, ei_last, ei_end_p, ei_one_before_end_p): New.
(ei_next, ei_prev, ei_edge, ei_safe_edge): Likewise.
(FOR_EACH_EDGE): New.
* bb-reorder.c (find_traces): Use FOR_EACH_EDGE and EDGE_* macros
where applicable.
(rotate_loop): Likewise.
(find_traces_1_route): Likewise.
(bb_to_key): Likewise.
(connect_traces): Likewise.
(copy_bb_p): Likewise.
(find_rarely_executed_basic_blocks_and_crossing_edges): Likewise.
(add_labels_and_missing_jumps): Likewise.
(fix_up_fall_thru_edges): Likewise.
(find_jump_block): Likewise.
(fix_crossing_conditional_branches): Likewise.
(fix_crossing_unconditional_branches): Likewise.
(add_reg_crossing_jump_notes): Likewise.
* bt-load.c (augment_live_range): Likewise.
* cfg.c (clear_edges): Likewise.
(unchecked_make_edge): Likewise.
(cached_make_edge): Likewise.
(make_single_succ_edge): Likewise.
(remove_edge): Likewise.
(redirect_edge_succ_nodup): Likewise.
(check_bb_profile): Likewise.
(dump_flow_info): Likewise.
(alloc_aux_for_edges): Likewise.
(clear_aux_for_edges): Likewise.
(dump_cfg_bb_info): Likewise.
* cfganal.c (forwarder_block_p): Likewise.
(can_fallthru): Likewise.
(could_fall_through): Likewise.
(mark_dfs_back_edges): Likewise.
(set_edge_can_fallthru_flag): Likewise.
(find_unreachable_blocks): Likewise.
(create_edge_list): Likewise.
(verify_edge_list): Likewise.
(add_noreturn_fake_exit_edges): Likewise.
(connect_infinite_loops_to_exit): Likewise.
(flow_reverse_top_sort_order_compute): Likewise.
(flow_depth_first_order_compute): Likewise.
(flow_preorder_transversal_compute): Likewise.
(flow_dfs_compute_reverse_execute): Likewise.
(dfs_enumerate_from): Likewise.
(compute_dominance_frontiers_1): Likewise.
* cfgbuild.c (make_edges): Likewise.
(compute_outgoing_frequencies): Likewise.
(find_many_sub_basic_blocks): Likewise.
(find_sub_basic_blocks): Likewise.
* cfgcleanup.c (try_simplify_condjump): Likewise.
(thread_jump): Likewise.
(try_forward_edges): Likewise.
(merge_blocks_move): Likewise.
(outgoing_edges_match): Likewise.
(try_crossjump_to_edge): Likewise.
(try_crossjump_bb): Likewise.
(try_optimize_cfg): Likewise.
(merge_seq_blocks): Likewise.
* cfgexpand.c (expand_gimple_tailcall): Likewise.
(expand_gimple_basic_block): Likewise.
(construct_init_block): Likewise.
(construct_exit_block): Likewise.
* cfghooks.c (verify_flow_info): Likewise.
(dump_bb): Likewise.
(delete_basic_block): Likewise.
(split_edge): Likewise.
(merge_blocks): Likewise.
(make_forwarder_block): Likewise.
(tidy_fallthru_edges): Likewise.
(can_duplicate_block_p): Likewise.
(duplicate_block): Likewise.
* cfglayout.c (fixup_reorder_chain): Likewise.
(fixup_fallthru_exit_predecessor): Likewise.
(can_copy_bbs_p): Likewise.
(copy_bbs): Likewise.
* cfgloop.c (flow_loops_cfg_dump): Likewise.
(flow_loop_entry_edges_find): Likewise.
(flow_loop_exit_edges_find): Likewise.
(flow_loop_nodes_find): Likewise.
(mark_single_exit_loops): Likewise.
(flow_loop_pre_header_scan): Likewise.
(flow_loop_pre_header_find): Likewise.
(update_latch_info): Likewise.
(canonicalize_loop_headers): Likewise.
(flow_loops_find): Likewise.
(get_loop_body_in_bfs_order): Likewise.
(get_loop_exit_edges): Likewise.
(num_loop_branches): Likewise.
(verify_loop_structure): Likewise.
(loop_latch_edge): Likewise.
(loop_preheader_edge): Likewise.
* cfgloopanal.c (mark_irreducible_loops): Likewise.
(expected_loop_iterations): Likewise.
* cfgloopmanip.c (remove_bbs): Likewise.
(fix_bb_placement): Likewise.
(fix_irreducible_loops): Likewise.
(remove_path): Likewise.
(scale_bbs_frequencies): Likewise.
(loopify): Likewise.
(unloop): Likewise.
(fix_loop_placement): Likewise.
(loop_delete_branch_edge): Likewise.
(duplicate_loop_to_header_edge): Likewise.
(mfb_keep_just): Likewise.
(create_preheader): Likewise.
(force_single_succ_latches): Likewise.
(loop_split_edge_with): Likewise.
(create_loop_notes): Likewise.
* cfgrtl.c (rtl_split_block): Likewise.
(rtl_merge_blocks): Likewise.
(rtl_can_merge_blocks): Likewise.
(try_redirect_by_replacing_jump): Likewise.
(force_nonfallthru_and_redirect): Likewise.
(rtl_tidy_fallthru_edge): Likewise.
(commit_one_edge_insertion): Likewise.
(commit_edge_insertions): Likewise.
(commit_edge_insertions_watch_calls): Likewise.
(rtl_verify_flow_info_1): Likewise.
(rtl_verify_flow_info): Likewise.
(purge_dead_edges): Likewise.
(cfg_layout_redirect_edge_and_branch): Likewise.
(cfg_layout_can_merge_blocks_p): Likewise.
(rtl_flow_call_edges_add): Likewise.
* cse.c (cse_cc_succs): Likewise.
* df.c (hybrid_search): Likewise.
* dominance.c (calc_dfs_tree_nonrec): Likewise.
(calc_dfs_tree): Likewise.
(calc_idoms): Likewise.
(recount_dominator): Likewise.
* domwalk.c (walk_dominator_tree): Likewise.
* except.c (emit_to_new_bb_before): Likewise.
(connect_post_landing_pads): Likewise.
(sjlj_emit_function_enter): Likewise.
(sjlj_emit_function_exit): Likewise.
(finish_eh_generation): Likewise.
* final.c (compute_alignments): Likewise.
* flow.c (calculate_global_regs_live): Likewise.
(initialize_uninitialized_subregs): Likewise.
(init_propagate_block_info): Likewise.
* function.c (thread_prologue_and_epilogue_insns): Likewise.
* gcse.c (find_implicit_sets): Likewise.
(bypass_block): Likewise.
(bypass_conditional_jumps): Likewise.
(compute_pre_data): Likewise.
(insert_insn_end_bb): Likewise.
(insert_store): Likewise.
(remove_reachable_equiv_notes): Likewise.
* global.c (global_conflicts): Likewise.
(calculate_reg_pav): Likewise.
* graph.c (print_rtl_graph_with_bb): Likewise.
* ifcvt.c (mark_loop_exit_edges): Likewise.
(merge_if_block): Likewise.
(find_if_header): Likewise.
(block_jumps_and_fallthru_p): Likewise.
(find_if_block): Likewise.
(find_cond_trap): Likewise.
(block_has_only_trap): Likewise.
(find_if_case1): Likewise.
(find_if_case_2): Likewise.
* lambda-code.c (lambda_loopnest_to_gcc_loopnest): Likewise.
(perfect_nestify): Likewise.
* lcm.c (compute_antinout_edge): Likewise.
(compute_laterin): Likewise.
(compute_available): Likewise.
(compute_nearerout): Likewise.
* loop-doloop.c (doloop_modify): Likewise.
* loop-init.c (loop_optimizer_init): Likewise.
* loop-invariant.c (find_exits): Likewise.
* loop-iv.c (simplify_using_initial_values): Likewise.
(check_simple_exit): Likewise.
(find_simple_exit): Likewise.
* loop-unroll.c (peel_loop_completely): Likewise.
(unroll_loop_constant_iterations): Likewise.
(unroll_loop_runtime_iterations): Likewise.
* loop-unswitch.c (may_unswitch_on): Likewise.
(unswitch_loop): Likewise.
* modulo-sched.c (generate_prolog_epilog): Likewise.
(sms_schedule): Likewise.
* postreload-gcse.c (eliminate_partially_redundant_load):
Likewise.
* predict.c (can_predict_insn_p): Likewise.
(set_even_probabilities): Likewise.
(combine_predictions_for_bb): Likewise.
(predict_loops): Likewise.
(estimate_probability): Likewise.
(tree_predict_by_opcode): Likewise.
(tree_estimate_probability): Likewise.
(last_basic_block_p): Likewise.
(propagate_freq): Likewise.
(estimate_loops_at_level): Likewise.
(estimate_bb_frequencies): Likewise.
* profile.c (instrument_edges): Likewise.
(get_exec_counts): Likewise.
(compute_branch_probabilities): Likewise.
(branch_prob): Likewise.
* ra-build.c (live_in): Likewise.
* ra-rewrite.c (rewrite_program2): Likewise.
* ra.c (reg_alloc): Likewise.
* reg-stack.c (reg_to_stack): Likewise.
(convert_regs_entry): Likewise.
(compensate_edge): Likewise.
(convert_regs_1): Likewise,
(convert_regs_2): Likewise.
(convert_regs): Likewise.
* regrename.c (copyprop_hardreg_forward): Likewise.
* reload1.c (fixup_abnormal_edges): Likewise.
* sbitmap.c (sbitmap_intersection_of_succs): Likewise.
(sbitmap_insersection_of_preds): Likewise.
(sbitmap_union_of_succs): Likewise.
(sbitmap_union_of_preds): Likewise.
* sched-ebb.c (compute_jump_reg_dependencies): Likewise.
(fix_basic_block_boundaries): Likewise.
(sched_ebbs): Likewise.
* sched-rgn.c (build_control_flow): Likewise.
(find_rgns): Likewise.
* tracer.c (find_best_successor): Likewise.
(find_best_predecessor): Likewise.
(tail_duplicate): Likewise.
* tree-cfg.c (make_edges): Likewise.
(make_ctrl_stmt_edges): Likewise.
(make_goto_expr_edges): Likewise.
(tree_can_merge_blocks_p): Likewise.
(tree_merge_blocks): Likewise.
(cfg_remove_useless_stmts_bb): Likewise.
(remove_phi_nodes_and_edges_for_unreachable_block): Likewise.
(tree_block_forwards_to): Likewise.
(cleanup_control_expr_graph): Likewise.
(find_taken_edge): Likewise.
(dump_cfg_stats): Likewise.
(tree_cfg2vcg): Likewise.
(disband_implicit_edges): Likewise.
(tree_find_edge_insert_loc): Likewise.
(bsi_commit_edge_inserts): Likewise.
(tree_split_edge): Likewise.
(tree_verify_flow_info): Likewise.
(tree_make_forwarder_block): Likewise.
(tree_forwarder_block_p): Likewise.
(thread_jumps): Likewise.
(tree_try_redirect_by_replacing_jump): Likewise.
(tree_split_block): Likewise.
(add_phi_args_after_copy_bb): Likewise.
(rewrite_to_new_ssa_names_bb): Likewise.
(dump_function_to_file): Likewise.
(print_pred_bbs): Likewise.
(print_loop): Likewise.
(tree_flow_call_edges_add): Likewise.
(split_critical_edges): Likewise.
(execute_warn_function_return): Likewise.
(extract_true_false_edges_from_block): Likewise.
* tree-if-conv.c (tree_if_conversion): Likewise.
(if_convertable_bb_p): Likewise.
(find_phi_replacement_condition): Likewise.
(combine_blocks): Likewise.
* tree-into-ssa.c (compute_global_livein): Likewise.
(ssa_mark_phi_uses): Likewise.
(ssa_rewrite_initialize_block): Likewise.
(rewrite_add_phi_arguments): Likewise.
(ssa_rewrite_phi_arguments): Likewise.
(insert_phi_nodes_for): Likewise.
(rewrite_into_ssa): Likewise.
(rewrite_ssa_into_ssa): Likewise.
* tree-mudflap.c (mf_build_check_statement_for): Likewise.
* tree-outof-ssa.c (coalesce_abnormal_edges): Likewise.
(rewrite_trees): Likewise.
* tree-pretty-print.c (dump_bb_header): Likewise.
(dump_implicit_edges): Likewise.
* tree-sra.c (insert_edge_copies): Likewise.
(find_obviously_necessary_stmts): Likewise.
(remove_data_stmt): Likewise.
* tree-ssa-dom.c (thread_across_edge): Likewise.
(dom_opt_finalize_block): Likewise.
(single_incoming_edge_ignoring_loop_edges): Likewise.
(record_equivalences_from_incoming_edges): Likewise.
(cprop_into_successor_phis): Likewise.
* tree-ssa-live.c (live_worklist): Likewise.
(calculate_live_on_entry): Likewise.
(calculate_live_on_exit): Likewise.
* tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise.
(copy_loop_headers): Likewise.
* tree-ssa-loop-im.c (loop_commit_inserts): Likewise.
(fill_always_executed_in): Likewise.
* tree-ssa-loop-ivcanon.c (create_canonical_iv): Likewise.
* tree-ssa-loop-ivopts.c (find_interesting_uses): Likewise.
(compute_phi_arg_on_exit): Likewise.
* tree-ssa-loop-manip.c (add_exit_phis_edge): Likewise.
(get_loops_exit): Likewise.
(split_loop_exit_edge): Likewise.
(ip_normal_pos): Likewise.
* tree-ssa-loop-niter.c (simplify_using_initial_conditions):
Likewise.
* tree-ssa-phiopt.c (candidate_bb_for_phi_optimization): Likewise.
(replace_phi_with_stmt): Likewise.
(value_replacement): Likewise.
* tree-ssa-pre.c (compute_antic_aux): Likewise.
(insert_aux): Likewise.
(init_pre): Likewise.
* tree-ssa-propagate.c (simulate_stmt): Likewise.
(simulate_block): Likewise.
(ssa_prop_init): Likewise.
* tree-ssa-threadupdate.c (thread_block): Likewise.
(create_block_for_threading): Likewise.
(remove_last_stmt_and_useless_edges): Likewise.
* tree-ssa.c (verify_phi_args): Likewise.
(verify_ssa): Likewise.
* tree_tailcall.c (independent_of_stmt_p): Likewise.
(find_tail_calls): Likewise.
(eliminate_tail_call): Likewise.
(tree_optimize_tail_calls_1): Likewise.
* tree-vectorizer.c (vect_transform_loop): Likewise.
* var-tracking.c (prologue_stack_adjust): Likewise.
(vt_stack_adjustments): Likewise.
(vt_find_locations): Likewise.
* config/frv/frv.c (frv_ifcvt_modify_tests): Likewise.
* config/i386/i386.c (ix86_pad_returns): Likewise.
* config/ia64/ia64.c (ia64_expand_prologue): Likewise.
* config/rs6000/rs6000.c (rs6000_emit_prologue): Likewise.
Co-Authored-By: Andrew Pinski <pinskia@physics.uc.edu>
Co-Authored-By: Steven Bosscher <stevenb@suse.de>
From-SVN: r88222
2004-09-28 09:59:54 +02:00
|
|
|
edge_iterator ei;
|
2004-06-29 03:53:04 +02:00
|
|
|
|
backport: basic-block.h: Include vec.h, errors.h.
2004-09-24 Ben Elliston <bje@au.ibm.com>
Steven Bosscher <stevenb@suse.de>
Andrew Pinski <pinskia@physics.uc.edu>
Merge from edge-vector-branch:
* basic-block.h: Include vec.h, errors.h. Instantiate a VEC(edge).
(struct edge_def): Remove pred_next, succ_next members.
(struct basic_block_def): Remove pred, succ members. Add preds
and succs members of type VEC(edge).
(FALLTHRU_EDGE): Redefine using EDGE_SUCC.
(BRANCH_EDGE): Likewise.
(EDGE_CRITICAL_P): Redefine using EDGE_COUNT.
(EDGE_COUNT, EDGE_I, EDGE_PRED, EDGE_SUCC): New.
(edge_iterator): New.
(ei_start, ei_last, ei_end_p, ei_one_before_end_p): New.
(ei_next, ei_prev, ei_edge, ei_safe_edge): Likewise.
(FOR_EACH_EDGE): New.
* bb-reorder.c (find_traces): Use FOR_EACH_EDGE and EDGE_* macros
where applicable.
(rotate_loop): Likewise.
(find_traces_1_route): Likewise.
(bb_to_key): Likewise.
(connect_traces): Likewise.
(copy_bb_p): Likewise.
(find_rarely_executed_basic_blocks_and_crossing_edges): Likewise.
(add_labels_and_missing_jumps): Likewise.
(fix_up_fall_thru_edges): Likewise.
(find_jump_block): Likewise.
(fix_crossing_conditional_branches): Likewise.
(fix_crossing_unconditional_branches): Likewise.
(add_reg_crossing_jump_notes): Likewise.
* bt-load.c (augment_live_range): Likewise.
* cfg.c (clear_edges): Likewise.
(unchecked_make_edge): Likewise.
(cached_make_edge): Likewise.
(make_single_succ_edge): Likewise.
(remove_edge): Likewise.
(redirect_edge_succ_nodup): Likewise.
(check_bb_profile): Likewise.
(dump_flow_info): Likewise.
(alloc_aux_for_edges): Likewise.
(clear_aux_for_edges): Likewise.
(dump_cfg_bb_info): Likewise.
* cfganal.c (forwarder_block_p): Likewise.
(can_fallthru): Likewise.
(could_fall_through): Likewise.
(mark_dfs_back_edges): Likewise.
(set_edge_can_fallthru_flag): Likewise.
(find_unreachable_blocks): Likewise.
(create_edge_list): Likewise.
(verify_edge_list): Likewise.
(add_noreturn_fake_exit_edges): Likewise.
(connect_infinite_loops_to_exit): Likewise.
(flow_reverse_top_sort_order_compute): Likewise.
(flow_depth_first_order_compute): Likewise.
(flow_preorder_transversal_compute): Likewise.
(flow_dfs_compute_reverse_execute): Likewise.
(dfs_enumerate_from): Likewise.
(compute_dominance_frontiers_1): Likewise.
* cfgbuild.c (make_edges): Likewise.
(compute_outgoing_frequencies): Likewise.
(find_many_sub_basic_blocks): Likewise.
(find_sub_basic_blocks): Likewise.
* cfgcleanup.c (try_simplify_condjump): Likewise.
(thread_jump): Likewise.
(try_forward_edges): Likewise.
(merge_blocks_move): Likewise.
(outgoing_edges_match): Likewise.
(try_crossjump_to_edge): Likewise.
(try_crossjump_bb): Likewise.
(try_optimize_cfg): Likewise.
(merge_seq_blocks): Likewise.
* cfgexpand.c (expand_gimple_tailcall): Likewise.
(expand_gimple_basic_block): Likewise.
(construct_init_block): Likewise.
(construct_exit_block): Likewise.
* cfghooks.c (verify_flow_info): Likewise.
(dump_bb): Likewise.
(delete_basic_block): Likewise.
(split_edge): Likewise.
(merge_blocks): Likewise.
(make_forwarder_block): Likewise.
(tidy_fallthru_edges): Likewise.
(can_duplicate_block_p): Likewise.
(duplicate_block): Likewise.
* cfglayout.c (fixup_reorder_chain): Likewise.
(fixup_fallthru_exit_predecessor): Likewise.
(can_copy_bbs_p): Likewise.
(copy_bbs): Likewise.
* cfgloop.c (flow_loops_cfg_dump): Likewise.
(flow_loop_entry_edges_find): Likewise.
(flow_loop_exit_edges_find): Likewise.
(flow_loop_nodes_find): Likewise.
(mark_single_exit_loops): Likewise.
(flow_loop_pre_header_scan): Likewise.
(flow_loop_pre_header_find): Likewise.
(update_latch_info): Likewise.
(canonicalize_loop_headers): Likewise.
(flow_loops_find): Likewise.
(get_loop_body_in_bfs_order): Likewise.
(get_loop_exit_edges): Likewise.
(num_loop_branches): Likewise.
(verify_loop_structure): Likewise.
(loop_latch_edge): Likewise.
(loop_preheader_edge): Likewise.
* cfgloopanal.c (mark_irreducible_loops): Likewise.
(expected_loop_iterations): Likewise.
* cfgloopmanip.c (remove_bbs): Likewise.
(fix_bb_placement): Likewise.
(fix_irreducible_loops): Likewise.
(remove_path): Likewise.
(scale_bbs_frequencies): Likewise.
(loopify): Likewise.
(unloop): Likewise.
(fix_loop_placement): Likewise.
(loop_delete_branch_edge): Likewise.
(duplicate_loop_to_header_edge): Likewise.
(mfb_keep_just): Likewise.
(create_preheader): Likewise.
(force_single_succ_latches): Likewise.
(loop_split_edge_with): Likewise.
(create_loop_notes): Likewise.
* cfgrtl.c (rtl_split_block): Likewise.
(rtl_merge_blocks): Likewise.
(rtl_can_merge_blocks): Likewise.
(try_redirect_by_replacing_jump): Likewise.
(force_nonfallthru_and_redirect): Likewise.
(rtl_tidy_fallthru_edge): Likewise.
(commit_one_edge_insertion): Likewise.
(commit_edge_insertions): Likewise.
(commit_edge_insertions_watch_calls): Likewise.
(rtl_verify_flow_info_1): Likewise.
(rtl_verify_flow_info): Likewise.
(purge_dead_edges): Likewise.
(cfg_layout_redirect_edge_and_branch): Likewise.
(cfg_layout_can_merge_blocks_p): Likewise.
(rtl_flow_call_edges_add): Likewise.
* cse.c (cse_cc_succs): Likewise.
* df.c (hybrid_search): Likewise.
* dominance.c (calc_dfs_tree_nonrec): Likewise.
(calc_dfs_tree): Likewise.
(calc_idoms): Likewise.
(recount_dominator): Likewise.
* domwalk.c (walk_dominator_tree): Likewise.
* except.c (emit_to_new_bb_before): Likewise.
(connect_post_landing_pads): Likewise.
(sjlj_emit_function_enter): Likewise.
(sjlj_emit_function_exit): Likewise.
(finish_eh_generation): Likewise.
* final.c (compute_alignments): Likewise.
* flow.c (calculate_global_regs_live): Likewise.
(initialize_uninitialized_subregs): Likewise.
(init_propagate_block_info): Likewise.
* function.c (thread_prologue_and_epilogue_insns): Likewise.
* gcse.c (find_implicit_sets): Likewise.
(bypass_block): Likewise.
(bypass_conditional_jumps): Likewise.
(compute_pre_data): Likewise.
(insert_insn_end_bb): Likewise.
(insert_store): Likewise.
(remove_reachable_equiv_notes): Likewise.
* global.c (global_conflicts): Likewise.
(calculate_reg_pav): Likewise.
* graph.c (print_rtl_graph_with_bb): Likewise.
* ifcvt.c (mark_loop_exit_edges): Likewise.
(merge_if_block): Likewise.
(find_if_header): Likewise.
(block_jumps_and_fallthru_p): Likewise.
(find_if_block): Likewise.
(find_cond_trap): Likewise.
(block_has_only_trap): Likewise.
(find_if_case1): Likewise.
(find_if_case_2): Likewise.
* lambda-code.c (lambda_loopnest_to_gcc_loopnest): Likewise.
(perfect_nestify): Likewise.
* lcm.c (compute_antinout_edge): Likewise.
(compute_laterin): Likewise.
(compute_available): Likewise.
(compute_nearerout): Likewise.
* loop-doloop.c (doloop_modify): Likewise.
* loop-init.c (loop_optimizer_init): Likewise.
* loop-invariant.c (find_exits): Likewise.
* loop-iv.c (simplify_using_initial_values): Likewise.
(check_simple_exit): Likewise.
(find_simple_exit): Likewise.
* loop-unroll.c (peel_loop_completely): Likewise.
(unroll_loop_constant_iterations): Likewise.
(unroll_loop_runtime_iterations): Likewise.
* loop-unswitch.c (may_unswitch_on): Likewise.
(unswitch_loop): Likewise.
* modulo-sched.c (generate_prolog_epilog): Likewise.
(sms_schedule): Likewise.
* postreload-gcse.c (eliminate_partially_redundant_load):
Likewise.
* predict.c (can_predict_insn_p): Likewise.
(set_even_probabilities): Likewise.
(combine_predictions_for_bb): Likewise.
(predict_loops): Likewise.
(estimate_probability): Likewise.
(tree_predict_by_opcode): Likewise.
(tree_estimate_probability): Likewise.
(last_basic_block_p): Likewise.
(propagate_freq): Likewise.
(estimate_loops_at_level): Likewise.
(estimate_bb_frequencies): Likewise.
* profile.c (instrument_edges): Likewise.
(get_exec_counts): Likewise.
(compute_branch_probabilities): Likewise.
(branch_prob): Likewise.
* ra-build.c (live_in): Likewise.
* ra-rewrite.c (rewrite_program2): Likewise.
* ra.c (reg_alloc): Likewise.
* reg-stack.c (reg_to_stack): Likewise.
(convert_regs_entry): Likewise.
(compensate_edge): Likewise.
(convert_regs_1): Likewise,
(convert_regs_2): Likewise.
(convert_regs): Likewise.
* regrename.c (copyprop_hardreg_forward): Likewise.
* reload1.c (fixup_abnormal_edges): Likewise.
* sbitmap.c (sbitmap_intersection_of_succs): Likewise.
(sbitmap_insersection_of_preds): Likewise.
(sbitmap_union_of_succs): Likewise.
(sbitmap_union_of_preds): Likewise.
* sched-ebb.c (compute_jump_reg_dependencies): Likewise.
(fix_basic_block_boundaries): Likewise.
(sched_ebbs): Likewise.
* sched-rgn.c (build_control_flow): Likewise.
(find_rgns): Likewise.
* tracer.c (find_best_successor): Likewise.
(find_best_predecessor): Likewise.
(tail_duplicate): Likewise.
* tree-cfg.c (make_edges): Likewise.
(make_ctrl_stmt_edges): Likewise.
(make_goto_expr_edges): Likewise.
(tree_can_merge_blocks_p): Likewise.
(tree_merge_blocks): Likewise.
(cfg_remove_useless_stmts_bb): Likewise.
(remove_phi_nodes_and_edges_for_unreachable_block): Likewise.
(tree_block_forwards_to): Likewise.
(cleanup_control_expr_graph): Likewise.
(find_taken_edge): Likewise.
(dump_cfg_stats): Likewise.
(tree_cfg2vcg): Likewise.
(disband_implicit_edges): Likewise.
(tree_find_edge_insert_loc): Likewise.
(bsi_commit_edge_inserts): Likewise.
(tree_split_edge): Likewise.
(tree_verify_flow_info): Likewise.
(tree_make_forwarder_block): Likewise.
(tree_forwarder_block_p): Likewise.
(thread_jumps): Likewise.
(tree_try_redirect_by_replacing_jump): Likewise.
(tree_split_block): Likewise.
(add_phi_args_after_copy_bb): Likewise.
(rewrite_to_new_ssa_names_bb): Likewise.
(dump_function_to_file): Likewise.
(print_pred_bbs): Likewise.
(print_loop): Likewise.
(tree_flow_call_edges_add): Likewise.
(split_critical_edges): Likewise.
(execute_warn_function_return): Likewise.
(extract_true_false_edges_from_block): Likewise.
* tree-if-conv.c (tree_if_conversion): Likewise.
(if_convertable_bb_p): Likewise.
(find_phi_replacement_condition): Likewise.
(combine_blocks): Likewise.
* tree-into-ssa.c (compute_global_livein): Likewise.
(ssa_mark_phi_uses): Likewise.
(ssa_rewrite_initialize_block): Likewise.
(rewrite_add_phi_arguments): Likewise.
(ssa_rewrite_phi_arguments): Likewise.
(insert_phi_nodes_for): Likewise.
(rewrite_into_ssa): Likewise.
(rewrite_ssa_into_ssa): Likewise.
* tree-mudflap.c (mf_build_check_statement_for): Likewise.
* tree-outof-ssa.c (coalesce_abnormal_edges): Likewise.
(rewrite_trees): Likewise.
* tree-pretty-print.c (dump_bb_header): Likewise.
(dump_implicit_edges): Likewise.
* tree-sra.c (insert_edge_copies): Likewise.
(find_obviously_necessary_stmts): Likewise.
(remove_data_stmt): Likewise.
* tree-ssa-dom.c (thread_across_edge): Likewise.
(dom_opt_finalize_block): Likewise.
(single_incoming_edge_ignoring_loop_edges): Likewise.
(record_equivalences_from_incoming_edges): Likewise.
(cprop_into_successor_phis): Likewise.
* tree-ssa-live.c (live_worklist): Likewise.
(calculate_live_on_entry): Likewise.
(calculate_live_on_exit): Likewise.
* tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise.
(copy_loop_headers): Likewise.
* tree-ssa-loop-im.c (loop_commit_inserts): Likewise.
(fill_always_executed_in): Likewise.
* tree-ssa-loop-ivcanon.c (create_canonical_iv): Likewise.
* tree-ssa-loop-ivopts.c (find_interesting_uses): Likewise.
(compute_phi_arg_on_exit): Likewise.
* tree-ssa-loop-manip.c (add_exit_phis_edge): Likewise.
(get_loops_exit): Likewise.
(split_loop_exit_edge): Likewise.
(ip_normal_pos): Likewise.
* tree-ssa-loop-niter.c (simplify_using_initial_conditions):
Likewise.
* tree-ssa-phiopt.c (candidate_bb_for_phi_optimization): Likewise.
(replace_phi_with_stmt): Likewise.
(value_replacement): Likewise.
* tree-ssa-pre.c (compute_antic_aux): Likewise.
(insert_aux): Likewise.
(init_pre): Likewise.
* tree-ssa-propagate.c (simulate_stmt): Likewise.
(simulate_block): Likewise.
(ssa_prop_init): Likewise.
* tree-ssa-threadupdate.c (thread_block): Likewise.
(create_block_for_threading): Likewise.
(remove_last_stmt_and_useless_edges): Likewise.
* tree-ssa.c (verify_phi_args): Likewise.
(verify_ssa): Likewise.
* tree_tailcall.c (independent_of_stmt_p): Likewise.
(find_tail_calls): Likewise.
(eliminate_tail_call): Likewise.
(tree_optimize_tail_calls_1): Likewise.
* tree-vectorizer.c (vect_transform_loop): Likewise.
* var-tracking.c (prologue_stack_adjust): Likewise.
(vt_stack_adjustments): Likewise.
(vt_find_locations): Likewise.
* config/frv/frv.c (frv_ifcvt_modify_tests): Likewise.
* config/i386/i386.c (ix86_pad_returns): Likewise.
* config/ia64/ia64.c (ia64_expand_prologue): Likewise.
* config/rs6000/rs6000.c (rs6000_emit_prologue): Likewise.
Co-Authored-By: Andrew Pinski <pinskia@physics.uc.edu>
Co-Authored-By: Steven Bosscher <stevenb@suse.de>
From-SVN: r88222
2004-09-28 09:59:54 +02:00
|
|
|
FOR_EACH_EDGE (e, ei, bb->succs)
|
2004-06-29 03:53:04 +02:00
|
|
|
{
|
2004-11-24 16:29:44 +01:00
|
|
|
int indx;
|
2014-11-19 18:00:54 +01:00
|
|
|
gphi_iterator gsi;
|
2004-06-29 03:53:04 +02:00
|
|
|
|
|
|
|
/* If this is an abnormal edge, then we do not want to copy propagate
|
|
|
|
into the PHI alternative associated with this edge. */
|
|
|
|
if (e->flags & EDGE_ABNORMAL)
|
|
|
|
continue;
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
gsi = gsi_start_phis (e->dest);
|
|
|
|
if (gsi_end_p (gsi))
|
2004-06-29 03:53:04 +02:00
|
|
|
continue;
|
|
|
|
|
2013-09-17 19:27:41 +02:00
|
|
|
/* We may have an equivalence associated with this edge. While
|
|
|
|
we can not propagate it into non-dominated blocks, we can
|
|
|
|
propagate them into PHIs in non-dominated blocks. */
|
|
|
|
|
|
|
|
/* Push the unwind marker so we can reset the const and copies
|
|
|
|
table back to its original state after processing this edge. */
|
2015-04-17 21:24:17 +02:00
|
|
|
const_and_copies->push_marker ();
|
2013-09-17 19:27:41 +02:00
|
|
|
|
|
|
|
/* Extract and record any simple NAME = VALUE equivalences.
|
|
|
|
|
|
|
|
Don't bother with [01] = COND equivalences, they're not useful
|
|
|
|
here. */
|
|
|
|
struct edge_info *edge_info = (struct edge_info *) e->aux;
|
|
|
|
if (edge_info)
|
|
|
|
{
|
|
|
|
tree lhs = edge_info->lhs;
|
|
|
|
tree rhs = edge_info->rhs;
|
|
|
|
|
|
|
|
if (lhs && TREE_CODE (lhs) == SSA_NAME)
|
2015-04-17 21:24:17 +02:00
|
|
|
const_and_copies->record_const_or_copy (lhs, rhs);
|
2013-09-17 19:27:41 +02:00
|
|
|
}
|
|
|
|
|
2004-11-24 16:29:44 +01:00
|
|
|
indx = e->dest_idx;
|
2008-07-28 16:33:56 +02:00
|
|
|
for ( ; !gsi_end_p (gsi); gsi_next (&gsi))
|
2004-06-29 03:53:04 +02:00
|
|
|
{
|
2007-06-06 22:18:47 +02:00
|
|
|
tree new_val;
|
2004-06-29 03:53:04 +02:00
|
|
|
use_operand_p orig_p;
|
2007-06-06 22:18:47 +02:00
|
|
|
tree orig_val;
|
2014-11-19 18:00:54 +01:00
|
|
|
gphi *phi = gsi.phi ();
|
2004-06-29 03:53:04 +02:00
|
|
|
|
|
|
|
/* The alternative may be associated with a constant, so verify
|
|
|
|
it is an SSA_NAME before doing anything with it. */
|
2008-07-28 16:33:56 +02:00
|
|
|
orig_p = gimple_phi_arg_imm_use_ptr (phi, indx);
|
|
|
|
orig_val = get_use_from_ptr (orig_p);
|
2007-06-06 22:18:47 +02:00
|
|
|
if (TREE_CODE (orig_val) != SSA_NAME)
|
2004-06-29 03:53:04 +02:00
|
|
|
continue;
|
|
|
|
|
|
|
|
/* If we have *ORIG_P in our constant/copy table, then replace
|
|
|
|
ORIG_P with its value in our constant/copy table. */
|
2007-06-06 22:18:47 +02:00
|
|
|
new_val = SSA_NAME_VALUE (orig_val);
|
|
|
|
if (new_val
|
|
|
|
&& new_val != orig_val
|
|
|
|
&& (TREE_CODE (new_val) == SSA_NAME
|
|
|
|
|| is_gimple_min_invariant (new_val))
|
|
|
|
&& may_propagate_copy (orig_val, new_val))
|
|
|
|
propagate_value (orig_p, new_val);
|
2004-06-29 03:53:04 +02:00
|
|
|
}
|
2013-09-17 19:27:41 +02:00
|
|
|
|
2015-04-17 21:24:17 +02:00
|
|
|
const_and_copies->pop_to_marker ();
|
2004-06-29 03:53:04 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-09-18 04:39:50 +02:00
|
|
|
void
|
|
|
|
dom_opt_dom_walker::before_dom_children (basic_block bb)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
domwalk.h (struct dom_walk_data): Remove all callbacks except before_dom_children_before_stmts and...
2009-06-27 Paolo Bonzini <bonzini@gnu.org>
* domwalk.h (struct dom_walk_data): Remove all callbacks except
before_dom_children_before_stmts and after_dom_children_after_stmts.
Rename the two remaining callbacks to just before_dom_children and
after_dom_children. Remove other GIMPLE statement walking bits.
* domwalk.c (walk_dominator_tree): Remove now unsupported features.
* graphite.c: Do not include domwalk.h.
* tree-into-ssa.c (interesting_blocks): New global.
(struct mark_def_sites_global_data): Remove it and names_to_rename.
(mark_def_sites, rewrite_stmt, rewrite_add_phi_arguments,
rewrite_update_stmt, rewrite_update_phi_arguments): Simplify
now that they're not domwalk callbacks.
(rewrite_initialize_block): Rename to...
(rewrite_enter_block): ... this, place after called functions. Test
interesting_blocks, call rewrite_stmt and rewrite_add_phi_arguments.
(rewrite_finalize_block): Rename to...
(rewrite_leave_block): ... this, place after called functions.
(rewrite_update_init_block): Rename to...
(rewrite_update_enter_block): ... this, place after called functions.
Test interesting_blocks, call rewrite_update_stmt and
rewrite_update_phi_arguments.
(rewrite_update_fini_block): Rename to...
(rewrite_leave_block): ... this, place after called functions.
(rewrite_blocks): Remove last argument, simplify initialization of
walk_data.
(mark_def_sites_initialize_block): Rename to...
(mark_def_sites_block): ... this, call mark_def_sites.
(mark_def_sites_blocks): Remove argument, simplify initialization of
walk_data.
(rewrite_into_ssa): Adjust for interesting_blocks_being a global.
(update_ssa): Likewise.
* tree-ssa-dom.c (optimize_stmt): Simplify now that it's not a domwalk
callback.
(tree_ssa_dominator_optimize): Simplify initialization of walk_data.
(dom_opt_initialize_block): Rename to...
(dom_opt_enter_block): ... this, place after called functions. Walk
statements here, inline propagate_to_outgoing_edges.
(dom_opt_finalize_block): Rename to...
(dom_opt_leave_block): ... this, place after called functions.
* tree-ssa-dse.c (dse_optimize_stmt): Simplify now that it's not a
domwalk callback.
(dse_enter_block, dse_record_phi): New.
(dse_record_phis): Delete.
(dse_finalize_block): Rename to...
(dse_leave_block): ... this.
(tree_ssa_dse): Simplify initialization of walk_data.
* tree-ssa-loop-im.c (determine_invariantness, move_computations):
Adjust initialization of walk_data.
* tree-ssa-loop-unswitch.c: Do not include domwalk.h.
* tree-ssa-loop-phiopt.c (get_non_trapping):
Adjust initialization of walk_data.
* tree-ssa-loop-threadedge.c: Do not include domwalk.h.
* tree-ssa-uncprop.c (uncprop_into_successor_phis): Simplify now that
it's not a domwalk callback.
(uncprop_initialize_block): Rename to...
(dse_enter_block): ... this, call uncprop_into_successor_phis.
(dse_finalize_block): Rename to...
(dse_leave_block): ... this.
(tree_ssa_uncprop): Simplify initialization of walk_data.
* Makefile.in: Adjust dependencies.
From-SVN: r149008
2009-06-27 16:45:51 +02:00
|
|
|
gimple_stmt_iterator gsi;
|
|
|
|
|
|
|
|
if (dump_file && (dump_flags & TDF_DETAILS))
|
|
|
|
fprintf (dump_file, "\n\nOptimizing block #%d\n\n", bb->index);
|
|
|
|
|
|
|
|
/* Push a marker on the stacks of local information so that we know how
|
|
|
|
far to unwind when we finalize this block. */
|
2015-09-15 19:03:49 +02:00
|
|
|
avail_exprs_stack->push_marker ();
|
2015-04-17 21:24:17 +02:00
|
|
|
const_and_copies->push_marker ();
|
domwalk.h (struct dom_walk_data): Remove all callbacks except before_dom_children_before_stmts and...
2009-06-27 Paolo Bonzini <bonzini@gnu.org>
* domwalk.h (struct dom_walk_data): Remove all callbacks except
before_dom_children_before_stmts and after_dom_children_after_stmts.
Rename the two remaining callbacks to just before_dom_children and
after_dom_children. Remove other GIMPLE statement walking bits.
* domwalk.c (walk_dominator_tree): Remove now unsupported features.
* graphite.c: Do not include domwalk.h.
* tree-into-ssa.c (interesting_blocks): New global.
(struct mark_def_sites_global_data): Remove it and names_to_rename.
(mark_def_sites, rewrite_stmt, rewrite_add_phi_arguments,
rewrite_update_stmt, rewrite_update_phi_arguments): Simplify
now that they're not domwalk callbacks.
(rewrite_initialize_block): Rename to...
(rewrite_enter_block): ... this, place after called functions. Test
interesting_blocks, call rewrite_stmt and rewrite_add_phi_arguments.
(rewrite_finalize_block): Rename to...
(rewrite_leave_block): ... this, place after called functions.
(rewrite_update_init_block): Rename to...
(rewrite_update_enter_block): ... this, place after called functions.
Test interesting_blocks, call rewrite_update_stmt and
rewrite_update_phi_arguments.
(rewrite_update_fini_block): Rename to...
(rewrite_leave_block): ... this, place after called functions.
(rewrite_blocks): Remove last argument, simplify initialization of
walk_data.
(mark_def_sites_initialize_block): Rename to...
(mark_def_sites_block): ... this, call mark_def_sites.
(mark_def_sites_blocks): Remove argument, simplify initialization of
walk_data.
(rewrite_into_ssa): Adjust for interesting_blocks_being a global.
(update_ssa): Likewise.
* tree-ssa-dom.c (optimize_stmt): Simplify now that it's not a domwalk
callback.
(tree_ssa_dominator_optimize): Simplify initialization of walk_data.
(dom_opt_initialize_block): Rename to...
(dom_opt_enter_block): ... this, place after called functions. Walk
statements here, inline propagate_to_outgoing_edges.
(dom_opt_finalize_block): Rename to...
(dom_opt_leave_block): ... this, place after called functions.
* tree-ssa-dse.c (dse_optimize_stmt): Simplify now that it's not a
domwalk callback.
(dse_enter_block, dse_record_phi): New.
(dse_record_phis): Delete.
(dse_finalize_block): Rename to...
(dse_leave_block): ... this.
(tree_ssa_dse): Simplify initialization of walk_data.
* tree-ssa-loop-im.c (determine_invariantness, move_computations):
Adjust initialization of walk_data.
* tree-ssa-loop-unswitch.c: Do not include domwalk.h.
* tree-ssa-loop-phiopt.c (get_non_trapping):
Adjust initialization of walk_data.
* tree-ssa-loop-threadedge.c: Do not include domwalk.h.
* tree-ssa-uncprop.c (uncprop_into_successor_phis): Simplify now that
it's not a domwalk callback.
(uncprop_initialize_block): Rename to...
(dse_enter_block): ... this, call uncprop_into_successor_phis.
(dse_finalize_block): Rename to...
(dse_leave_block): ... this.
(tree_ssa_uncprop): Simplify initialization of walk_data.
* Makefile.in: Adjust dependencies.
From-SVN: r149008
2009-06-27 16:45:51 +02:00
|
|
|
|
|
|
|
record_equivalences_from_incoming_edge (bb);
|
|
|
|
|
|
|
|
/* PHI nodes can create equivalences too. */
|
|
|
|
record_equivalences_from_phis (bb);
|
|
|
|
|
2011-12-08 23:00:38 +01:00
|
|
|
/* Create equivalences from redundant PHIs. PHIs are only truly
|
|
|
|
redundant when they exist in the same block, so push another
|
|
|
|
marker and unwind right afterwards. */
|
2015-09-15 19:03:49 +02:00
|
|
|
avail_exprs_stack->push_marker ();
|
2011-12-08 23:00:38 +01:00
|
|
|
for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
|
|
|
|
eliminate_redundant_computations (&gsi);
|
2015-09-15 19:03:49 +02:00
|
|
|
avail_exprs_stack->pop_to_marker ();
|
2011-12-08 23:00:38 +01:00
|
|
|
|
domwalk.h (struct dom_walk_data): Remove all callbacks except before_dom_children_before_stmts and...
2009-06-27 Paolo Bonzini <bonzini@gnu.org>
* domwalk.h (struct dom_walk_data): Remove all callbacks except
before_dom_children_before_stmts and after_dom_children_after_stmts.
Rename the two remaining callbacks to just before_dom_children and
after_dom_children. Remove other GIMPLE statement walking bits.
* domwalk.c (walk_dominator_tree): Remove now unsupported features.
* graphite.c: Do not include domwalk.h.
* tree-into-ssa.c (interesting_blocks): New global.
(struct mark_def_sites_global_data): Remove it and names_to_rename.
(mark_def_sites, rewrite_stmt, rewrite_add_phi_arguments,
rewrite_update_stmt, rewrite_update_phi_arguments): Simplify
now that they're not domwalk callbacks.
(rewrite_initialize_block): Rename to...
(rewrite_enter_block): ... this, place after called functions. Test
interesting_blocks, call rewrite_stmt and rewrite_add_phi_arguments.
(rewrite_finalize_block): Rename to...
(rewrite_leave_block): ... this, place after called functions.
(rewrite_update_init_block): Rename to...
(rewrite_update_enter_block): ... this, place after called functions.
Test interesting_blocks, call rewrite_update_stmt and
rewrite_update_phi_arguments.
(rewrite_update_fini_block): Rename to...
(rewrite_leave_block): ... this, place after called functions.
(rewrite_blocks): Remove last argument, simplify initialization of
walk_data.
(mark_def_sites_initialize_block): Rename to...
(mark_def_sites_block): ... this, call mark_def_sites.
(mark_def_sites_blocks): Remove argument, simplify initialization of
walk_data.
(rewrite_into_ssa): Adjust for interesting_blocks_being a global.
(update_ssa): Likewise.
* tree-ssa-dom.c (optimize_stmt): Simplify now that it's not a domwalk
callback.
(tree_ssa_dominator_optimize): Simplify initialization of walk_data.
(dom_opt_initialize_block): Rename to...
(dom_opt_enter_block): ... this, place after called functions. Walk
statements here, inline propagate_to_outgoing_edges.
(dom_opt_finalize_block): Rename to...
(dom_opt_leave_block): ... this, place after called functions.
* tree-ssa-dse.c (dse_optimize_stmt): Simplify now that it's not a
domwalk callback.
(dse_enter_block, dse_record_phi): New.
(dse_record_phis): Delete.
(dse_finalize_block): Rename to...
(dse_leave_block): ... this.
(tree_ssa_dse): Simplify initialization of walk_data.
* tree-ssa-loop-im.c (determine_invariantness, move_computations):
Adjust initialization of walk_data.
* tree-ssa-loop-unswitch.c: Do not include domwalk.h.
* tree-ssa-loop-phiopt.c (get_non_trapping):
Adjust initialization of walk_data.
* tree-ssa-loop-threadedge.c: Do not include domwalk.h.
* tree-ssa-uncprop.c (uncprop_into_successor_phis): Simplify now that
it's not a domwalk callback.
(uncprop_initialize_block): Rename to...
(dse_enter_block): ... this, call uncprop_into_successor_phis.
(dse_finalize_block): Rename to...
(dse_leave_block): ... this.
(tree_ssa_uncprop): Simplify initialization of walk_data.
* Makefile.in: Adjust dependencies.
From-SVN: r149008
2009-06-27 16:45:51 +02:00
|
|
|
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
|
|
|
|
optimize_stmt (bb, gsi);
|
|
|
|
|
|
|
|
/* Now prepare to process dominated blocks. */
|
2004-10-30 02:06:22 +02:00
|
|
|
record_edge_info (bb);
|
2006-02-17 05:15:32 +01:00
|
|
|
cprop_into_successor_phis (bb);
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
domwalk.h (struct dom_walk_data): Remove all callbacks except before_dom_children_before_stmts and...
2009-06-27 Paolo Bonzini <bonzini@gnu.org>
* domwalk.h (struct dom_walk_data): Remove all callbacks except
before_dom_children_before_stmts and after_dom_children_after_stmts.
Rename the two remaining callbacks to just before_dom_children and
after_dom_children. Remove other GIMPLE statement walking bits.
* domwalk.c (walk_dominator_tree): Remove now unsupported features.
* graphite.c: Do not include domwalk.h.
* tree-into-ssa.c (interesting_blocks): New global.
(struct mark_def_sites_global_data): Remove it and names_to_rename.
(mark_def_sites, rewrite_stmt, rewrite_add_phi_arguments,
rewrite_update_stmt, rewrite_update_phi_arguments): Simplify
now that they're not domwalk callbacks.
(rewrite_initialize_block): Rename to...
(rewrite_enter_block): ... this, place after called functions. Test
interesting_blocks, call rewrite_stmt and rewrite_add_phi_arguments.
(rewrite_finalize_block): Rename to...
(rewrite_leave_block): ... this, place after called functions.
(rewrite_update_init_block): Rename to...
(rewrite_update_enter_block): ... this, place after called functions.
Test interesting_blocks, call rewrite_update_stmt and
rewrite_update_phi_arguments.
(rewrite_update_fini_block): Rename to...
(rewrite_leave_block): ... this, place after called functions.
(rewrite_blocks): Remove last argument, simplify initialization of
walk_data.
(mark_def_sites_initialize_block): Rename to...
(mark_def_sites_block): ... this, call mark_def_sites.
(mark_def_sites_blocks): Remove argument, simplify initialization of
walk_data.
(rewrite_into_ssa): Adjust for interesting_blocks_being a global.
(update_ssa): Likewise.
* tree-ssa-dom.c (optimize_stmt): Simplify now that it's not a domwalk
callback.
(tree_ssa_dominator_optimize): Simplify initialization of walk_data.
(dom_opt_initialize_block): Rename to...
(dom_opt_enter_block): ... this, place after called functions. Walk
statements here, inline propagate_to_outgoing_edges.
(dom_opt_finalize_block): Rename to...
(dom_opt_leave_block): ... this, place after called functions.
* tree-ssa-dse.c (dse_optimize_stmt): Simplify now that it's not a
domwalk callback.
(dse_enter_block, dse_record_phi): New.
(dse_record_phis): Delete.
(dse_finalize_block): Rename to...
(dse_leave_block): ... this.
(tree_ssa_dse): Simplify initialization of walk_data.
* tree-ssa-loop-im.c (determine_invariantness, move_computations):
Adjust initialization of walk_data.
* tree-ssa-loop-unswitch.c: Do not include domwalk.h.
* tree-ssa-loop-phiopt.c (get_non_trapping):
Adjust initialization of walk_data.
* tree-ssa-loop-threadedge.c: Do not include domwalk.h.
* tree-ssa-uncprop.c (uncprop_into_successor_phis): Simplify now that
it's not a domwalk callback.
(uncprop_initialize_block): Rename to...
(dse_enter_block): ... this, call uncprop_into_successor_phis.
(dse_finalize_block): Rename to...
(dse_leave_block): ... this.
(tree_ssa_uncprop): Simplify initialization of walk_data.
* Makefile.in: Adjust dependencies.
From-SVN: r149008
2009-06-27 16:45:51 +02:00
|
|
|
/* We have finished processing the dominator children of BB, perform
|
|
|
|
any finalization actions in preparation for leaving this node in
|
|
|
|
the dominator tree. */
|
|
|
|
|
2013-09-18 04:39:50 +02:00
|
|
|
void
|
|
|
|
dom_opt_dom_walker::after_dom_children (basic_block bb)
|
domwalk.h (struct dom_walk_data): Remove all callbacks except before_dom_children_before_stmts and...
2009-06-27 Paolo Bonzini <bonzini@gnu.org>
* domwalk.h (struct dom_walk_data): Remove all callbacks except
before_dom_children_before_stmts and after_dom_children_after_stmts.
Rename the two remaining callbacks to just before_dom_children and
after_dom_children. Remove other GIMPLE statement walking bits.
* domwalk.c (walk_dominator_tree): Remove now unsupported features.
* graphite.c: Do not include domwalk.h.
* tree-into-ssa.c (interesting_blocks): New global.
(struct mark_def_sites_global_data): Remove it and names_to_rename.
(mark_def_sites, rewrite_stmt, rewrite_add_phi_arguments,
rewrite_update_stmt, rewrite_update_phi_arguments): Simplify
now that they're not domwalk callbacks.
(rewrite_initialize_block): Rename to...
(rewrite_enter_block): ... this, place after called functions. Test
interesting_blocks, call rewrite_stmt and rewrite_add_phi_arguments.
(rewrite_finalize_block): Rename to...
(rewrite_leave_block): ... this, place after called functions.
(rewrite_update_init_block): Rename to...
(rewrite_update_enter_block): ... this, place after called functions.
Test interesting_blocks, call rewrite_update_stmt and
rewrite_update_phi_arguments.
(rewrite_update_fini_block): Rename to...
(rewrite_leave_block): ... this, place after called functions.
(rewrite_blocks): Remove last argument, simplify initialization of
walk_data.
(mark_def_sites_initialize_block): Rename to...
(mark_def_sites_block): ... this, call mark_def_sites.
(mark_def_sites_blocks): Remove argument, simplify initialization of
walk_data.
(rewrite_into_ssa): Adjust for interesting_blocks_being a global.
(update_ssa): Likewise.
* tree-ssa-dom.c (optimize_stmt): Simplify now that it's not a domwalk
callback.
(tree_ssa_dominator_optimize): Simplify initialization of walk_data.
(dom_opt_initialize_block): Rename to...
(dom_opt_enter_block): ... this, place after called functions. Walk
statements here, inline propagate_to_outgoing_edges.
(dom_opt_finalize_block): Rename to...
(dom_opt_leave_block): ... this, place after called functions.
* tree-ssa-dse.c (dse_optimize_stmt): Simplify now that it's not a
domwalk callback.
(dse_enter_block, dse_record_phi): New.
(dse_record_phis): Delete.
(dse_finalize_block): Rename to...
(dse_leave_block): ... this.
(tree_ssa_dse): Simplify initialization of walk_data.
* tree-ssa-loop-im.c (determine_invariantness, move_computations):
Adjust initialization of walk_data.
* tree-ssa-loop-unswitch.c: Do not include domwalk.h.
* tree-ssa-loop-phiopt.c (get_non_trapping):
Adjust initialization of walk_data.
* tree-ssa-loop-threadedge.c: Do not include domwalk.h.
* tree-ssa-uncprop.c (uncprop_into_successor_phis): Simplify now that
it's not a domwalk callback.
(uncprop_initialize_block): Rename to...
(dse_enter_block): ... this, call uncprop_into_successor_phis.
(dse_finalize_block): Rename to...
(dse_leave_block): ... this.
(tree_ssa_uncprop): Simplify initialization of walk_data.
* Makefile.in: Adjust dependencies.
From-SVN: r149008
2009-06-27 16:45:51 +02:00
|
|
|
{
|
|
|
|
gimple last;
|
|
|
|
|
|
|
|
/* If we have an outgoing edge to a block with multiple incoming and
|
|
|
|
outgoing edges, then we may be able to thread the edge, i.e., we
|
|
|
|
may be able to statically determine which of the outgoing edges
|
|
|
|
will be traversed when the incoming edge from BB is traversed. */
|
|
|
|
if (single_succ_p (bb)
|
|
|
|
&& (single_succ_edge (bb)->flags & EDGE_ABNORMAL) == 0
|
|
|
|
&& potentially_threadable_block (single_succ (bb)))
|
|
|
|
{
|
2013-09-18 04:39:50 +02:00
|
|
|
thread_across_edge (single_succ_edge (bb));
|
domwalk.h (struct dom_walk_data): Remove all callbacks except before_dom_children_before_stmts and...
2009-06-27 Paolo Bonzini <bonzini@gnu.org>
* domwalk.h (struct dom_walk_data): Remove all callbacks except
before_dom_children_before_stmts and after_dom_children_after_stmts.
Rename the two remaining callbacks to just before_dom_children and
after_dom_children. Remove other GIMPLE statement walking bits.
* domwalk.c (walk_dominator_tree): Remove now unsupported features.
* graphite.c: Do not include domwalk.h.
* tree-into-ssa.c (interesting_blocks): New global.
(struct mark_def_sites_global_data): Remove it and names_to_rename.
(mark_def_sites, rewrite_stmt, rewrite_add_phi_arguments,
rewrite_update_stmt, rewrite_update_phi_arguments): Simplify
now that they're not domwalk callbacks.
(rewrite_initialize_block): Rename to...
(rewrite_enter_block): ... this, place after called functions. Test
interesting_blocks, call rewrite_stmt and rewrite_add_phi_arguments.
(rewrite_finalize_block): Rename to...
(rewrite_leave_block): ... this, place after called functions.
(rewrite_update_init_block): Rename to...
(rewrite_update_enter_block): ... this, place after called functions.
Test interesting_blocks, call rewrite_update_stmt and
rewrite_update_phi_arguments.
(rewrite_update_fini_block): Rename to...
(rewrite_leave_block): ... this, place after called functions.
(rewrite_blocks): Remove last argument, simplify initialization of
walk_data.
(mark_def_sites_initialize_block): Rename to...
(mark_def_sites_block): ... this, call mark_def_sites.
(mark_def_sites_blocks): Remove argument, simplify initialization of
walk_data.
(rewrite_into_ssa): Adjust for interesting_blocks_being a global.
(update_ssa): Likewise.
* tree-ssa-dom.c (optimize_stmt): Simplify now that it's not a domwalk
callback.
(tree_ssa_dominator_optimize): Simplify initialization of walk_data.
(dom_opt_initialize_block): Rename to...
(dom_opt_enter_block): ... this, place after called functions. Walk
statements here, inline propagate_to_outgoing_edges.
(dom_opt_finalize_block): Rename to...
(dom_opt_leave_block): ... this, place after called functions.
* tree-ssa-dse.c (dse_optimize_stmt): Simplify now that it's not a
domwalk callback.
(dse_enter_block, dse_record_phi): New.
(dse_record_phis): Delete.
(dse_finalize_block): Rename to...
(dse_leave_block): ... this.
(tree_ssa_dse): Simplify initialization of walk_data.
* tree-ssa-loop-im.c (determine_invariantness, move_computations):
Adjust initialization of walk_data.
* tree-ssa-loop-unswitch.c: Do not include domwalk.h.
* tree-ssa-loop-phiopt.c (get_non_trapping):
Adjust initialization of walk_data.
* tree-ssa-loop-threadedge.c: Do not include domwalk.h.
* tree-ssa-uncprop.c (uncprop_into_successor_phis): Simplify now that
it's not a domwalk callback.
(uncprop_initialize_block): Rename to...
(dse_enter_block): ... this, call uncprop_into_successor_phis.
(dse_finalize_block): Rename to...
(dse_leave_block): ... this.
(tree_ssa_uncprop): Simplify initialization of walk_data.
* Makefile.in: Adjust dependencies.
From-SVN: r149008
2009-06-27 16:45:51 +02:00
|
|
|
}
|
|
|
|
else if ((last = last_stmt (bb))
|
|
|
|
&& gimple_code (last) == GIMPLE_COND
|
|
|
|
&& EDGE_COUNT (bb->succs) == 2
|
|
|
|
&& (EDGE_SUCC (bb, 0)->flags & EDGE_ABNORMAL) == 0
|
|
|
|
&& (EDGE_SUCC (bb, 1)->flags & EDGE_ABNORMAL) == 0)
|
|
|
|
{
|
|
|
|
edge true_edge, false_edge;
|
|
|
|
|
|
|
|
extract_true_false_edges_from_block (bb, &true_edge, &false_edge);
|
|
|
|
|
|
|
|
/* Only try to thread the edge if it reaches a target block with
|
|
|
|
more than one predecessor and more than one successor. */
|
|
|
|
if (potentially_threadable_block (true_edge->dest))
|
2013-09-19 14:49:30 +02:00
|
|
|
thread_across_edge (true_edge);
|
domwalk.h (struct dom_walk_data): Remove all callbacks except before_dom_children_before_stmts and...
2009-06-27 Paolo Bonzini <bonzini@gnu.org>
* domwalk.h (struct dom_walk_data): Remove all callbacks except
before_dom_children_before_stmts and after_dom_children_after_stmts.
Rename the two remaining callbacks to just before_dom_children and
after_dom_children. Remove other GIMPLE statement walking bits.
* domwalk.c (walk_dominator_tree): Remove now unsupported features.
* graphite.c: Do not include domwalk.h.
* tree-into-ssa.c (interesting_blocks): New global.
(struct mark_def_sites_global_data): Remove it and names_to_rename.
(mark_def_sites, rewrite_stmt, rewrite_add_phi_arguments,
rewrite_update_stmt, rewrite_update_phi_arguments): Simplify
now that they're not domwalk callbacks.
(rewrite_initialize_block): Rename to...
(rewrite_enter_block): ... this, place after called functions. Test
interesting_blocks, call rewrite_stmt and rewrite_add_phi_arguments.
(rewrite_finalize_block): Rename to...
(rewrite_leave_block): ... this, place after called functions.
(rewrite_update_init_block): Rename to...
(rewrite_update_enter_block): ... this, place after called functions.
Test interesting_blocks, call rewrite_update_stmt and
rewrite_update_phi_arguments.
(rewrite_update_fini_block): Rename to...
(rewrite_leave_block): ... this, place after called functions.
(rewrite_blocks): Remove last argument, simplify initialization of
walk_data.
(mark_def_sites_initialize_block): Rename to...
(mark_def_sites_block): ... this, call mark_def_sites.
(mark_def_sites_blocks): Remove argument, simplify initialization of
walk_data.
(rewrite_into_ssa): Adjust for interesting_blocks_being a global.
(update_ssa): Likewise.
* tree-ssa-dom.c (optimize_stmt): Simplify now that it's not a domwalk
callback.
(tree_ssa_dominator_optimize): Simplify initialization of walk_data.
(dom_opt_initialize_block): Rename to...
(dom_opt_enter_block): ... this, place after called functions. Walk
statements here, inline propagate_to_outgoing_edges.
(dom_opt_finalize_block): Rename to...
(dom_opt_leave_block): ... this, place after called functions.
* tree-ssa-dse.c (dse_optimize_stmt): Simplify now that it's not a
domwalk callback.
(dse_enter_block, dse_record_phi): New.
(dse_record_phis): Delete.
(dse_finalize_block): Rename to...
(dse_leave_block): ... this.
(tree_ssa_dse): Simplify initialization of walk_data.
* tree-ssa-loop-im.c (determine_invariantness, move_computations):
Adjust initialization of walk_data.
* tree-ssa-loop-unswitch.c: Do not include domwalk.h.
* tree-ssa-loop-phiopt.c (get_non_trapping):
Adjust initialization of walk_data.
* tree-ssa-loop-threadedge.c: Do not include domwalk.h.
* tree-ssa-uncprop.c (uncprop_into_successor_phis): Simplify now that
it's not a domwalk callback.
(uncprop_initialize_block): Rename to...
(dse_enter_block): ... this, call uncprop_into_successor_phis.
(dse_finalize_block): Rename to...
(dse_leave_block): ... this.
(tree_ssa_uncprop): Simplify initialization of walk_data.
* Makefile.in: Adjust dependencies.
From-SVN: r149008
2009-06-27 16:45:51 +02:00
|
|
|
|
|
|
|
/* Similarly for the ELSE arm. */
|
|
|
|
if (potentially_threadable_block (false_edge->dest))
|
2013-09-19 14:49:30 +02:00
|
|
|
thread_across_edge (false_edge);
|
domwalk.h (struct dom_walk_data): Remove all callbacks except before_dom_children_before_stmts and...
2009-06-27 Paolo Bonzini <bonzini@gnu.org>
* domwalk.h (struct dom_walk_data): Remove all callbacks except
before_dom_children_before_stmts and after_dom_children_after_stmts.
Rename the two remaining callbacks to just before_dom_children and
after_dom_children. Remove other GIMPLE statement walking bits.
* domwalk.c (walk_dominator_tree): Remove now unsupported features.
* graphite.c: Do not include domwalk.h.
* tree-into-ssa.c (interesting_blocks): New global.
(struct mark_def_sites_global_data): Remove it and names_to_rename.
(mark_def_sites, rewrite_stmt, rewrite_add_phi_arguments,
rewrite_update_stmt, rewrite_update_phi_arguments): Simplify
now that they're not domwalk callbacks.
(rewrite_initialize_block): Rename to...
(rewrite_enter_block): ... this, place after called functions. Test
interesting_blocks, call rewrite_stmt and rewrite_add_phi_arguments.
(rewrite_finalize_block): Rename to...
(rewrite_leave_block): ... this, place after called functions.
(rewrite_update_init_block): Rename to...
(rewrite_update_enter_block): ... this, place after called functions.
Test interesting_blocks, call rewrite_update_stmt and
rewrite_update_phi_arguments.
(rewrite_update_fini_block): Rename to...
(rewrite_leave_block): ... this, place after called functions.
(rewrite_blocks): Remove last argument, simplify initialization of
walk_data.
(mark_def_sites_initialize_block): Rename to...
(mark_def_sites_block): ... this, call mark_def_sites.
(mark_def_sites_blocks): Remove argument, simplify initialization of
walk_data.
(rewrite_into_ssa): Adjust for interesting_blocks_being a global.
(update_ssa): Likewise.
* tree-ssa-dom.c (optimize_stmt): Simplify now that it's not a domwalk
callback.
(tree_ssa_dominator_optimize): Simplify initialization of walk_data.
(dom_opt_initialize_block): Rename to...
(dom_opt_enter_block): ... this, place after called functions. Walk
statements here, inline propagate_to_outgoing_edges.
(dom_opt_finalize_block): Rename to...
(dom_opt_leave_block): ... this, place after called functions.
* tree-ssa-dse.c (dse_optimize_stmt): Simplify now that it's not a
domwalk callback.
(dse_enter_block, dse_record_phi): New.
(dse_record_phis): Delete.
(dse_finalize_block): Rename to...
(dse_leave_block): ... this.
(tree_ssa_dse): Simplify initialization of walk_data.
* tree-ssa-loop-im.c (determine_invariantness, move_computations):
Adjust initialization of walk_data.
* tree-ssa-loop-unswitch.c: Do not include domwalk.h.
* tree-ssa-loop-phiopt.c (get_non_trapping):
Adjust initialization of walk_data.
* tree-ssa-loop-threadedge.c: Do not include domwalk.h.
* tree-ssa-uncprop.c (uncprop_into_successor_phis): Simplify now that
it's not a domwalk callback.
(uncprop_initialize_block): Rename to...
(dse_enter_block): ... this, call uncprop_into_successor_phis.
(dse_finalize_block): Rename to...
(dse_leave_block): ... this.
(tree_ssa_uncprop): Simplify initialization of walk_data.
* Makefile.in: Adjust dependencies.
From-SVN: r149008
2009-06-27 16:45:51 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2013-09-19 14:49:30 +02:00
|
|
|
/* These remove expressions local to BB from the tables. */
|
2015-09-15 19:03:49 +02:00
|
|
|
avail_exprs_stack->pop_to_marker ();
|
2015-04-17 21:24:17 +02:00
|
|
|
const_and_copies->pop_to_marker ();
|
domwalk.h (struct dom_walk_data): Remove all callbacks except before_dom_children_before_stmts and...
2009-06-27 Paolo Bonzini <bonzini@gnu.org>
* domwalk.h (struct dom_walk_data): Remove all callbacks except
before_dom_children_before_stmts and after_dom_children_after_stmts.
Rename the two remaining callbacks to just before_dom_children and
after_dom_children. Remove other GIMPLE statement walking bits.
* domwalk.c (walk_dominator_tree): Remove now unsupported features.
* graphite.c: Do not include domwalk.h.
* tree-into-ssa.c (interesting_blocks): New global.
(struct mark_def_sites_global_data): Remove it and names_to_rename.
(mark_def_sites, rewrite_stmt, rewrite_add_phi_arguments,
rewrite_update_stmt, rewrite_update_phi_arguments): Simplify
now that they're not domwalk callbacks.
(rewrite_initialize_block): Rename to...
(rewrite_enter_block): ... this, place after called functions. Test
interesting_blocks, call rewrite_stmt and rewrite_add_phi_arguments.
(rewrite_finalize_block): Rename to...
(rewrite_leave_block): ... this, place after called functions.
(rewrite_update_init_block): Rename to...
(rewrite_update_enter_block): ... this, place after called functions.
Test interesting_blocks, call rewrite_update_stmt and
rewrite_update_phi_arguments.
(rewrite_update_fini_block): Rename to...
(rewrite_leave_block): ... this, place after called functions.
(rewrite_blocks): Remove last argument, simplify initialization of
walk_data.
(mark_def_sites_initialize_block): Rename to...
(mark_def_sites_block): ... this, call mark_def_sites.
(mark_def_sites_blocks): Remove argument, simplify initialization of
walk_data.
(rewrite_into_ssa): Adjust for interesting_blocks_being a global.
(update_ssa): Likewise.
* tree-ssa-dom.c (optimize_stmt): Simplify now that it's not a domwalk
callback.
(tree_ssa_dominator_optimize): Simplify initialization of walk_data.
(dom_opt_initialize_block): Rename to...
(dom_opt_enter_block): ... this, place after called functions. Walk
statements here, inline propagate_to_outgoing_edges.
(dom_opt_finalize_block): Rename to...
(dom_opt_leave_block): ... this, place after called functions.
* tree-ssa-dse.c (dse_optimize_stmt): Simplify now that it's not a
domwalk callback.
(dse_enter_block, dse_record_phi): New.
(dse_record_phis): Delete.
(dse_finalize_block): Rename to...
(dse_leave_block): ... this.
(tree_ssa_dse): Simplify initialization of walk_data.
* tree-ssa-loop-im.c (determine_invariantness, move_computations):
Adjust initialization of walk_data.
* tree-ssa-loop-unswitch.c: Do not include domwalk.h.
* tree-ssa-loop-phiopt.c (get_non_trapping):
Adjust initialization of walk_data.
* tree-ssa-loop-threadedge.c: Do not include domwalk.h.
* tree-ssa-uncprop.c (uncprop_into_successor_phis): Simplify now that
it's not a domwalk callback.
(uncprop_initialize_block): Rename to...
(dse_enter_block): ... this, call uncprop_into_successor_phis.
(dse_finalize_block): Rename to...
(dse_leave_block): ... this.
(tree_ssa_uncprop): Simplify initialization of walk_data.
* Makefile.in: Adjust dependencies.
From-SVN: r149008
2009-06-27 16:45:51 +02:00
|
|
|
}
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
/* Search for redundant computations in STMT. If any are found, then
|
|
|
|
replace them with the variable holding the result of the computation.
|
|
|
|
|
|
|
|
If safe, record this expression into the available expression hash
|
|
|
|
table. */
|
|
|
|
|
2009-09-26 01:57:01 +02:00
|
|
|
static void
|
2008-07-28 16:33:56 +02:00
|
|
|
eliminate_redundant_computations (gimple_stmt_iterator* gsi)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
tree expr_type;
|
2004-05-13 08:41:07 +02:00
|
|
|
tree cached_lhs;
|
2011-12-08 23:00:38 +01:00
|
|
|
tree def;
|
2008-07-28 16:33:56 +02:00
|
|
|
bool insert = true;
|
|
|
|
bool assigns_var_p = false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
gimple stmt = gsi_stmt (*gsi);
|
|
|
|
|
2011-12-08 23:00:38 +01:00
|
|
|
if (gimple_code (stmt) == GIMPLE_PHI)
|
|
|
|
def = gimple_phi_result (stmt);
|
|
|
|
else
|
|
|
|
def = gimple_get_lhs (stmt);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
/* Certain expressions on the RHS can be optimized away, but can not
|
alias.c, [...]: Fix comment formatting.
* alias.c, basic-block.h, cgraphunit.c, combine.c, domwalk.h,
final.c, gengtype.c, genpreds.c, ggc-page.c, insn-notes.def,
lambda-code.c, loop-unroll.c, modulo-sched.c, pointer-set.c,
pretty-print.c, ra-colorize.c, sbitmap.c, tree-complex.c,
tree-data-ref.c, tree-dfa.c, tree-inline.c, tree-into-ssa.c,
tree-scalar-evolution.c, tree-ssa-dom.c,
tree-ssa-loop-manip.c, tree-ssa-loop-niter.c,
tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-threadupdate.c,
tree-vectorizer.c, vec.h: Fix comment formatting.
From-SVN: r89453
2004-10-22 19:05:11 +02:00
|
|
|
themselves be entered into the hash tables. */
|
2005-12-19 01:12:14 +01:00
|
|
|
if (! def
|
2004-05-13 08:41:07 +02:00
|
|
|
|| TREE_CODE (def) != SSA_NAME
|
|
|
|
|| SSA_NAME_OCCURS_IN_ABNORMAL_PHI (def)
|
re PR middle-end/13146 (inheritance for nonoverlapping_component_refs_p)
2009-04-03 Richard Guenther <rguenther@suse.de>
PR middle-end/13146
PR tree-optimization/23940
PR tree-optimization/33237
PR middle-end/33974
PR middle-end/34093
PR tree-optimization/36201
PR tree-optimization/36230
PR tree-optimization/38049
PR tree-optimization/38207
PR tree-optimization/38230
PR tree-optimization/38301
PR tree-optimization/38585
PR middle-end/38895
PR tree-optimization/38985
PR tree-optimization/39299
* tree-ssa-structalias.h: Remove.
* tree-ssa-operands.h (NULL_USE_OPERAND_P): Make of type use_operand_p.
(NULL_DEF_OPERAND_P): Make of type def_operand_p.
(struct vuse_element_d): Remove.
(struct vuse_vec_d): Likewise.
(VUSE_VECT_NUM_ELEM, VUSE_VECT_ELEMENT_NC, VUSE_ELEMENT_PTR_NC,
VUSE_ELEMENT_VAR_NC, VUSE_VECT_ELEMENT, VUSE_ELEMENT_PTR,
SET_VUSE_VECT_ELEMENT, SET_VUSE_ELEMENT_VAR, SET_VUSE_ELEMENT_PTR,
VUSE_ELEMENT_VAR): Likewise.
(struct voptype_d): Likewise.
(NUM_VOP_FREE_BUCKETS): Likewise.
(struct ssa_operands): Remove vop_free_buckets and mpt_table fields.
(struct stmt_operands_d): Remove.
(VUSE_OP_PTR, VUSE_OP, SET_VUSE_OP, VUSE_NUM, VUSE_VECT,
VDEF_RESULT_PTR, VDEF_RESULT, VDEF_OP_PTR, VDEF_OP, SET_VDEF_OP,
VDEF_NUM, VDEF_VECT): Likewise.
(copy_virtual_operands): Remove.
(operand_build_cmp): Likewise.
(create_ssa_artificial_load_stmt): Likewise.
(enum ssa_op_iter_type): Remove ssa_op_iter_vdef.
(struct ssa_operand_iterator_d): Remove vuses, vdefs, mayusesm
vuse_index and mayuse_index members. Pack and move done and iter_type
members to the front.
(SSA_OP_VMAYUSE): Remove.
(SSA_OP_VIRTUAL_USES): Adjust.
(FOR_EACH_SSA_VDEF_OPERAND): Remove.
(unlink_stmt_vdef): Declare.
(add_to_addressable_set): Remove.
* tree-vrp.c (stmt_interesting_for_vrp): Adjust.
(vrp_visit_stmt): Likewise.
* doc/tree-ssa.texi (Alias analysis): Update.
* doc/invoke.texi (max-aliased-vops): Remove docs.
(avg-aliased-vops): Likewise.
* tree-into-ssa.c (syms_to_rename): Remove.
(need_to_update_vops_p): Likewise.
(need_to_initialize_update_ssa_p): Rename to ...
(update_ssa_initialized_fn): ... this. Track function we are
initialized for.
(symbol_marked_for_renaming): Simplify.
(add_new_name_mapping): Do not set need_to_update_vops_p.
(dump_currdefs): Use SYMS_TO_RENAME.
(rewrite_update_stmt): Always walk all uses/defs.
(dump_update_ssa): Adjust.
(init_update_ssa): Take function argument. Track what we are
initialized for.
(delete_update_ssa): Reset SYMS_TO_RENAME and update_ssa_initialized_fn.
(create_new_def_for): Initialize for cfun, assert we are initialized
for cfun.
(mark_sym_for_renaming): Simplify.
(mark_set_for_renaming): Do not initialize update-ssa.
(need_ssa_update_p): Simplify. Take function argument.
(name_mappings_registered_p): Assert we ask for the correct function.
(name_registered_for_update_p): Likewise.
(ssa_names_to_replace): Likewise.
(release_ssa_name_after_update_ssa): Likewise.
(update_ssa): Likewise. Use SYMS_TO_RENAME.
(dump_decl_set): Do not print a newline.
(debug_decl_set): Do it here.
(dump_update_ssa): And here.
* tree-ssa-loop-im.c (move_computations): Adjust.
(movement_possibility): Likewise.
(determine_max_movement): Likewise.
(gather_mem_refs_stmt): Likewise.
* tree-dump.c (dequeue_and_dump): Do not handle SYMBOL_MEMORY_TAG
or NAME_MEMORY_TAG.
* tree-complex.c (update_all_vops): Remove.
(expand_complex_move): Adjust.
* tree-ssa-loop-niter.c (chain_of_csts_start): Use NULL_TREE.
Simplify test for memory referencing statement. Exclude
non-invariant ADDR_EXPRs.
* tree-pretty-print.c (dump_generic_node): Do not handle memory tags.
* tree-loop-distribution.c (generate_memset_zero): Adjust.
(rdg_flag_uses): Likewise.
* tree-tailcall.c (suitable_for_tail_opt_p): Remove memory-tag
related code.
(tree_optimize_tail_calls_1): Also split the
edge from the entry block if we have degenerate PHI nodes in
the first basic block.
* tree.c (init_ttree): Remove memory-tag related code.
(tree_code_size): Likewise.
(tree_node_structure): Likewise.
(build7_stat): Re-write to be build6_stat.
* tree.h (MTAG_P, TREE_MEMORY_TAG_CHECK, TMR_TAG): Remove.
(SSA_VAR_P): Adjust.
(struct tree_memory_tag): Remove.
(struct tree_memory_partition_tag): Likewise.
(union tree_node): Adjust.
(build7): Re-write to be build6.
* tree-pass.h (pass_reset_cc_flags): Remove.
(TODO_update_address_taken): New flag.
(pass_simple_dse): Remove.
* ipa-cp.c (ipcp_update_callgraph): Update SSA form.
* params.h (MAX_ALIASED_VOPS): Remove.
(AVG_ALIASED_VOPS): Likewise.
* omp-low.c (expand_omp_taskreg): Update SSA form.
* tree-ssa-dse.c (dse_optimize_stmt): Properly query if the rhs
aliases the lhs in a copy stmt.
* tree-ssa-dse.c (struct address_walk_data): Remove.
(memory_ssa_name_same): Likewise.
(memory_address_same): Likewise.
(get_kill_of_stmt_lhs): Likewise.
(dse_possible_dead_store_p): Simplify, use the oracle. Handle
unused stores. Look through PHI nodes into post-dominated regions.
(dse_optimize_stmt): Simplify. Properly remove stores.
(tree_ssa_dse): Compute dominators.
(execute_simple_dse): Remove.
(pass_simple_dse): Likewise.
* ipa-reference.c (scan_stmt_for_static_refs): Open-code
gimple_loaded_syms and gimple_stored_syms computation.
* toplev.c (dump_memory_report): Dump alias and pta stats.
* tree-ssa-sccvn.c (vn_reference_compute_hash): Simplify.
(vn_reference_eq): Likewise.
(vuses_to_vec, copy_vuses_from_stmt, vdefs_to_vec,
copy_vdefs_from_stmt, shared_lookup_vops, shared_vuses_from_stmt,
valueize_vuses): Remove.
(get_def_ref_stmt_vuses): Simplify. Rename to ...
(get_def_ref_stmt_vuse): ... this.
(vn_reference_lookup_2): New function.
(vn_reference_lookup_pieces): Use walk_non_aliased_vuses for
walking equivalent vuses. Simplify.
(vn_reference_lookup): Likewise.
(vn_reference_insert): Likewise.
(vn_reference_insert_pieces): Likewise.
(visit_reference_op_call): Simplify.
(visit_reference_op_load): Likewise.
(visit_reference_op_store): Likewise.
(init_scc_vn): Remove shared_lookup_vuses initialization.
(free_scc_vn): Remove shared_lookup_vuses freeing.
(sort_vuses, sort_vuses_heap): Remove.
(get_ref_from_reference_ops): Export.
* tree-ssa-sccvn.h (struct vn_reference_s): Replace vuses
vector with single vuse pointer.
(vn_reference_lookup_pieces, vn_reference_lookup,
vn_reference_insert, vn_reference_insert_pieces): Adjust prototypes.
(shared_vuses_from_stmt): Remove.
(get_ref_from_reference_ops): Declare.
* tree-ssa-loop-manip.c (slpeel_can_duplicate_loop_p): Adjust.
* tree-ssa-copyrename.c (copy_rename_partition_coalesce): Remove
memory-tag related code.
* tree-ssa-ccp.c (get_symbol_constant_value): Remove memory-tag code.
(likely_value): Add comment, skip static-chain of call statements.
(surely_varying_stmt_p): Adjust.
(gimplify_and_update_call_from_tree): Likewise.
(execute_fold_all_builtins): Do not rebuild alias info.
(gimplify_and_update_call_from_tree): Properly update VOPs.
* tree-ssa-loop-ivopts.c (get_ref_tag): Remove.
(copy_ref_info): Remove memory-tag related code.
* tree-call-cdce.c (tree_call_cdce): Rename the VOP.
* ipa-pure-const.c (check_decl): Remove memory-tag related code.
(check_stmt): Open-code gimple_loaded_syms and gimple_stored_syms
computation.
* tree-ssa-dom.c (gimple_p): Remove typedef.
(eliminate_redundant_computations): Adjust.
(record_equivalences_from_stmt): Likewise.
(avail_expr_hash): Likewise.
(avail_expr_eq): Likewise.
* tree-ssa-propagate.c (update_call_from_tree): Properly
update VOPs.
(stmt_makes_single_load): Likewise.
(stmt_makes_single_store): Likewise.
* tree-ssa-alias.c: Rewrite completely.
(debug_memory_partitions, dump_mem_ref_stats, debug_mem_ref_stats,
debug_mem_sym_stats, dump_mem_sym_stats_for_var,
debug_all_mem_sym_stats, debug_mp_info, update_mem_sym_stats_from_stmt,
delete_mem_ref_stats, create_tag_raw, dump_points_to_info,
dump_may_aliases_for, debug_may_aliases_for, new_type_alias):
Remove public functions.
(pass_reset_cc_flags): Remove.
(pass_build_alias): Move ...
* tree-ssa-structalias.c (pass_build_alias): ... here.
* tree-ssa-alias.c (may_be_aliased): Move ...
* tree-flow-inline.h (may_be_aliased): ... here.
tree-ssa-alias.c (struct count_ptr_d, count_ptr_derefs,
count_uses_and_derefs): Move ...
* gimple.c: ... here.
* gimple.h (count_uses_and_derefs): Declare.
* tree-ssa-alias.c (dump_alias_stats, ptr_deref_may_alias_global_p,
ptr_deref_may_alias_decl_p, ptr_derefs_may_alias_p,
same_type_for_tbaa, nonaliasing_component_refs_p, decl_refs_may_alias_p,
indirect_ref_may_alias_decl_p, indirect_refs_may_alias_p,
ref_maybe_used_by_call_p, ref_maybe_used_by_stmt_p,
call_may_clobber_ref_p, stmt_may_clobber_ref_p, maybe_skip_until,
get_continuation_for_phi, walk_non_aliased_vuses, walk_aliased_vdefs):
New functions.
* tree-dfa.c (refs_may_alias_p): Move ...
* tree-ssa-alias.c (refs_may_alias_p): ... here. Extend.
* tree-ssa-alias.h: New file.
* tree-ssa-sink.c (is_hidden_global_store): Adjust.
(statement_sink_location): Likewise.
* opts.c (decode_options): Do not adjust max-aliased-vops or
avg-aliased-vops values.
* timevar.def (TV_TREE_MAY_ALIAS): Remove.
(TV_CALL_CLOBBER): Likewise.
(TV_FLOW_SENSITIVE): Likewise.
(TV_FLOW_INSENSITIVE): Likewise.
(TV_MEMORY_PARTITIONING): Likewise.
(TV_ALIAS_STMT_WALK): New timevar.
* tree-ssa-loop-ivcanon.c (empty_loop_p): Adjust.
* tree-ssa-address.c (create_mem_ref_raw): Use build6.
(get_address_description): Remove memory-tag related code.
* tree-ssa-ifcombine.c (bb_no_side_effects_p): Adjust.
* treestruct.def (TS_MEMORY_TAG, TS_MEMORY_PARTITION_TAG): Remove.
* tree-eh.c (cleanup_empty_eh): Do not leave stale SSA_NAMEs
and immediate uses in statements. Document.
* gimple-pretty-print.c (dump_gimple_mem_ops): Adjust.
(dump_symbols): Remove.
(dump_gimple_mem_ops): Do not dump loaded or stored syms.
* alias.c (get_deref_alias_set): New function split out from ...
(get_alias_set): ... here.
* alias.h (get_deref_alias_set): Declare.
* tree-vect-data-refs.c (vect_create_data_ref_ptr): Remove unused
type parameter. Remove restrict pointer handling. Create a
ref-all pointer in case type-based alias sets do not conflict.
(vect_analyze_data_refs): Remove SMT related code.
* tree-vect-stmts.c (vectorizable_store): Re-instantiate TBAA assert.
(vectorizable_load): Likewise.
* tree-data-ref.h (struct dr_alias): Remove symbol_tag field.
(DR_SYMBOL_TAG, DR_VOPS): Remove.
* tree-data-ref.c (dr_may_alias_p): Use the alias-oracle.
Ignore vops and SMTs.
(dr_analyze_alias): Likewise..
(free_data_ref): Likewise.
(create_data_ref): Likewise.
(analyze_all_data_dependences): Likewise.
(get_references_in_stmt): Adjust.
* tree-flow-inline.h (gimple_aliases_computed_p,
gimple_addressable_vars, gimple_call_clobbered_vars,
gimple_call_used_vars, gimple_global_var, may_aliases, memory_partition,
factoring_name_p, mark_call_clobbered, clear_call_clobbered,
compare_ssa_operands_equal, symbol_mem_tag, set_symbol_mem_tag,
gimple_mem_ref_stats): Remove.
(gimple_vop): New function.
(op_iter_next_use): Remove vuses and mayuses cases.
(op_iter_next_def): Remove vdefs case.
(op_iter_next_tree): Remove vuses, mayuses and vdefs cases.
(clear_and_done_ssa_iter): Do not set removed fields.
(op_iter_init): Likewise. Skip vuse and/or vdef if requested.
Assert we are not iterating over vuses or vdefs if not also
iterating over uses or defs.
(op_iter_init_use): Likewise.
(op_iter_init_def): Likewise.
(op_iter_next_vdef): Remove.
(op_iter_next_mustdef): Likewise.
(op_iter_init_vdef): Likewise.
(compare_ssa_operands_equal): Likewise.
(link_use_stmts_after): Handle vuse operand.
(is_call_used): Use is_call_clobbered.
(is_call_clobbered): Global variables are always call clobbered,
query the call-clobbers bitmap.
(mark_call_clobbered): Ignore global variables.
(clear_call_clobbered): Likewise.
* tree-ssa-coalesce.c (create_outofssa_var_map): Adjust
virtual operands sanity check.
* tree.def (NAME_MEMORY_TAG, SYMBOL_MEMORY_TAG, MEMORY_PARTITION_TAG):
Remove.
(TARGET_MEM_REF): Remove TMR_TAG operand.
* tree-dfa.c (add_referenced_var): Initialize call-clobber state.
Remove call-clobber related code.
(remove_referenced_var): Likewise. Do not clear mpt or symbol_mem_tag.
(dump_variable): Do not dump SMTs, memory stats, may-aliases or
partitions or escape reason.
(get_single_def_stmt, get_single_def_stmt_from_phi,
get_single_def_stmt_with_phi): Remove.
(dump_referenced_vars): Tidy.
(get_ref_base_and_extent): Allow bare decls.
(collect_dfa_stats): Adjust.
* graphite.c (rename_variables_in_stmt): Adjust.
(graphite_copy_stmts_from_block): Likewise.
(translate_clast): Likewise.
* tree-ssa-pre.c (struct bb_bitmap_sets): Add expr_dies bitmap.
(EXPR_DIES): New.
(translate_vuse_through_block): Use the oracle.
(phi_translate_1): Adjust.
(value_dies_in_block_x): Use the oracle. Cache the outcome
in EXPR_DIES.
(valid_in_sets): Check if the VUSE for
a REFERENCE is available.
(eliminate): Do not remove stmts during elimination,
instead queue and remove them afterwards.
(do_pre): Do not rebuild alias info.
(pass_pre): Run TODO_rebuild_alias before PRE.
* tree-ssa-live.c (remove_unused_locals): Remove memory-tag code.
* tree-sra.c (sra_walk_function): Use gimple_references_memory_p.
(mark_all_v_defs_stmt): Remove.
(mark_all_v_defs_seq): Adjust.
(sra_replace): Likewise.
(scalarize_use): Likewise.
(scalarize_copy): Likewise.
(scalarize_init): Likewise.
(scalarize_ldst): Likewise.
(todoflags): Remove.
(tree_sra): Do not rebuild alias info.
(tree_sra_early): Adjust.
(pass_sra): Run TODO_update_address_taken before SRA.
* tree-predcom.c (set_alias_info): Remove.
(prepare_initializers_chain): Do not call it.
(mark_virtual_ops_for_renaming): Adjust.
(mark_virtual_ops_for_renaming_list): Remove.
(initialize_root_vars): Adjust.
(initialize_root_vars_lm): Likewise.
(prepare_initializers_chain): Likewise.
* tree-ssa-copy.c (may_propagate_copy): Remove memory-tag related code.
(may_propagate_copy_into_stmt): Likewise.
(merge_alias_info): Do nothing for now.
(propagate_tree_value_into_stmt): Adjust.
(stmt_may_generate_copy): Likewise.
* tree-ssa-forwprop.c (tidy_after_forward_propagate_addr): Do
not mark symbols for renaming.
(forward_propagate_addr_expr): Match up push/pop_stmt_changes
with the same statement, make sure to update the new pointed-to one.
* tree-ssa-dce.c (eliminate_unnecessary_stmts): Do not copy
call statements, do not mark symbols for renaming.
(mark_operand_necessary): Dump something.
(ref_may_be_aliased): New function.
(mark_aliased_reaching_defs_necessary_1): New helper function.
(mark_aliased_reaching_defs_necessary): Likewise.
(mark_all_reaching_defs_necessary_1): Likewise.
(mark_all_reaching_defs_necessary): Likewise.
(propagate_necessity): Do not process virtual PHIs. For
non-aliased loads mark all reaching definitions as necessary.
For aliased loads and stores mark the immediate dominating
aliased clobbers as necessary.
(visited): New global static.
(perform_tree_ssa_dce): Free visited bitmap after propagating
necessity.
(remove_dead_phis): Perform simple dead virtual PHI removal.
(remove_dead_stmt): Properly unlink virtual operands when
removing stores.
(eliminate_unnecessary_stmts): Schedule PHI removal after
stmt removal.
* tree-ssa-ter.c (is_replaceable_p): Adjust.
(process_replaceable): Likewise.
(find_replaceable_in_bb): Likewise.
* tree-ssa.c (verify_ssa_name): Verify all VOPs are
based on the single gimple vop.
(verify_flow_insensitive_alias_info): Remove.
(verify_flow_sensitive_alias_info): Likewise.
(verify_call_clobbering): Likewise.
(verify_memory_partitions): Likewise.
(verify_alias_info): Likewise.
(verify_ssa): Adjust..
(execute_update_addresses_taken): Export. Update SSA
manually. Optimize only when optimizing. Use a local bitmap.
(pass_update_address_taken): Remove TODO_update_ssa, add
TODO_dump_func.
(pass_update_address_taken): Just use TODO_update_address_taken.
(init_tree_ssa): Do not initialize addressable_vars.
(verify_ssa): Verify new VUSE / VDEF properties.
Verify that all stmts definitions have the stmt as SSA_NAME_DEF_STMT.
Do not call verify_alias_info.
(delete_tree_ssa): Clear the VUSE, VDEF operands.
Do not free the loaded and stored syms bitmaps. Reset the escaped
and callused solutions. Do not free addressable_vars.
Remove memory-tag related code.
(warn_uninitialized_var): Aliases are always available.
* tree-ssa-loop-prefetch.c (gather_memory_references): Adjust.
* lambda-code.c (can_put_in_inner_loop): Adjust.
(can_put_after_inner_loop): Likewise.
(perfect_nestify): Likewise.
* tree-vect-stmts.c (vect_stmt_relevant_p): Adjust.
(vect_gen_widened_results_half): Remove CALL_EXPR handling.
(vectorizable_conversion): Do not mark symbols for renaming.
* tree-inline.c (remap_gimple_stmt): Clear VUSE/VDEF.
(expand_call_inline): Unlink the calls virtual operands before
replacing it.
(tree_function_versioning): Do not call update_ssa if we are not
updating clones. Simplify.
* tree-ssa-phiprop.c (phivn_valid_p): Adjust.
(propagate_with_phi): Likewise..
* tree-outof-ssa.c (create_temp): Remove memory tag and call
clobber code. Assert we are not aliased or global.
* tree-flow.h: Include tree-ssa-alias.h
(enum escape_type): Remove.
(struct mem_sym_stats_d): Likewise.
(struct mem_ref_stats_d): Likewise.
(struct gimple_df): Add vop member. Remove global_var,
call_clobbered_vars, call_used_vars, addressable_vars,
aliases_compted_p and mem_ref_stats members. Add syms_to_rename,
escaped and callused members.
(struct ptr_info_def): Remove all members, add points-to solution
member pt.
(struct var_ann_d): Remove in_vuse_list, in_vdef_list,
call_clobbered, escape_mask, mpt and symbol_mem_tag members.
* Makefile.in (TREE_FLOW_H): Add tree-ssa-alias.h.
(tree-ssa-structalias.o): Remove tree-ssa-structalias.h.
(tree-ssa-alias.o): Likewise.
(toplev.o): Add tree-ssa-alias.h
(GTFILES): Remove tree-ssa-structalias.h, add tree-ssa-alias.h.
* gimple.c (gimple_set_bb): Fix off-by-one error.
(is_gimple_reg): Do not handle memory tags.
(gimple_copy): Also copy virtual operands.
Delay updating the statement. Do not reset loaded and stored syms.
(gimple_set_stored_syms): Remove.
(gimple_set_loaded_syms): Likewise.
(gimple_call_copy_skip_args): Copy the virtual operands
and mark the new statement modified.
* tree-ssa-structalias.c (may_alias_p): Remove.
(set_uids_in_ptset): Take the alias set to prune with as
parameter. Fold in the alias test of may_alias_p.
(compute_points_to_sets): Compute whether a ptr is dereferenced
in a local sbitmap.
(process_constraint): Deal with &ANYTHING on the lhs, reject all
other ADDRESSOF constraints on the lhs.
(get_constraint_for_component_ref): Assert that we don't get
ADDRESSOF constraints from the base of the reference.
Properly generate UNKNOWN_OFFSET for DEREF if needed.
(struct variable_info): Remove collapsed_to member.
(get_varinfo_fc): Remove.
(new_var_info): Do not set collapsed_to.
(dump_constraint): Do not follow cycles.
(dump_constraint_graph): Likewise.
(build_pred_graph): Likewise.
(build_succ_graph): Likewise.
(rewrite_constraints): Likewise.
(do_simple_structure_copy): Remove.
(do_rhs_deref_structure_copy): Remove.
(do_lhs_deref_structure_copy): Remove.
(collapse_rest_of_var): Remove.
(do_structure_copy): Re-implement.
(pta_stats): New global variable.
(dump_pta_stats): New function.
(struct constraint_expr): Make offset signed.
(UNKNOWN_OFFSET): Define special value.
(dump_constraint): Dump UNKNOWN_OFFSET as UNKNOWN.
(solution_set_expand): New helper function split out from ...
(do_sd_constraint): ... here.
(solution_set_add): Handle UNKNOWN_OFFSET. Handle negative offsets.
(do_ds_constraint): Likewise.
(do_sd_constraint): Likewise. Do not special-case ESCAPED = *ESCAPED
and CALLUSED = *CALLUSED.
(set_union_with_increment): Make inc argument signed.
(type_safe): Remove.
(get_constraint_for_ptr_offset): Handle unknown and negative
constant offsets.
(first_vi_for_offset): Handle offsets before start. Bail
out early for offsets beyond the variable extent.
(first_or_preceding_vi_for_offset): New function.
(init_base_vars): Add ESCAPED = ESCAPED + UNKNOWN_OFFSET constraint.
Together with ESCAPED = *ESCAPED this properly computes reachability.
(find_what_var_points_to): New function.
(find_what_p_points_to): Implement in terms of find_what_var_points_to.
(pt_solution_reset, pt_solution_empty_p, pt_solution_includes_global,
pt_solution_includes_1, pt_solution_includes, pt_solutions_intersect_1,
pt_solutions_intersect): New functions.
(compute_call_used_vars): Remove.
(compute_may_aliases): New main entry into PTA computation.
* gimple.h (gimple_p): New typedef.
(struct gimple_statement_base): Remove references_memory_p.
(struct gimple_statement_with_memory_ops_base): Remove
vdef_ops, vuse_ops, stores and loads members. Add vdef and vuse
members.
(gimple_vuse_ops, gimple_set_vuse_ops, gimple_vdef_ops,
gimple_set_vdef_ops, gimple_loaded_syms, gimple_stored_syms,
gimple_set_references_memory): Remove.
(gimple_vuse_op, gimple_vdef_op, gimple_vuse, gimple_vdef,
gimple_vuse_ptr, gimple_vdef_ptri, gimple_set_vuse, gimple_set_vdef):
New functions.
* tree-cfg.c (move_block_to_fn): Fix off-by-one error.
(verify_expr): Allow RESULT_DECL.
(gimple_duplicate_bb): Do not copy virtual operands.
(gimple_duplicate_sese_region): Adjust.
(gimple_duplicate_sese_tail): Likewise.
(mark_virtual_ops_in_region): Remove.
(move_sese_region_to_fn): Do not call it.
* passes.c (init_optimization_passes): Remove pass_reset_cc_flags
and pass_simple_dse.
(execute_function_todo): Handle TODO_update_address_taken,
call execute_update_addresses_taken for TODO_rebuild_alias.
(execute_todo): Adjust.
(execute_one_pass): Init dump files early.
* ipa-struct-reorg.c (finalize_var_creation): Do not mark vars
call-clobbered.
(create_general_new_stmt): Clear vops.
* tree-ssa-reassoc.c (get_rank): Adjust.
* tree-vect-slp.c (vect_create_mask_and_perm): Do not mark
symbols for renaming.
* params.def (PARAM_MAX_ALIASED_VOPS): Remove.
(PARAM_AVG_ALIASED_VOPS): Likewise.
* tree-ssanames.c (init_ssanames): Allocate SYMS_TO_RENAME.
(duplicate_ssa_name_ptr_info): No need to copy the shared bitmaps.
* tree-ssa-operands.c: Simplify for new virtual operand
representation.
(operand_build_cmp, copy_virtual_operands,
create_ssa_artificial_load_stmt, add_to_addressable_set,
gimple_add_to_addresses_taken): Remove public functions.
(unlink_stmt_vdef): New function.
* gcc.dg/pr19633-1.c: Adjust.
* gcc.dg/torture/pta-callused-1.c: Likewise.
* gcc.dg/torture/pr39074-2.c: Likewise.
* gcc.dg/torture/pr39074.c: Likewise.
* gcc.dg/torture/pta-ptrarith-3.c: New testcase.
* gcc.dg/torture/pr30375.c: Adjust.
* gcc.dg/torture/pr33563.c: Likewise.
* gcc.dg/torture/pr33870.c: Likewise.
* gcc.dg/torture/pr33560.c: Likewise.
* gcc.dg/torture/pta-structcopy-1.c: New testcase.
* gcc.dg/torture/ssa-pta-fn-1.c: Likewise.
* gcc.dg/tree-ssa/alias-15.c: Remove.
* gcc.dg/tree-ssa/ssa-dce-4.c: New testcase.
* gcc.dg/tree-ssa/pr26421.c: Adjust.
* gcc.dg/tree-ssa/ssa-fre-10.c: XFAIL.
* gcc.dg/tree-ssa/ssa-dce-5.c: New testcase.
* gcc.dg/tree-ssa/pr23382.c: Adjust.
* gcc.dg/tree-ssa/ssa-fre-20.c: New testcase.
* gcc.dg/tree-ssa/alias-16.c: Adjust.
* gcc.dg/tree-ssa/ssa-fre-13.c: Likewise.
* gcc.dg/tree-ssa/ssa-fre-14.c: Likewise.
* gcc.dg/tree-ssa/alias-18.c: Likewise.
* gcc.dg/tree-ssa/ssa-fre-15.c: Likewise.
* gcc.dg/tree-ssa/ssa-lim-3.c: Likewise.
* gcc.dg/tree-ssa/alias-19.c: Likewise.
* gcc.dg/tree-ssa/pta-ptrarith-1.c: New testcase.
* gcc.dg/tree-ssa/pr13146.c: Likewise.
* gcc.dg/tree-ssa/ssa-pre-23.c: Likewise.
* gcc.dg/tree-ssa/pta-ptrarith-2.c: Likewise.
* gcc.dg/tree-ssa/ssa-fre-18.c: Likewise.
* gcc.dg/tree-ssa/ssa-pre-24.c: New XFAILed testcase.
* gcc.dg/tree-ssa/ssa-fre-19.c: New testcase.
* gcc.dg/tree-ssa/alias-20.c: Likewise.
* gcc.dg/tree-ssa/ssa-dse-12.c: Likewise.
* gcc.dg/tree-ssa/pr38895.c: Likewise.
* gcc.dg/uninit-B.c: XFAIL.
* gcc.dg/vect/no-vfa-vect-43.c: Adjust.
* gcc.dg/uninit-pr19430.c: XFAIL.
* g++.dg/tree-ssa/pr13146.C: New testcase.
* g++.dg/opt/pr36187.C: Adjust.
* g++.dg/torture/20090329-1.C: New testcase.
From-SVN: r145494
2009-04-03 12:24:28 +02:00
|
|
|
|| gimple_vdef (stmt)
|
2005-02-26 08:55:28 +01:00
|
|
|
/* Do not record equivalences for increments of ivs. This would create
|
|
|
|
overlapping live ranges for a very questionable gain. */
|
|
|
|
|| simple_iv_increment_p (stmt))
|
2004-05-13 08:41:07 +02:00
|
|
|
insert = false;
|
|
|
|
|
|
|
|
/* Check if the expression has been computed before. */
|
2004-09-15 06:38:04 +02:00
|
|
|
cached_lhs = lookup_avail_expr (stmt, insert);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
opt_stats.num_exprs_considered++;
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
/* Get the type of the expression we are trying to optimize. */
|
|
|
|
if (is_gimple_assign (stmt))
|
2005-07-12 19:00:00 +02:00
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
expr_type = TREE_TYPE (gimple_assign_lhs (stmt));
|
|
|
|
assigns_var_p = true;
|
2005-07-12 19:00:00 +02:00
|
|
|
}
|
2008-07-28 16:33:56 +02:00
|
|
|
else if (gimple_code (stmt) == GIMPLE_COND)
|
|
|
|
expr_type = boolean_type_node;
|
|
|
|
else if (is_gimple_call (stmt))
|
2005-07-12 19:00:00 +02:00
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
gcc_assert (gimple_call_lhs (stmt));
|
|
|
|
expr_type = TREE_TYPE (gimple_call_lhs (stmt));
|
|
|
|
assigns_var_p = true;
|
2005-07-12 19:00:00 +02:00
|
|
|
}
|
2014-11-19 18:00:54 +01:00
|
|
|
else if (gswitch *swtch_stmt = dyn_cast <gswitch *> (stmt))
|
|
|
|
expr_type = TREE_TYPE (gimple_switch_index (swtch_stmt));
|
2011-12-08 23:00:38 +01:00
|
|
|
else if (gimple_code (stmt) == GIMPLE_PHI)
|
|
|
|
/* We can't propagate into a phi, so the logic below doesn't apply.
|
|
|
|
Instead record an equivalence between the cached LHS and the
|
|
|
|
PHI result of this statement, provided they are in the same block.
|
|
|
|
This should be sufficient to kill the redundant phi. */
|
|
|
|
{
|
|
|
|
if (def && cached_lhs)
|
2015-04-17 21:24:17 +02:00
|
|
|
const_and_copies->record_const_or_copy (def, cached_lhs);
|
2011-12-08 23:00:38 +01:00
|
|
|
return;
|
|
|
|
}
|
2008-07-28 16:33:56 +02:00
|
|
|
else
|
|
|
|
gcc_unreachable ();
|
|
|
|
|
|
|
|
if (!cached_lhs)
|
2009-09-26 01:57:01 +02:00
|
|
|
return;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
/* It is safe to ignore types here since we have already done
|
|
|
|
type checking in the hashing and equality routines. In fact
|
|
|
|
type checking here merely gets in the way of constant
|
|
|
|
propagation. Also, make sure that it is safe to propagate
|
2008-07-28 16:33:56 +02:00
|
|
|
CACHED_LHS into the expression in STMT. */
|
|
|
|
if ((TREE_CODE (cached_lhs) != SSA_NAME
|
|
|
|
&& (assigns_var_p
|
|
|
|
|| useless_type_conversion_p (expr_type, TREE_TYPE (cached_lhs))))
|
|
|
|
|| may_propagate_copy_into_stmt (stmt, cached_lhs))
|
|
|
|
{
|
basic-block.h (single_succ_edge): Use gcc_checking_assert.
* basic-block.h (single_succ_edge): Use gcc_checking_assert.
(single_pred_edge, ei_container, ei_next, ei_prev): Likewise.
* cfghooks.c (fixup_reorder_chain): Likewise.
* cfgrtl.c (cfg_layout_merge_blocks): Likewise.
* cgraph.c (cgraph_add_thunk): Likewise.
(cgraph_create_edge_1): Likewise.
(cgraph_create_virtual_clone): Likewise.
* ddg.c (add_cross_iteration_register_deps): Likewise.
* dwarf2out.c (modified_type_die): Likewise.
* emit-rtl.c (set_mem_alias_set): Likewise.
* ggc-zone.c (zone_allocate_marks): Likewise.
* gimple-iterator.c (gsi_move_to_bb_end): Likewise.
* gimple.c (iterative_hash_gimple_type): Likewise.
* graphite-scop-detection.c (create_single_entry_edge): Likewise.
(create_single_exit_edge): Likewise.
* haifa-sched.c (choose_ready): Likewise.
* lto-streamer-in.c (input_gimple_stmt): Likewise.
* passes.c (execute_todo): Likewise.
* sched-ebb.c (begin_schedule_ready): Likewise.
* sel-sched.c (code_motion_process_successors): Likewise.
* tree-call-cdce.c (gen_conditions_for_pow): Likewise.
* tree-cfg-cleanup.c (tree_forwarder_block_p): Likewise.
* tree-flow-inline.h (link_imm_use, move_use_after_head): Likewise.
(phi_arg_index_from_use, phi_ssa_name_p): Likewise.
* tree-into-ssa.c (insert_updated_phi_nodes_for): Likewise.
* tree-ssa-coalesce.c (ssa_conflicts_test_p): Likewise.
(ssa_conflicts_add): Likewise.
* tree-ssa-copy.c (replace_exp): Likewise.
* tree-ssa-dom.c (eliminate_redundant_computations): Likewise.
* tree-ssa-forwprop.c (simple_gimple_switch): Likewise.
* tree-ssa-math-opts.c (execute_cse_reciprocals): Likewise.
* tree-ssa-pre.c (bitmap_value_insert_into_set): Likewise.
(compute_antic): Likewise.
* tree-ssa-ter.c (add_to_partition_kill_list): Likewise.
(add_dependence): Likewise.
(process_replaceable, kill_expr, find_replaceable_exprs): Likewise.
* tree-vrp.c (supports_overflow_infinity): Likewise.
(make_overflow_infinity, negative_overflow_infinity): Likewise.
(avoid_overflow_infinity, register_new_assert_for): Likewise.
(process_assert_insertions_for): Likewise.
* var-tracking.c (dv_is_value_p, dv_as_decl, dv_from_decl): Likewise.
(dv_from_value, variable_union, find_loc_in_1pdv): Likewise.
(intersect_loc_chains, variable_merge_over_cur): Likewise.
From-SVN: r165774
2010-10-21 15:08:28 +02:00
|
|
|
gcc_checking_assert (TREE_CODE (cached_lhs) == SSA_NAME
|
|
|
|
|| is_gimple_min_invariant (cached_lhs));
|
2008-07-28 16:33:56 +02:00
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
if (dump_file && (dump_flags & TDF_DETAILS))
|
|
|
|
{
|
|
|
|
fprintf (dump_file, " Replaced redundant expr '");
|
2008-07-28 16:33:56 +02:00
|
|
|
print_gimple_expr (dump_file, stmt, 0, dump_flags);
|
2004-05-13 08:41:07 +02:00
|
|
|
fprintf (dump_file, "' with '");
|
|
|
|
print_generic_expr (dump_file, cached_lhs, dump_flags);
|
2008-07-28 16:33:56 +02:00
|
|
|
fprintf (dump_file, "'\n");
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
opt_stats.num_re++;
|
2009-11-25 11:55:54 +01:00
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
if (assigns_var_p
|
|
|
|
&& !useless_type_conversion_p (expr_type, TREE_TYPE (cached_lhs)))
|
|
|
|
cached_lhs = fold_convert (expr_type, cached_lhs);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
propagate_tree_value_into_stmt (gsi, cached_lhs);
|
|
|
|
|
|
|
|
/* Since it is always necessary to mark the result as modified,
|
|
|
|
perhaps we should move this into propagate_tree_value_into_stmt
|
|
|
|
itself. */
|
|
|
|
gimple_set_modified (gsi_stmt (*gsi), true);
|
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
/* STMT, a GIMPLE_ASSIGN, may create certain equivalences, in either
|
2004-05-13 08:41:07 +02:00
|
|
|
the available expressions table or the const_and_copies table.
|
|
|
|
Detect and record those equivalences. */
|
2008-07-28 16:33:56 +02:00
|
|
|
/* We handle only very simple copy equivalences here. The heavy
|
|
|
|
lifing is done by eliminate_redundant_computations. */
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
static void
|
2008-07-28 16:33:56 +02:00
|
|
|
record_equivalences_from_stmt (gimple stmt, int may_optimize_p)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
tree lhs;
|
|
|
|
enum tree_code lhs_code;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
gcc_assert (is_gimple_assign (stmt));
|
|
|
|
|
|
|
|
lhs = gimple_assign_lhs (stmt);
|
|
|
|
lhs_code = TREE_CODE (lhs);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
if (lhs_code == SSA_NAME
|
2009-04-17 14:43:02 +02:00
|
|
|
&& gimple_assign_single_p (stmt))
|
2008-07-28 16:33:56 +02:00
|
|
|
{
|
|
|
|
tree rhs = gimple_assign_rhs1 (stmt);
|
2009-11-25 11:55:54 +01:00
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
/* If the RHS of the assignment is a constant or another variable that
|
|
|
|
may be propagated, register it in the CONST_AND_COPIES table. We
|
|
|
|
do not need to record unwind data for this, since this is a true
|
c-common.c, [...]: Fix comment typos.
* c-common.c, calls.c, cfgcleanup.c, cgraph.c, cgraphunit.c,
ddg.c, ddg.h, df.c, df.h, except.c, expr.c, flags.h,
fold-const.c, gcc.c, gimplify.c, haifa-sched.c,
modulo-sched.c, tree-inline.c, tree-into-ssa.c, tree-nested.c,
tree-nrv.c, tree-ssa-ccp.c, tree-ssa-dom.c, tree-ssa-live.c,
tree-ssa-loop.c, tree-ssa-pre.c, tree-tailcall.c, tree.h: Fix
comment typos. Follow spelling conventions.
From-SVN: r82439
2004-05-30 09:12:58 +02:00
|
|
|
assignment and not an equivalence inferred from a comparison. All
|
2004-05-13 08:41:07 +02:00
|
|
|
uses of this ssa name are dominated by this assignment, so unwinding
|
|
|
|
just costs time and space. */
|
|
|
|
if (may_optimize_p
|
|
|
|
&& (TREE_CODE (rhs) == SSA_NAME
|
|
|
|
|| is_gimple_min_invariant (rhs)))
|
2015-04-27 14:46:58 +02:00
|
|
|
{
|
2015-09-01 12:51:43 +02:00
|
|
|
rhs = dom_valueize (rhs);
|
2008-07-28 16:33:56 +02:00
|
|
|
|
2015-04-27 14:46:58 +02:00
|
|
|
if (dump_file && (dump_flags & TDF_DETAILS))
|
|
|
|
{
|
|
|
|
fprintf (dump_file, "==== ASGN ");
|
|
|
|
print_generic_expr (dump_file, lhs, 0);
|
|
|
|
fprintf (dump_file, " = ");
|
|
|
|
print_generic_expr (dump_file, rhs, 0);
|
|
|
|
fprintf (dump_file, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
set_ssa_name_value (lhs, rhs);
|
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2014-11-20 09:40:52 +01:00
|
|
|
/* Make sure we can propagate &x + CST. */
|
|
|
|
if (lhs_code == SSA_NAME
|
|
|
|
&& gimple_assign_rhs_code (stmt) == POINTER_PLUS_EXPR
|
|
|
|
&& TREE_CODE (gimple_assign_rhs1 (stmt)) == ADDR_EXPR
|
|
|
|
&& TREE_CODE (gimple_assign_rhs2 (stmt)) == INTEGER_CST)
|
|
|
|
{
|
|
|
|
tree op0 = gimple_assign_rhs1 (stmt);
|
|
|
|
tree op1 = gimple_assign_rhs2 (stmt);
|
|
|
|
tree new_rhs
|
|
|
|
= build_fold_addr_expr (fold_build2 (MEM_REF,
|
|
|
|
TREE_TYPE (TREE_TYPE (op0)),
|
|
|
|
unshare_expr (op0),
|
|
|
|
fold_convert (ptr_type_node,
|
|
|
|
op1)));
|
|
|
|
if (dump_file && (dump_flags & TDF_DETAILS))
|
|
|
|
{
|
|
|
|
fprintf (dump_file, "==== ASGN ");
|
|
|
|
print_generic_expr (dump_file, lhs, 0);
|
|
|
|
fprintf (dump_file, " = ");
|
|
|
|
print_generic_expr (dump_file, new_rhs, 0);
|
|
|
|
fprintf (dump_file, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
set_ssa_name_value (lhs, new_rhs);
|
|
|
|
}
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
/* A memory store, even an aliased store, creates a useful
|
|
|
|
equivalence. By exchanging the LHS and RHS, creating suitable
|
|
|
|
vops and recording the result in the available expression table,
|
|
|
|
we may be able to expose more redundant loads. */
|
2008-07-28 16:33:56 +02:00
|
|
|
if (!gimple_has_volatile_ops (stmt)
|
|
|
|
&& gimple_references_memory_p (stmt)
|
|
|
|
&& gimple_assign_single_p (stmt)
|
|
|
|
&& (TREE_CODE (gimple_assign_rhs1 (stmt)) == SSA_NAME
|
|
|
|
|| is_gimple_min_invariant (gimple_assign_rhs1 (stmt)))
|
2004-05-13 08:41:07 +02:00
|
|
|
&& !is_gimple_reg (lhs))
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
tree rhs = gimple_assign_rhs1 (stmt);
|
2014-11-19 18:00:54 +01:00
|
|
|
gassign *new_stmt;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2008-03-26 12:09:43 +01:00
|
|
|
/* Build a new statement with the RHS and LHS exchanged. */
|
2008-07-28 16:33:56 +02:00
|
|
|
if (TREE_CODE (rhs) == SSA_NAME)
|
|
|
|
{
|
|
|
|
/* NOTE tuples. The call to gimple_build_assign below replaced
|
|
|
|
a call to build_gimple_modify_stmt, which did not set the
|
|
|
|
SSA_NAME_DEF_STMT on the LHS of the assignment. Doing so
|
|
|
|
may cause an SSA validation failure, as the LHS may be a
|
|
|
|
default-initialized name and should have no definition. I'm
|
|
|
|
a bit dubious of this, as the artificial statement that we
|
|
|
|
generate here may in fact be ill-formed, but it is simply
|
|
|
|
used as an internal device in this pass, and never becomes
|
|
|
|
part of the CFG. */
|
|
|
|
gimple defstmt = SSA_NAME_DEF_STMT (rhs);
|
|
|
|
new_stmt = gimple_build_assign (rhs, lhs);
|
|
|
|
SSA_NAME_DEF_STMT (rhs) = defstmt;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
new_stmt = gimple_build_assign (rhs, lhs);
|
|
|
|
|
re PR middle-end/13146 (inheritance for nonoverlapping_component_refs_p)
2009-04-03 Richard Guenther <rguenther@suse.de>
PR middle-end/13146
PR tree-optimization/23940
PR tree-optimization/33237
PR middle-end/33974
PR middle-end/34093
PR tree-optimization/36201
PR tree-optimization/36230
PR tree-optimization/38049
PR tree-optimization/38207
PR tree-optimization/38230
PR tree-optimization/38301
PR tree-optimization/38585
PR middle-end/38895
PR tree-optimization/38985
PR tree-optimization/39299
* tree-ssa-structalias.h: Remove.
* tree-ssa-operands.h (NULL_USE_OPERAND_P): Make of type use_operand_p.
(NULL_DEF_OPERAND_P): Make of type def_operand_p.
(struct vuse_element_d): Remove.
(struct vuse_vec_d): Likewise.
(VUSE_VECT_NUM_ELEM, VUSE_VECT_ELEMENT_NC, VUSE_ELEMENT_PTR_NC,
VUSE_ELEMENT_VAR_NC, VUSE_VECT_ELEMENT, VUSE_ELEMENT_PTR,
SET_VUSE_VECT_ELEMENT, SET_VUSE_ELEMENT_VAR, SET_VUSE_ELEMENT_PTR,
VUSE_ELEMENT_VAR): Likewise.
(struct voptype_d): Likewise.
(NUM_VOP_FREE_BUCKETS): Likewise.
(struct ssa_operands): Remove vop_free_buckets and mpt_table fields.
(struct stmt_operands_d): Remove.
(VUSE_OP_PTR, VUSE_OP, SET_VUSE_OP, VUSE_NUM, VUSE_VECT,
VDEF_RESULT_PTR, VDEF_RESULT, VDEF_OP_PTR, VDEF_OP, SET_VDEF_OP,
VDEF_NUM, VDEF_VECT): Likewise.
(copy_virtual_operands): Remove.
(operand_build_cmp): Likewise.
(create_ssa_artificial_load_stmt): Likewise.
(enum ssa_op_iter_type): Remove ssa_op_iter_vdef.
(struct ssa_operand_iterator_d): Remove vuses, vdefs, mayusesm
vuse_index and mayuse_index members. Pack and move done and iter_type
members to the front.
(SSA_OP_VMAYUSE): Remove.
(SSA_OP_VIRTUAL_USES): Adjust.
(FOR_EACH_SSA_VDEF_OPERAND): Remove.
(unlink_stmt_vdef): Declare.
(add_to_addressable_set): Remove.
* tree-vrp.c (stmt_interesting_for_vrp): Adjust.
(vrp_visit_stmt): Likewise.
* doc/tree-ssa.texi (Alias analysis): Update.
* doc/invoke.texi (max-aliased-vops): Remove docs.
(avg-aliased-vops): Likewise.
* tree-into-ssa.c (syms_to_rename): Remove.
(need_to_update_vops_p): Likewise.
(need_to_initialize_update_ssa_p): Rename to ...
(update_ssa_initialized_fn): ... this. Track function we are
initialized for.
(symbol_marked_for_renaming): Simplify.
(add_new_name_mapping): Do not set need_to_update_vops_p.
(dump_currdefs): Use SYMS_TO_RENAME.
(rewrite_update_stmt): Always walk all uses/defs.
(dump_update_ssa): Adjust.
(init_update_ssa): Take function argument. Track what we are
initialized for.
(delete_update_ssa): Reset SYMS_TO_RENAME and update_ssa_initialized_fn.
(create_new_def_for): Initialize for cfun, assert we are initialized
for cfun.
(mark_sym_for_renaming): Simplify.
(mark_set_for_renaming): Do not initialize update-ssa.
(need_ssa_update_p): Simplify. Take function argument.
(name_mappings_registered_p): Assert we ask for the correct function.
(name_registered_for_update_p): Likewise.
(ssa_names_to_replace): Likewise.
(release_ssa_name_after_update_ssa): Likewise.
(update_ssa): Likewise. Use SYMS_TO_RENAME.
(dump_decl_set): Do not print a newline.
(debug_decl_set): Do it here.
(dump_update_ssa): And here.
* tree-ssa-loop-im.c (move_computations): Adjust.
(movement_possibility): Likewise.
(determine_max_movement): Likewise.
(gather_mem_refs_stmt): Likewise.
* tree-dump.c (dequeue_and_dump): Do not handle SYMBOL_MEMORY_TAG
or NAME_MEMORY_TAG.
* tree-complex.c (update_all_vops): Remove.
(expand_complex_move): Adjust.
* tree-ssa-loop-niter.c (chain_of_csts_start): Use NULL_TREE.
Simplify test for memory referencing statement. Exclude
non-invariant ADDR_EXPRs.
* tree-pretty-print.c (dump_generic_node): Do not handle memory tags.
* tree-loop-distribution.c (generate_memset_zero): Adjust.
(rdg_flag_uses): Likewise.
* tree-tailcall.c (suitable_for_tail_opt_p): Remove memory-tag
related code.
(tree_optimize_tail_calls_1): Also split the
edge from the entry block if we have degenerate PHI nodes in
the first basic block.
* tree.c (init_ttree): Remove memory-tag related code.
(tree_code_size): Likewise.
(tree_node_structure): Likewise.
(build7_stat): Re-write to be build6_stat.
* tree.h (MTAG_P, TREE_MEMORY_TAG_CHECK, TMR_TAG): Remove.
(SSA_VAR_P): Adjust.
(struct tree_memory_tag): Remove.
(struct tree_memory_partition_tag): Likewise.
(union tree_node): Adjust.
(build7): Re-write to be build6.
* tree-pass.h (pass_reset_cc_flags): Remove.
(TODO_update_address_taken): New flag.
(pass_simple_dse): Remove.
* ipa-cp.c (ipcp_update_callgraph): Update SSA form.
* params.h (MAX_ALIASED_VOPS): Remove.
(AVG_ALIASED_VOPS): Likewise.
* omp-low.c (expand_omp_taskreg): Update SSA form.
* tree-ssa-dse.c (dse_optimize_stmt): Properly query if the rhs
aliases the lhs in a copy stmt.
* tree-ssa-dse.c (struct address_walk_data): Remove.
(memory_ssa_name_same): Likewise.
(memory_address_same): Likewise.
(get_kill_of_stmt_lhs): Likewise.
(dse_possible_dead_store_p): Simplify, use the oracle. Handle
unused stores. Look through PHI nodes into post-dominated regions.
(dse_optimize_stmt): Simplify. Properly remove stores.
(tree_ssa_dse): Compute dominators.
(execute_simple_dse): Remove.
(pass_simple_dse): Likewise.
* ipa-reference.c (scan_stmt_for_static_refs): Open-code
gimple_loaded_syms and gimple_stored_syms computation.
* toplev.c (dump_memory_report): Dump alias and pta stats.
* tree-ssa-sccvn.c (vn_reference_compute_hash): Simplify.
(vn_reference_eq): Likewise.
(vuses_to_vec, copy_vuses_from_stmt, vdefs_to_vec,
copy_vdefs_from_stmt, shared_lookup_vops, shared_vuses_from_stmt,
valueize_vuses): Remove.
(get_def_ref_stmt_vuses): Simplify. Rename to ...
(get_def_ref_stmt_vuse): ... this.
(vn_reference_lookup_2): New function.
(vn_reference_lookup_pieces): Use walk_non_aliased_vuses for
walking equivalent vuses. Simplify.
(vn_reference_lookup): Likewise.
(vn_reference_insert): Likewise.
(vn_reference_insert_pieces): Likewise.
(visit_reference_op_call): Simplify.
(visit_reference_op_load): Likewise.
(visit_reference_op_store): Likewise.
(init_scc_vn): Remove shared_lookup_vuses initialization.
(free_scc_vn): Remove shared_lookup_vuses freeing.
(sort_vuses, sort_vuses_heap): Remove.
(get_ref_from_reference_ops): Export.
* tree-ssa-sccvn.h (struct vn_reference_s): Replace vuses
vector with single vuse pointer.
(vn_reference_lookup_pieces, vn_reference_lookup,
vn_reference_insert, vn_reference_insert_pieces): Adjust prototypes.
(shared_vuses_from_stmt): Remove.
(get_ref_from_reference_ops): Declare.
* tree-ssa-loop-manip.c (slpeel_can_duplicate_loop_p): Adjust.
* tree-ssa-copyrename.c (copy_rename_partition_coalesce): Remove
memory-tag related code.
* tree-ssa-ccp.c (get_symbol_constant_value): Remove memory-tag code.
(likely_value): Add comment, skip static-chain of call statements.
(surely_varying_stmt_p): Adjust.
(gimplify_and_update_call_from_tree): Likewise.
(execute_fold_all_builtins): Do not rebuild alias info.
(gimplify_and_update_call_from_tree): Properly update VOPs.
* tree-ssa-loop-ivopts.c (get_ref_tag): Remove.
(copy_ref_info): Remove memory-tag related code.
* tree-call-cdce.c (tree_call_cdce): Rename the VOP.
* ipa-pure-const.c (check_decl): Remove memory-tag related code.
(check_stmt): Open-code gimple_loaded_syms and gimple_stored_syms
computation.
* tree-ssa-dom.c (gimple_p): Remove typedef.
(eliminate_redundant_computations): Adjust.
(record_equivalences_from_stmt): Likewise.
(avail_expr_hash): Likewise.
(avail_expr_eq): Likewise.
* tree-ssa-propagate.c (update_call_from_tree): Properly
update VOPs.
(stmt_makes_single_load): Likewise.
(stmt_makes_single_store): Likewise.
* tree-ssa-alias.c: Rewrite completely.
(debug_memory_partitions, dump_mem_ref_stats, debug_mem_ref_stats,
debug_mem_sym_stats, dump_mem_sym_stats_for_var,
debug_all_mem_sym_stats, debug_mp_info, update_mem_sym_stats_from_stmt,
delete_mem_ref_stats, create_tag_raw, dump_points_to_info,
dump_may_aliases_for, debug_may_aliases_for, new_type_alias):
Remove public functions.
(pass_reset_cc_flags): Remove.
(pass_build_alias): Move ...
* tree-ssa-structalias.c (pass_build_alias): ... here.
* tree-ssa-alias.c (may_be_aliased): Move ...
* tree-flow-inline.h (may_be_aliased): ... here.
tree-ssa-alias.c (struct count_ptr_d, count_ptr_derefs,
count_uses_and_derefs): Move ...
* gimple.c: ... here.
* gimple.h (count_uses_and_derefs): Declare.
* tree-ssa-alias.c (dump_alias_stats, ptr_deref_may_alias_global_p,
ptr_deref_may_alias_decl_p, ptr_derefs_may_alias_p,
same_type_for_tbaa, nonaliasing_component_refs_p, decl_refs_may_alias_p,
indirect_ref_may_alias_decl_p, indirect_refs_may_alias_p,
ref_maybe_used_by_call_p, ref_maybe_used_by_stmt_p,
call_may_clobber_ref_p, stmt_may_clobber_ref_p, maybe_skip_until,
get_continuation_for_phi, walk_non_aliased_vuses, walk_aliased_vdefs):
New functions.
* tree-dfa.c (refs_may_alias_p): Move ...
* tree-ssa-alias.c (refs_may_alias_p): ... here. Extend.
* tree-ssa-alias.h: New file.
* tree-ssa-sink.c (is_hidden_global_store): Adjust.
(statement_sink_location): Likewise.
* opts.c (decode_options): Do not adjust max-aliased-vops or
avg-aliased-vops values.
* timevar.def (TV_TREE_MAY_ALIAS): Remove.
(TV_CALL_CLOBBER): Likewise.
(TV_FLOW_SENSITIVE): Likewise.
(TV_FLOW_INSENSITIVE): Likewise.
(TV_MEMORY_PARTITIONING): Likewise.
(TV_ALIAS_STMT_WALK): New timevar.
* tree-ssa-loop-ivcanon.c (empty_loop_p): Adjust.
* tree-ssa-address.c (create_mem_ref_raw): Use build6.
(get_address_description): Remove memory-tag related code.
* tree-ssa-ifcombine.c (bb_no_side_effects_p): Adjust.
* treestruct.def (TS_MEMORY_TAG, TS_MEMORY_PARTITION_TAG): Remove.
* tree-eh.c (cleanup_empty_eh): Do not leave stale SSA_NAMEs
and immediate uses in statements. Document.
* gimple-pretty-print.c (dump_gimple_mem_ops): Adjust.
(dump_symbols): Remove.
(dump_gimple_mem_ops): Do not dump loaded or stored syms.
* alias.c (get_deref_alias_set): New function split out from ...
(get_alias_set): ... here.
* alias.h (get_deref_alias_set): Declare.
* tree-vect-data-refs.c (vect_create_data_ref_ptr): Remove unused
type parameter. Remove restrict pointer handling. Create a
ref-all pointer in case type-based alias sets do not conflict.
(vect_analyze_data_refs): Remove SMT related code.
* tree-vect-stmts.c (vectorizable_store): Re-instantiate TBAA assert.
(vectorizable_load): Likewise.
* tree-data-ref.h (struct dr_alias): Remove symbol_tag field.
(DR_SYMBOL_TAG, DR_VOPS): Remove.
* tree-data-ref.c (dr_may_alias_p): Use the alias-oracle.
Ignore vops and SMTs.
(dr_analyze_alias): Likewise..
(free_data_ref): Likewise.
(create_data_ref): Likewise.
(analyze_all_data_dependences): Likewise.
(get_references_in_stmt): Adjust.
* tree-flow-inline.h (gimple_aliases_computed_p,
gimple_addressable_vars, gimple_call_clobbered_vars,
gimple_call_used_vars, gimple_global_var, may_aliases, memory_partition,
factoring_name_p, mark_call_clobbered, clear_call_clobbered,
compare_ssa_operands_equal, symbol_mem_tag, set_symbol_mem_tag,
gimple_mem_ref_stats): Remove.
(gimple_vop): New function.
(op_iter_next_use): Remove vuses and mayuses cases.
(op_iter_next_def): Remove vdefs case.
(op_iter_next_tree): Remove vuses, mayuses and vdefs cases.
(clear_and_done_ssa_iter): Do not set removed fields.
(op_iter_init): Likewise. Skip vuse and/or vdef if requested.
Assert we are not iterating over vuses or vdefs if not also
iterating over uses or defs.
(op_iter_init_use): Likewise.
(op_iter_init_def): Likewise.
(op_iter_next_vdef): Remove.
(op_iter_next_mustdef): Likewise.
(op_iter_init_vdef): Likewise.
(compare_ssa_operands_equal): Likewise.
(link_use_stmts_after): Handle vuse operand.
(is_call_used): Use is_call_clobbered.
(is_call_clobbered): Global variables are always call clobbered,
query the call-clobbers bitmap.
(mark_call_clobbered): Ignore global variables.
(clear_call_clobbered): Likewise.
* tree-ssa-coalesce.c (create_outofssa_var_map): Adjust
virtual operands sanity check.
* tree.def (NAME_MEMORY_TAG, SYMBOL_MEMORY_TAG, MEMORY_PARTITION_TAG):
Remove.
(TARGET_MEM_REF): Remove TMR_TAG operand.
* tree-dfa.c (add_referenced_var): Initialize call-clobber state.
Remove call-clobber related code.
(remove_referenced_var): Likewise. Do not clear mpt or symbol_mem_tag.
(dump_variable): Do not dump SMTs, memory stats, may-aliases or
partitions or escape reason.
(get_single_def_stmt, get_single_def_stmt_from_phi,
get_single_def_stmt_with_phi): Remove.
(dump_referenced_vars): Tidy.
(get_ref_base_and_extent): Allow bare decls.
(collect_dfa_stats): Adjust.
* graphite.c (rename_variables_in_stmt): Adjust.
(graphite_copy_stmts_from_block): Likewise.
(translate_clast): Likewise.
* tree-ssa-pre.c (struct bb_bitmap_sets): Add expr_dies bitmap.
(EXPR_DIES): New.
(translate_vuse_through_block): Use the oracle.
(phi_translate_1): Adjust.
(value_dies_in_block_x): Use the oracle. Cache the outcome
in EXPR_DIES.
(valid_in_sets): Check if the VUSE for
a REFERENCE is available.
(eliminate): Do not remove stmts during elimination,
instead queue and remove them afterwards.
(do_pre): Do not rebuild alias info.
(pass_pre): Run TODO_rebuild_alias before PRE.
* tree-ssa-live.c (remove_unused_locals): Remove memory-tag code.
* tree-sra.c (sra_walk_function): Use gimple_references_memory_p.
(mark_all_v_defs_stmt): Remove.
(mark_all_v_defs_seq): Adjust.
(sra_replace): Likewise.
(scalarize_use): Likewise.
(scalarize_copy): Likewise.
(scalarize_init): Likewise.
(scalarize_ldst): Likewise.
(todoflags): Remove.
(tree_sra): Do not rebuild alias info.
(tree_sra_early): Adjust.
(pass_sra): Run TODO_update_address_taken before SRA.
* tree-predcom.c (set_alias_info): Remove.
(prepare_initializers_chain): Do not call it.
(mark_virtual_ops_for_renaming): Adjust.
(mark_virtual_ops_for_renaming_list): Remove.
(initialize_root_vars): Adjust.
(initialize_root_vars_lm): Likewise.
(prepare_initializers_chain): Likewise.
* tree-ssa-copy.c (may_propagate_copy): Remove memory-tag related code.
(may_propagate_copy_into_stmt): Likewise.
(merge_alias_info): Do nothing for now.
(propagate_tree_value_into_stmt): Adjust.
(stmt_may_generate_copy): Likewise.
* tree-ssa-forwprop.c (tidy_after_forward_propagate_addr): Do
not mark symbols for renaming.
(forward_propagate_addr_expr): Match up push/pop_stmt_changes
with the same statement, make sure to update the new pointed-to one.
* tree-ssa-dce.c (eliminate_unnecessary_stmts): Do not copy
call statements, do not mark symbols for renaming.
(mark_operand_necessary): Dump something.
(ref_may_be_aliased): New function.
(mark_aliased_reaching_defs_necessary_1): New helper function.
(mark_aliased_reaching_defs_necessary): Likewise.
(mark_all_reaching_defs_necessary_1): Likewise.
(mark_all_reaching_defs_necessary): Likewise.
(propagate_necessity): Do not process virtual PHIs. For
non-aliased loads mark all reaching definitions as necessary.
For aliased loads and stores mark the immediate dominating
aliased clobbers as necessary.
(visited): New global static.
(perform_tree_ssa_dce): Free visited bitmap after propagating
necessity.
(remove_dead_phis): Perform simple dead virtual PHI removal.
(remove_dead_stmt): Properly unlink virtual operands when
removing stores.
(eliminate_unnecessary_stmts): Schedule PHI removal after
stmt removal.
* tree-ssa-ter.c (is_replaceable_p): Adjust.
(process_replaceable): Likewise.
(find_replaceable_in_bb): Likewise.
* tree-ssa.c (verify_ssa_name): Verify all VOPs are
based on the single gimple vop.
(verify_flow_insensitive_alias_info): Remove.
(verify_flow_sensitive_alias_info): Likewise.
(verify_call_clobbering): Likewise.
(verify_memory_partitions): Likewise.
(verify_alias_info): Likewise.
(verify_ssa): Adjust..
(execute_update_addresses_taken): Export. Update SSA
manually. Optimize only when optimizing. Use a local bitmap.
(pass_update_address_taken): Remove TODO_update_ssa, add
TODO_dump_func.
(pass_update_address_taken): Just use TODO_update_address_taken.
(init_tree_ssa): Do not initialize addressable_vars.
(verify_ssa): Verify new VUSE / VDEF properties.
Verify that all stmts definitions have the stmt as SSA_NAME_DEF_STMT.
Do not call verify_alias_info.
(delete_tree_ssa): Clear the VUSE, VDEF operands.
Do not free the loaded and stored syms bitmaps. Reset the escaped
and callused solutions. Do not free addressable_vars.
Remove memory-tag related code.
(warn_uninitialized_var): Aliases are always available.
* tree-ssa-loop-prefetch.c (gather_memory_references): Adjust.
* lambda-code.c (can_put_in_inner_loop): Adjust.
(can_put_after_inner_loop): Likewise.
(perfect_nestify): Likewise.
* tree-vect-stmts.c (vect_stmt_relevant_p): Adjust.
(vect_gen_widened_results_half): Remove CALL_EXPR handling.
(vectorizable_conversion): Do not mark symbols for renaming.
* tree-inline.c (remap_gimple_stmt): Clear VUSE/VDEF.
(expand_call_inline): Unlink the calls virtual operands before
replacing it.
(tree_function_versioning): Do not call update_ssa if we are not
updating clones. Simplify.
* tree-ssa-phiprop.c (phivn_valid_p): Adjust.
(propagate_with_phi): Likewise..
* tree-outof-ssa.c (create_temp): Remove memory tag and call
clobber code. Assert we are not aliased or global.
* tree-flow.h: Include tree-ssa-alias.h
(enum escape_type): Remove.
(struct mem_sym_stats_d): Likewise.
(struct mem_ref_stats_d): Likewise.
(struct gimple_df): Add vop member. Remove global_var,
call_clobbered_vars, call_used_vars, addressable_vars,
aliases_compted_p and mem_ref_stats members. Add syms_to_rename,
escaped and callused members.
(struct ptr_info_def): Remove all members, add points-to solution
member pt.
(struct var_ann_d): Remove in_vuse_list, in_vdef_list,
call_clobbered, escape_mask, mpt and symbol_mem_tag members.
* Makefile.in (TREE_FLOW_H): Add tree-ssa-alias.h.
(tree-ssa-structalias.o): Remove tree-ssa-structalias.h.
(tree-ssa-alias.o): Likewise.
(toplev.o): Add tree-ssa-alias.h
(GTFILES): Remove tree-ssa-structalias.h, add tree-ssa-alias.h.
* gimple.c (gimple_set_bb): Fix off-by-one error.
(is_gimple_reg): Do not handle memory tags.
(gimple_copy): Also copy virtual operands.
Delay updating the statement. Do not reset loaded and stored syms.
(gimple_set_stored_syms): Remove.
(gimple_set_loaded_syms): Likewise.
(gimple_call_copy_skip_args): Copy the virtual operands
and mark the new statement modified.
* tree-ssa-structalias.c (may_alias_p): Remove.
(set_uids_in_ptset): Take the alias set to prune with as
parameter. Fold in the alias test of may_alias_p.
(compute_points_to_sets): Compute whether a ptr is dereferenced
in a local sbitmap.
(process_constraint): Deal with &ANYTHING on the lhs, reject all
other ADDRESSOF constraints on the lhs.
(get_constraint_for_component_ref): Assert that we don't get
ADDRESSOF constraints from the base of the reference.
Properly generate UNKNOWN_OFFSET for DEREF if needed.
(struct variable_info): Remove collapsed_to member.
(get_varinfo_fc): Remove.
(new_var_info): Do not set collapsed_to.
(dump_constraint): Do not follow cycles.
(dump_constraint_graph): Likewise.
(build_pred_graph): Likewise.
(build_succ_graph): Likewise.
(rewrite_constraints): Likewise.
(do_simple_structure_copy): Remove.
(do_rhs_deref_structure_copy): Remove.
(do_lhs_deref_structure_copy): Remove.
(collapse_rest_of_var): Remove.
(do_structure_copy): Re-implement.
(pta_stats): New global variable.
(dump_pta_stats): New function.
(struct constraint_expr): Make offset signed.
(UNKNOWN_OFFSET): Define special value.
(dump_constraint): Dump UNKNOWN_OFFSET as UNKNOWN.
(solution_set_expand): New helper function split out from ...
(do_sd_constraint): ... here.
(solution_set_add): Handle UNKNOWN_OFFSET. Handle negative offsets.
(do_ds_constraint): Likewise.
(do_sd_constraint): Likewise. Do not special-case ESCAPED = *ESCAPED
and CALLUSED = *CALLUSED.
(set_union_with_increment): Make inc argument signed.
(type_safe): Remove.
(get_constraint_for_ptr_offset): Handle unknown and negative
constant offsets.
(first_vi_for_offset): Handle offsets before start. Bail
out early for offsets beyond the variable extent.
(first_or_preceding_vi_for_offset): New function.
(init_base_vars): Add ESCAPED = ESCAPED + UNKNOWN_OFFSET constraint.
Together with ESCAPED = *ESCAPED this properly computes reachability.
(find_what_var_points_to): New function.
(find_what_p_points_to): Implement in terms of find_what_var_points_to.
(pt_solution_reset, pt_solution_empty_p, pt_solution_includes_global,
pt_solution_includes_1, pt_solution_includes, pt_solutions_intersect_1,
pt_solutions_intersect): New functions.
(compute_call_used_vars): Remove.
(compute_may_aliases): New main entry into PTA computation.
* gimple.h (gimple_p): New typedef.
(struct gimple_statement_base): Remove references_memory_p.
(struct gimple_statement_with_memory_ops_base): Remove
vdef_ops, vuse_ops, stores and loads members. Add vdef and vuse
members.
(gimple_vuse_ops, gimple_set_vuse_ops, gimple_vdef_ops,
gimple_set_vdef_ops, gimple_loaded_syms, gimple_stored_syms,
gimple_set_references_memory): Remove.
(gimple_vuse_op, gimple_vdef_op, gimple_vuse, gimple_vdef,
gimple_vuse_ptr, gimple_vdef_ptri, gimple_set_vuse, gimple_set_vdef):
New functions.
* tree-cfg.c (move_block_to_fn): Fix off-by-one error.
(verify_expr): Allow RESULT_DECL.
(gimple_duplicate_bb): Do not copy virtual operands.
(gimple_duplicate_sese_region): Adjust.
(gimple_duplicate_sese_tail): Likewise.
(mark_virtual_ops_in_region): Remove.
(move_sese_region_to_fn): Do not call it.
* passes.c (init_optimization_passes): Remove pass_reset_cc_flags
and pass_simple_dse.
(execute_function_todo): Handle TODO_update_address_taken,
call execute_update_addresses_taken for TODO_rebuild_alias.
(execute_todo): Adjust.
(execute_one_pass): Init dump files early.
* ipa-struct-reorg.c (finalize_var_creation): Do not mark vars
call-clobbered.
(create_general_new_stmt): Clear vops.
* tree-ssa-reassoc.c (get_rank): Adjust.
* tree-vect-slp.c (vect_create_mask_and_perm): Do not mark
symbols for renaming.
* params.def (PARAM_MAX_ALIASED_VOPS): Remove.
(PARAM_AVG_ALIASED_VOPS): Likewise.
* tree-ssanames.c (init_ssanames): Allocate SYMS_TO_RENAME.
(duplicate_ssa_name_ptr_info): No need to copy the shared bitmaps.
* tree-ssa-operands.c: Simplify for new virtual operand
representation.
(operand_build_cmp, copy_virtual_operands,
create_ssa_artificial_load_stmt, add_to_addressable_set,
gimple_add_to_addresses_taken): Remove public functions.
(unlink_stmt_vdef): New function.
* gcc.dg/pr19633-1.c: Adjust.
* gcc.dg/torture/pta-callused-1.c: Likewise.
* gcc.dg/torture/pr39074-2.c: Likewise.
* gcc.dg/torture/pr39074.c: Likewise.
* gcc.dg/torture/pta-ptrarith-3.c: New testcase.
* gcc.dg/torture/pr30375.c: Adjust.
* gcc.dg/torture/pr33563.c: Likewise.
* gcc.dg/torture/pr33870.c: Likewise.
* gcc.dg/torture/pr33560.c: Likewise.
* gcc.dg/torture/pta-structcopy-1.c: New testcase.
* gcc.dg/torture/ssa-pta-fn-1.c: Likewise.
* gcc.dg/tree-ssa/alias-15.c: Remove.
* gcc.dg/tree-ssa/ssa-dce-4.c: New testcase.
* gcc.dg/tree-ssa/pr26421.c: Adjust.
* gcc.dg/tree-ssa/ssa-fre-10.c: XFAIL.
* gcc.dg/tree-ssa/ssa-dce-5.c: New testcase.
* gcc.dg/tree-ssa/pr23382.c: Adjust.
* gcc.dg/tree-ssa/ssa-fre-20.c: New testcase.
* gcc.dg/tree-ssa/alias-16.c: Adjust.
* gcc.dg/tree-ssa/ssa-fre-13.c: Likewise.
* gcc.dg/tree-ssa/ssa-fre-14.c: Likewise.
* gcc.dg/tree-ssa/alias-18.c: Likewise.
* gcc.dg/tree-ssa/ssa-fre-15.c: Likewise.
* gcc.dg/tree-ssa/ssa-lim-3.c: Likewise.
* gcc.dg/tree-ssa/alias-19.c: Likewise.
* gcc.dg/tree-ssa/pta-ptrarith-1.c: New testcase.
* gcc.dg/tree-ssa/pr13146.c: Likewise.
* gcc.dg/tree-ssa/ssa-pre-23.c: Likewise.
* gcc.dg/tree-ssa/pta-ptrarith-2.c: Likewise.
* gcc.dg/tree-ssa/ssa-fre-18.c: Likewise.
* gcc.dg/tree-ssa/ssa-pre-24.c: New XFAILed testcase.
* gcc.dg/tree-ssa/ssa-fre-19.c: New testcase.
* gcc.dg/tree-ssa/alias-20.c: Likewise.
* gcc.dg/tree-ssa/ssa-dse-12.c: Likewise.
* gcc.dg/tree-ssa/pr38895.c: Likewise.
* gcc.dg/uninit-B.c: XFAIL.
* gcc.dg/vect/no-vfa-vect-43.c: Adjust.
* gcc.dg/uninit-pr19430.c: XFAIL.
* g++.dg/tree-ssa/pr13146.C: New testcase.
* g++.dg/opt/pr36187.C: Adjust.
* g++.dg/torture/20090329-1.C: New testcase.
From-SVN: r145494
2009-04-03 12:24:28 +02:00
|
|
|
gimple_set_vuse (new_stmt, gimple_vdef (stmt));
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2008-03-26 12:09:43 +01:00
|
|
|
/* Finally enter the statement into the available expression
|
|
|
|
table. */
|
|
|
|
lookup_avail_expr (new_stmt, true);
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-06-29 03:53:04 +02:00
|
|
|
/* Replace *OP_P in STMT with any known equivalent value for *OP_P from
|
|
|
|
CONST_AND_COPIES. */
|
|
|
|
|
2009-09-26 01:57:01 +02:00
|
|
|
static void
|
2008-07-28 16:33:56 +02:00
|
|
|
cprop_operand (gimple stmt, use_operand_p op_p)
|
2004-06-29 03:53:04 +02:00
|
|
|
{
|
|
|
|
tree val;
|
|
|
|
tree op = USE_FROM_PTR (op_p);
|
|
|
|
|
|
|
|
/* If the operand has a known constant value or it is known to be a
|
|
|
|
copy of some other variable, use the value or copy stored in
|
|
|
|
CONST_AND_COPIES. */
|
2004-09-23 22:15:30 +02:00
|
|
|
val = SSA_NAME_VALUE (op);
|
2008-07-08 18:11:06 +02:00
|
|
|
if (val && val != op)
|
2004-06-29 03:53:04 +02:00
|
|
|
{
|
2004-09-29 04:50:47 +02:00
|
|
|
/* Do not replace hard register operands in asm statements. */
|
2008-07-28 16:33:56 +02:00
|
|
|
if (gimple_code (stmt) == GIMPLE_ASM
|
2004-09-29 04:50:47 +02:00
|
|
|
&& !may_propagate_copy_into_asm (op))
|
2009-09-26 01:57:01 +02:00
|
|
|
return;
|
2004-09-29 04:50:47 +02:00
|
|
|
|
2004-06-29 03:53:04 +02:00
|
|
|
/* Certain operands are not allowed to be copy propagated due
|
|
|
|
to their interaction with exception handling and some GCC
|
|
|
|
extensions. */
|
2008-12-30 22:20:08 +01:00
|
|
|
if (!may_propagate_copy (op, val))
|
2009-09-26 01:57:01 +02:00
|
|
|
return;
|
2008-12-30 22:20:08 +01:00
|
|
|
|
2015-02-18 10:48:57 +01:00
|
|
|
/* Do not propagate copies into BIVs.
|
|
|
|
See PR23821 and PR62217 for how this can disturb IV and
|
|
|
|
number of iteration analysis. */
|
|
|
|
if (TREE_CODE (val) != INTEGER_CST)
|
|
|
|
{
|
|
|
|
gimple def = SSA_NAME_DEF_STMT (op);
|
|
|
|
if (gimple_code (def) == GIMPLE_PHI
|
|
|
|
&& gimple_bb (def)->loop_father->header == gimple_bb (def))
|
|
|
|
return;
|
|
|
|
}
|
2009-10-05 15:18:09 +02:00
|
|
|
|
2004-06-29 03:53:04 +02:00
|
|
|
/* Dump details. */
|
|
|
|
if (dump_file && (dump_flags & TDF_DETAILS))
|
|
|
|
{
|
|
|
|
fprintf (dump_file, " Replaced '");
|
|
|
|
print_generic_expr (dump_file, op, dump_flags);
|
|
|
|
fprintf (dump_file, "' with %s '",
|
|
|
|
(TREE_CODE (val) != SSA_NAME ? "constant" : "variable"));
|
|
|
|
print_generic_expr (dump_file, val, dump_flags);
|
|
|
|
fprintf (dump_file, "'\n");
|
|
|
|
}
|
|
|
|
|
backport: copy-prop, incremental SSA updating of FUD chains and newly exposed symbols.
Merge from tree-cleanup-branch: VRP, store CCP, store
copy-prop, incremental SSA updating of FUD chains and
newly exposed symbols.
* Makefile.in (tree-ssa-copy.o): Depend on tree-ssa-propagate.h.
(OBJS-common): Add tree-vrp.o.
(tree-vrp.o): New rule.
* basic-block.h (nearest_common_dominator_for_set): Declare.
* common.opt (ftree-store-ccp): New flag.
(ftree-copy-prop): New flag.
(ftree-vrp): New flag.
(ftree-store-copy-prop): New flag.
* dominance.c (nearest_common_dominator_for_set): New.
* domwalk.c (walk_dominator_tree): Only traverse
statements in blocks marked in walk_data->interesting_blocks.
* domwalk.h (struct dom_walk_data): Add field interesting_blocks.
* fold-const.c (fold): Handle ASSERT_EXPR.
* opts.c (decode_options): Set flag_tree_copy_prop at -O1.
Set flag_tree_store_ccp, flag_tree_store_copy_prop and
flag_tree_vrp at -O2.
* timevar.def (TV_TREE_VRP): Define.
(TV_TREE_COPY_PROP): Define.
(TV_TREE_STORE_COPY_PROP): Define.
(TV_TREE_SSA_INCREMENTAL): Define.
(TV_TREE_STORE_CCP): Define.
* tree-cfg.c (tree_can_merge_blocks_p): Remove reference
to kill_redundant_phi_nodes from comment.
(verify_expr): Handle ASSERT_EXPR.
* tree-dfa.c (mark_new_vars_to_rename): Remove second
argument. Update all users.
(mark_call_clobbered_vars_to_rename): Remove. Update all
users.
* tree-flow-inline.h (unmodifiable_var_p): New.
* tree-flow.h (enum value_range_type): Declare.
(struct value_range_def): Declare.
(value_range): Declare.
(remove_all_phi_nodes_for): Remove. Update all users.
(find_phi_node_for): Declare.
(add_type_alias): Declare.
(count_uses_and_derefs): Declare.
(kill_redundant_phi_nodes): Remove.
(rewrite_into_ssa): Remove.
(rewrite_def_def_chains): Remove.
(update_ssa, register_new_name_mapping, create_new_def_for,
need_ssa_update_p, name_registered_for_update_p,
release_ssa_name_after_update_ssa, dump_repl_tbl,
debug_repl_tbl, dump_names_replaced_by,
debug_names_replaced_by, mark_sym_for_renaming,
mark_set_for_renaming, get_current_def, set_current_def,
get_value_range, dump_value_range, debug_value_range,
dump_all_value_ranges, debug_all_value_ranges,
expr_computes_nonzero, loop_depth_of_name,
unmodifiable_var_p): Declare.
* tree-gimple.c (is_gimple_formal_tmp_rhs): Handle
ASSERT_EXPR.
* tree-into-ssa.c (block_defs_stack): Update comment.
(old_ssa_names, new_ssa_names, old_virtual_ssa_names,
syms_to_rename, names_to_release, repl_tbl,
need_to_initialize_update_ssa_p, need_to_update_vops_p,
need_to_replace_names_p): New locals.
(NAME_SETS_GROWTH_FACTOR): Define.
(struct repl_map_d): Declare.
(struct mark_def_sites_global_data): Add field
interesting_blocks.
(enum rewrite_mode): Declare.
(REGISTER_DEFS_IN_THIS_STMT): Define.
(compute_global_livein): Use last_basic_block instead of
n_basic_blocks.
(set_def_block): Remove last argument. Update all callers.
(prepare_use_operand_for_rename): Remove. Update all callers.
(prepare_def_operand_for_rename): Remove. Update all callers.
(symbol_marked_for_renaming): New.
(is_old_name): New.
(is_new_name): New.
(repl_map_hash): New.
(repl_map_eq): New.
(repl_map_free): New.
(names_replaced_by): New.
(add_to_repl_tbl): New.
(add_new_name_mapping): New.
(mark_def_sites): Assume that all the operands in the
statement are in normal form.
(find_idf): Assert that the block in the stack is valid.
(get_default_def_for): New.
(insert_phi_nodes_for): Add new argument 'update_p'.
Add documentation.
If update_p is true, add a new mapping between the LHS of
each new PHI and the name that it replaces.
(insert_phi_nodes_1): Only call find_idf if needed.
(get_reaching_def): Call get_default_def_for.
(rewrite_operand): Remove.
(rewrite_stmt): Do nothing if REGISTER_DEFS_IN_THIS_STMT
and REWRITE_THIS_STMT are false.
Assume that all the operands in the statement are in
normal form.
(rewrite_add_phi_arguments): Don't use PHI_REWRITTEN.
(rewrite_virtual_phi_arguments): Remove.
(invalidate_name_tags): Remove.
(register_new_update_single, register_new_update_set,
rewrite_update_init_block, replace_use,
rewrite_update_fini_block, rewrite_update_stmt,
rewrite_update_phi_arguments): New.
rewrite_blocks): Remove argument 'fix_virtual_phis'.
Add arguments 'entry', 'what' and 'blocks'.
Initialize the dominator walker according to 'what' and
'blocks'.
Start the dominator walk at 'entry'.
(mark_def_site_blocks): Add argument 'interesting_blocks'.
Use it to configure the dominator walker.
(rewrite_into_ssa): Remove argument 'all'.
Make internal.
(rewrite_all_into_ssa): Remove.
(rewrite_def_def_chains): Remove.
(mark_def_interesting, mark_use_interesting,
prepare_phi_args_for_update, prepare_block_for_update,
prepare_def_site_for, prepare_def_sites,
dump_names_replaced_by, debug_names_replaced_by,
dump_repl_tbl, debug_repl_tbl, init_update_ssa,
delete_update_ssa, create_new_def_for,
register_new_name_mapping, mark_sym_for_renaming,
mark_set_for_renaming, need_ssa_update_p,
name_registered_for_update_p, ssa_names_to_replace,
release_ssa_name_after_update_ssa,
insert_updated_phi_nodes_for, update_ssa): New.
* tree-loop-linear.c (linear_transform_loops): Call
update_ssa instead of rewrite_into_ssa.
* tree-optimize.c (vars_to_rename): Remove.
Update all users.
(init_tree_optimization_passes): Replace
pass_redundant_phi with pass_copy_prop.
Add pass_vrp.
Replace pass_ccp with pass_store_ccp.
Add pass_store_copy_prop after pass_store_ccp.
(execute_todo): If the TODO_ flags don't include updating
the SSA form, assert that it does not need to be updated.
Call update_ssa instead of rewrite_into_ssa and
rewrite_def_def_chains.
If TODO_verify_loops is set, call verify_loop_closed_ssa.
(tree_rest_of_compilation):
* tree-pass.h (TODO_dump_func, TODO_ggc_collect,
TODO_verify_ssa, TODO_verify_flow, TODO_verify_stmts,
TODO_cleanup_cfg): Renumber.
(TODO_verify_loops, TODO_update_ssa,
TODO_update_ssa_no_phi, TODO_update_ssa_full_phi,
TODO_update_ssa_only_virtuals): Define.
(pass_copy_prop, pass_store_ccp, pass_store_copy_prop, pass_vrp):
Declare.
* tree-phinodes.c (make_phi_node): Update documentation.
(remove_all_phi_nodes_for): Remove.
(find_phi_node_for): New.
* tree-pretty-print.c (dump_generic_node): Handle ASSERT_EXPR.
* tree-scalar-evolution.c (follow_ssa_edge_in_rhs): Likewise.
(interpret_rhs_modify_expr): Likewise.
* tree-sra.c (decide_instantiations): Mark all symbols in
SRA_CANDIDATES for renaming.
(mark_all_v_defs_1): Rename from mark_all_v_defs.
(mark_all_v_defs): New function. Update all users to call it
with the whole list of scalarized statements, not just the
first one.
* tree-ssa-alias.c (count_ptr_derefs): Make extern.
(compute_flow_insensitive_aliasing): If the tag is
unmodifiable and the variable isn't or vice-versa, don't
make them alias of each other.
(setup_pointers_and_addressables): If the type tag for
VAR is about to change, mark the old one for renaming.
(add_type_alias): New.
* tree-ssa-ccp.c: Document SSA-CCP and STORE-CCP.
(ccp_lattice_t): Rename from latticevalue.
(value): Remove. Update all users.
(const_val): New local variable.
(do_store_ccp): New local variable.
(dump_lattice_value): Handle UNINITIALIZED.
(debug_lattice_value): New.
(get_default_value): Re-write.
(set_lattice_value): Re-write.
(def_to_varying): Remove. Update all users.
(likely_value): Return VARYING for statements that make
stores when STORE_CCP is false.
Return VARYING for any statement other than MODIFY_EXPR,
COND_EXPR and SWITCH_EXPR.
(ccp_initialize): Re-write.
(replace_uses_in, replace_vuse_in, substitute_and_fold):
Move to tree-ssa-propagate.c.
(ccp_lattice_meet): Handle memory stores when
DO_STORE_CCP is true.
(ccp_visit_phi_node): Likewise.
(ccp_fold): Likewise.
(evaluate_stmt): Likewise.
(visit_assignment): Likewise.
(ccp_visit_stmt): Likewise.
(execute_ssa_ccp): Add argument 'store_ccp'. Copy it
into DO_STORE_CCP.
(do_ssa_ccp): New.
(pass_ccp): Use it.
(do_ssa_store_ccp): New.
(gate_store_ccp): New.
(pass_store_ccp): Declare.
* tree-ssa-copy.c: Include tree-ssa-propagate.h.
(may_propagate_copy): Reformat.
Don't abort if ORIG is a virtual and DEST isn't.
If NEW does not have alias information but DEST does,
copy it.
(copy_of, cached_last_copy_of, do_store_copy_prop, enum
copy_prop_kind, which_copy_prop): Declare.
(stmt_may_generate_copy, get_copy_of_val,
get_last_copy_of, set_copy_of_val, dump_copy_of,
copy_prop_visit_assignment, copy_prop_visit_cond_stmt,
copy_prop_visit_stmt, copy_prop_visit_phi_node,
init_copy_prop, fini_copy_prop, execute_copy_prop,
gate_copy_prop, do_copy_prop, gate_store_copy_prop,
store_copy_prop): New.
(pass_copy_prop, pass_store_copy_prop): Declare.
* tree-ssa-dom.c (struct opt_stats_d): Add fields
'num_const_prop' and 'num_copy_prop'.
(cprop_operand): Update them.
(dump_dominator_optimization_stats): Dump them.
(tree_ssa_dominator_optimize): Call update_ssa instead of
rewrite_into_ssa.
(loop_depth_of_name): Declare extern.
(simplify_cond_and_lookup_avail_expr): Guard against NULL
values for LOW or HIGH.
(cprop_into_successor_phis): Only propagate if NEW != ORIG.
(record_equivalences_from_stmt): Call expr_computes_nonzero.
(cprop_operand): Only propagate if VAL != OP.
* tree-ssa-dse.c (dse_optimize_stmt): Mark symbols in removed
statement for renaming.
* tree-ssa-loop-im.c (move_computations): Call update_ssa.
* tree-ssa-loop-ivopts.c (rewrite_address_base): Call
add_type_alias if necessary.
Call mark_new_vars_to_rename.
(tree_ssa_iv_optimize): If new symbols need to be renamed,
mark every statement updated, call update_ssa and
rewrite_into_loop_closed_ssa.
* tree-ssa-loop-manip.c (add_exit_phis): Do not remove DEF_BB
from LIVEIN if VAR is a virtual.
* tree-ssa-loop.c (tree_loop_optimizer_init): Call update_ssa.
* tree-ssa-operands.c (get_expr_operands): Handle ASSERT_EXPR.
(get_call_expr_operands): Reformat statement.
(add_stmt_operand): Don't create V_MAY_DEFs for read-only
symbols.
* tree-ssa-propagate.c (ssa_prop_init): Initialize
SSA_NAME_VALUE for every name.
(first_vdef, stmt_makes_single_load, stmt_makes_single_store,
get_value_loaded_by): New.
(replace_uses_in, replace_vuses_in, replace_phi_args_in,
substitute_and_fold): Move from tree-ssa-ccp.c.
* tree-ssa-propagate.h (struct prop_value_d, prop_value_t,
first_vdef, stmt_makes_single_load, stmt_makes_single_store,
get_value_loaded_by, replace_uses_in, substitute_and_fold):
Declare.
* tree-ssa.c (verify_use): Fix error message.
(propagate_into_addr, replace_immediate_uses, get_eq_name,
check_phi_redundancy, kill_redundant_phi_nodes,
pass_redundant_phi): Remove. Update all users.
* tree-vect-transform.c (vect_create_data_ref_ptr): Call
add_type_alias, if necessary.
* tree-vectorizer.h (struct _stmt_vect_info): Update
documentation for field 'memtag'.
* tree-vrp.c: New file.
* tree.def (ASSERT_EXPR): Define.
* tree.h (ASSERT_EXPR_VAR): Define.
(ASSERT_EXPR_COND): Define.
(SSA_NAME_VALUE_RANGE): Define.
(struct tree_ssa_name): Add field 'value_range'.
(PHI_REWRITTEN): Remove.
(struct tree_phi_node): Remove field 'rewritten'.
* doc/invoke.texi (-fdump-tree-storeccp, -ftree-copy-prop,
-ftree-store-copy-prop): Document.
* doc/tree-ssa.texi: Remove broken link to McCAT's compiler.
Document usage of update_ssa.
testsuite/ChangeLog
* g++.dg/tree-ssa/pr18178.C: New test.
* gcc.c-torture/execute/20030216-1.x: Ignore at -O1.
* gcc.c-torture/execute/20041019-1.c: New test.
* gcc.dg/tree-ssa/20041008-1.c: New test.
* gcc.dg/tree-ssa/ssa-ccp-12.c: New test.
* gcc.dg/tree-ssa/20030731-2.c: Update to use -fdump-tree-store_ccp.
* gcc.dg/tree-ssa/20030917-1.c: Likewise.
* gcc.dg/tree-ssa/20030917-3.c: Likewise.
* gcc.dg/tree-ssa/20040721-1.c: Likewise.
* gcc.dg/tree-ssa/ssa-ccp-1.c: Likewise.
* gcc.dg/tree-ssa/ssa-ccp-2.c: Likewise.
* gcc.dg/tree-ssa/ssa-ccp-3.c: Likewise.
* gcc.dg/tree-ssa/ssa-ccp-7.c: Likewise.
* gcc.dg/tree-ssa/ssa-ccp-9.c: Likewise.
From-SVN: r97884
2005-04-09 03:37:54 +02:00
|
|
|
if (TREE_CODE (val) != SSA_NAME)
|
|
|
|
opt_stats.num_const_prop++;
|
|
|
|
else
|
|
|
|
opt_stats.num_copy_prop++;
|
|
|
|
|
2004-06-29 03:53:04 +02:00
|
|
|
propagate_value (op_p, val);
|
|
|
|
|
|
|
|
/* And note that we modified this statement. This is now
|
|
|
|
safe, even if we changed virtual operands since we will
|
|
|
|
rescan the statement and rewrite its operands again. */
|
2008-07-28 16:33:56 +02:00
|
|
|
gimple_set_modified (stmt, true);
|
2004-06-29 03:53:04 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* CONST_AND_COPIES is a table which maps an SSA_NAME to the current
|
2009-11-25 11:55:54 +01:00
|
|
|
known value for that SSA_NAME (or NULL if no value is known).
|
2004-06-29 03:53:04 +02:00
|
|
|
|
|
|
|
Propagate values from CONST_AND_COPIES into the uses, vuses and
|
2006-12-11 21:15:53 +01:00
|
|
|
vdef_ops of STMT. */
|
2004-06-29 03:53:04 +02:00
|
|
|
|
2009-09-26 01:57:01 +02:00
|
|
|
static void
|
2008-07-28 16:33:56 +02:00
|
|
|
cprop_into_stmt (gimple stmt)
|
2004-06-29 03:53:04 +02:00
|
|
|
{
|
tree-ssa-operands.h (struct ssa_operand_iterator_d): New.
2004-08-25 Andrew MacLeod <amacleod@redhat.com>
* tree-ssa-operands.h (struct ssa_operand_iterator_d): New. SSA operand
iterator controlling structure.
(SSA_OP_USE, SSA_OP_DEF, SSA_OP_VUSE, SSA_OP_VMAYUSE, SSA_OP_VMAYDEF,
SSA_OP_VMUSTDEF, SSA_OP_VIRTUAL_USES, SSA_OP_VIRTUAL_DEFS,
SSA_OP_ALL_USES, SSA_OP_ALL_DEFS, SSA_OP_ALL_OPERANDS): New. Operand
iterator flags.
(FOR_EACH_SSA_TREE_OPERAND): New. Iterate over operands as trees.
(FOR_EACH_SSA_USE_OPERAND): New. Iterate over operands as uses.
(FOR_EACH_SSA_DEF_OPERAND): New. Iterate over operands as defs.
(FOR_EACH_SSA_MAYDEF_OPERAND): New. Iterate over V_MAY_DEFs.
* tree-ssa-operands.c (NULL_DEF_OPERAND_P, NULL_USE_OPERAND_P): New.
Empty operand pointers.
* tree-flow-inline.h (op_iter_done): New. Return true if finished.
(op_iter_next_use): New. Return next use_operand_p.
(op_iter_next_def): New. Return next def_operand_p.
(op_iter_next_tree): New. Return next operands as a tree.
(op_iter_init): New. Initialize an iterator structure.
(op_iter_init_use): New. Initialize structure and get the first use.
(op_iter_init_def): New. Initialize structure and get the first def.
(op_iter_init_tree): New. Initialize structure and get the first tree.
(op_iter_next_maydef): New. Return next V_MAY_DEF operands.
(op_iter_init_maydef): New. Initialize structure and get the first
V_MAY_DEF operands.
* tree-cfg.c (tree_duplicate_bb): Use new operand iterator.
* tree-dfa.c (compute_immediate_uses_for_stmt,
redirect_immediate_uses): Use new operand iterator.
(v_may_defs_disappeared_p, v_must_defs_disappeared_p): Delete.
(mark_new_vars_to_rename): Use new operand iterator. Count virtual
operands instead of using *_disappeared_p routines.
* tree-into-ssa.c (mark_def_sites, ssa_mark_def_sites, rewrite_stmt,
ssa_rewrite_stmt): Use new operand iterator.
* tree-outof-ssa.c (check_replaceable, find_replaceable_in_bb,
rewrite_trees): Use new operand iterator.
* tree-pretty-print.c (dump_vops): Use new operand iterator.
* tree-sra.c (mark_all_v_defs): Use new operand iterator.
* tree-ssa-alias.c (compute_points_to_and_addr_escape,
dump_points_to_info): Use new operand iterator.
* tree-ssa-ccp.c (cp_lattice_meet, visit_stmt, initialize,
replace_uses_in, replace_vuse_in, likely_value, set_rhs): Use new
operand iterator.
* tree-ssa-dce.c (mark_stmt_if_obviously_necessary,
propagate_necessity): Use new operand iterator.
* tree-ssa-dom.c (cprop_into_stmt, optimize_stmt): Use operand iterator.
(register_definitions_for_stmt): Use new operand iterator. Take stmt as
a parameter instead of a stmt_ann_t.
* tree-ssa-live.c (create_ssa_var_map, calculate_live_on_entry,
build_tree_conflict_graph): Use new operand iterator.
* tree-ssa-loop-im.c (determine_max_movement, single_reachable_address,
rewrite_mem_refs): Use new operand iterator.
* tree-ssa-loop-manip.c (find_uses_to_rename_stmt,
check_loop_closed_ssa_use): Use new operand iterator.
* tree-ssa.c (verify_ssa, replace_immediate_uses): Use operand iterator.
* tree-ssanames.c (release_defs): Use new operand iterator.
* tree-vectorizer.c (vect_create_data_ref): Use new operand iterator.
From-SVN: r86583
2004-08-25 23:21:19 +02:00
|
|
|
use_operand_p op_p;
|
|
|
|
ssa_op_iter iter;
|
2004-06-29 03:53:04 +02:00
|
|
|
|
2011-10-06 12:35:20 +02:00
|
|
|
FOR_EACH_SSA_USE_OPERAND (op_p, stmt, iter, SSA_OP_USE)
|
|
|
|
cprop_operand (stmt, op_p);
|
2004-06-29 03:53:04 +02:00
|
|
|
}
|
|
|
|
|
2005-07-28 18:30:00 +02:00
|
|
|
/* Optimize the statement pointed to by iterator SI.
|
2009-11-25 11:55:54 +01:00
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
We try to perform some simplistic global redundancy elimination and
|
|
|
|
constant propagation:
|
|
|
|
|
|
|
|
1- To detect global redundancy, we keep track of expressions that have
|
|
|
|
been computed in this block and its dominators. If we find that the
|
|
|
|
same expression is computed more than once, we eliminate repeated
|
|
|
|
computations by using the target of the first one.
|
|
|
|
|
|
|
|
2- Constant values and copy assignments. This is used to do very
|
|
|
|
simplistic constant and copy propagation. When a constant or copy
|
|
|
|
assignment is found, we map the value on the RHS of the assignment to
|
|
|
|
the variable in the LHS in the CONST_AND_COPIES table. */
|
|
|
|
|
|
|
|
static void
|
domwalk.h (struct dom_walk_data): Remove all callbacks except before_dom_children_before_stmts and...
2009-06-27 Paolo Bonzini <bonzini@gnu.org>
* domwalk.h (struct dom_walk_data): Remove all callbacks except
before_dom_children_before_stmts and after_dom_children_after_stmts.
Rename the two remaining callbacks to just before_dom_children and
after_dom_children. Remove other GIMPLE statement walking bits.
* domwalk.c (walk_dominator_tree): Remove now unsupported features.
* graphite.c: Do not include domwalk.h.
* tree-into-ssa.c (interesting_blocks): New global.
(struct mark_def_sites_global_data): Remove it and names_to_rename.
(mark_def_sites, rewrite_stmt, rewrite_add_phi_arguments,
rewrite_update_stmt, rewrite_update_phi_arguments): Simplify
now that they're not domwalk callbacks.
(rewrite_initialize_block): Rename to...
(rewrite_enter_block): ... this, place after called functions. Test
interesting_blocks, call rewrite_stmt and rewrite_add_phi_arguments.
(rewrite_finalize_block): Rename to...
(rewrite_leave_block): ... this, place after called functions.
(rewrite_update_init_block): Rename to...
(rewrite_update_enter_block): ... this, place after called functions.
Test interesting_blocks, call rewrite_update_stmt and
rewrite_update_phi_arguments.
(rewrite_update_fini_block): Rename to...
(rewrite_leave_block): ... this, place after called functions.
(rewrite_blocks): Remove last argument, simplify initialization of
walk_data.
(mark_def_sites_initialize_block): Rename to...
(mark_def_sites_block): ... this, call mark_def_sites.
(mark_def_sites_blocks): Remove argument, simplify initialization of
walk_data.
(rewrite_into_ssa): Adjust for interesting_blocks_being a global.
(update_ssa): Likewise.
* tree-ssa-dom.c (optimize_stmt): Simplify now that it's not a domwalk
callback.
(tree_ssa_dominator_optimize): Simplify initialization of walk_data.
(dom_opt_initialize_block): Rename to...
(dom_opt_enter_block): ... this, place after called functions. Walk
statements here, inline propagate_to_outgoing_edges.
(dom_opt_finalize_block): Rename to...
(dom_opt_leave_block): ... this, place after called functions.
* tree-ssa-dse.c (dse_optimize_stmt): Simplify now that it's not a
domwalk callback.
(dse_enter_block, dse_record_phi): New.
(dse_record_phis): Delete.
(dse_finalize_block): Rename to...
(dse_leave_block): ... this.
(tree_ssa_dse): Simplify initialization of walk_data.
* tree-ssa-loop-im.c (determine_invariantness, move_computations):
Adjust initialization of walk_data.
* tree-ssa-loop-unswitch.c: Do not include domwalk.h.
* tree-ssa-loop-phiopt.c (get_non_trapping):
Adjust initialization of walk_data.
* tree-ssa-loop-threadedge.c: Do not include domwalk.h.
* tree-ssa-uncprop.c (uncprop_into_successor_phis): Simplify now that
it's not a domwalk callback.
(uncprop_initialize_block): Rename to...
(dse_enter_block): ... this, call uncprop_into_successor_phis.
(dse_finalize_block): Rename to...
(dse_leave_block): ... this.
(tree_ssa_uncprop): Simplify initialization of walk_data.
* Makefile.in: Adjust dependencies.
From-SVN: r149008
2009-06-27 16:45:51 +02:00
|
|
|
optimize_stmt (basic_block bb, gimple_stmt_iterator si)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
gimple stmt, old_stmt;
|
2004-05-13 08:41:07 +02:00
|
|
|
bool may_optimize_p;
|
2008-09-08 21:31:18 +02:00
|
|
|
bool modified_p = false;
|
2015-03-13 09:47:14 +01:00
|
|
|
bool was_noreturn;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
old_stmt = stmt = gsi_stmt (si);
|
2015-03-13 09:47:14 +01:00
|
|
|
was_noreturn = is_gimple_call (stmt) && gimple_call_noreturn_p (stmt);
|
2009-11-25 11:55:54 +01:00
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
if (dump_file && (dump_flags & TDF_DETAILS))
|
|
|
|
{
|
|
|
|
fprintf (dump_file, "Optimizing statement ");
|
2008-07-28 16:33:56 +02:00
|
|
|
print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2011-10-06 12:35:20 +02:00
|
|
|
if (gimple_code (stmt) == GIMPLE_COND)
|
2014-11-19 18:00:54 +01:00
|
|
|
canonicalize_comparison (as_a <gcond *> (stmt));
|
2011-10-06 12:35:20 +02:00
|
|
|
|
|
|
|
update_stmt_if_modified (stmt);
|
|
|
|
opt_stats.num_stmts++;
|
|
|
|
|
2006-12-11 21:15:53 +01:00
|
|
|
/* Const/copy propagate into USES, VUSES and the RHS of VDEFs. */
|
2009-09-26 01:57:01 +02:00
|
|
|
cprop_into_stmt (stmt);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
/* If the statement has been modified with constant replacements,
|
|
|
|
fold its RHS before checking for redundant computations. */
|
2008-07-28 16:33:56 +02:00
|
|
|
if (gimple_modified_p (stmt))
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
tree rhs = NULL;
|
2005-05-24 04:54:06 +02:00
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
/* Try to fold the statement making sure that STMT is kept
|
|
|
|
up to date. */
|
2008-07-28 16:33:56 +02:00
|
|
|
if (fold_stmt (&si))
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
stmt = gsi_stmt (si);
|
2009-10-16 18:57:31 +02:00
|
|
|
gimple_set_modified (stmt, true);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
if (dump_file && (dump_flags & TDF_DETAILS))
|
|
|
|
{
|
|
|
|
fprintf (dump_file, " Folded to: ");
|
2008-07-28 16:33:56 +02:00
|
|
|
print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
/* We only need to consider cases that can yield a gimple operand. */
|
|
|
|
if (gimple_assign_single_p (stmt))
|
|
|
|
rhs = gimple_assign_rhs1 (stmt);
|
|
|
|
else if (gimple_code (stmt) == GIMPLE_GOTO)
|
|
|
|
rhs = gimple_goto_dest (stmt);
|
2014-11-19 18:00:54 +01:00
|
|
|
else if (gswitch *swtch_stmt = dyn_cast <gswitch *> (stmt))
|
2008-07-28 16:33:56 +02:00
|
|
|
/* This should never be an ADDR_EXPR. */
|
2014-11-19 18:00:54 +01:00
|
|
|
rhs = gimple_switch_index (swtch_stmt);
|
2008-07-28 16:33:56 +02:00
|
|
|
|
2005-05-24 04:54:06 +02:00
|
|
|
if (rhs && TREE_CODE (rhs) == ADDR_EXPR)
|
2008-07-28 16:33:56 +02:00
|
|
|
recompute_tree_invariant_for_addr_expr (rhs);
|
2005-05-24 04:54:06 +02:00
|
|
|
|
2008-09-08 21:31:18 +02:00
|
|
|
/* Indicate that maybe_clean_or_replace_eh_stmt needs to be called,
|
|
|
|
even if fold_stmt updated the stmt already and thus cleared
|
|
|
|
gimple_modified_p flag on it. */
|
|
|
|
modified_p = true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Check for redundant computations. Do this optimization only
|
|
|
|
for assignments that have no volatile ops and conditionals. */
|
2011-12-06 10:02:17 +01:00
|
|
|
may_optimize_p = (!gimple_has_side_effects (stmt)
|
|
|
|
&& (is_gimple_assign (stmt)
|
2008-07-28 16:33:56 +02:00
|
|
|
|| (is_gimple_call (stmt)
|
2011-12-06 10:02:17 +01:00
|
|
|
&& gimple_call_lhs (stmt) != NULL_TREE)
|
2008-07-28 16:33:56 +02:00
|
|
|
|| gimple_code (stmt) == GIMPLE_COND
|
|
|
|
|| gimple_code (stmt) == GIMPLE_SWITCH));
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
if (may_optimize_p)
|
2008-07-28 16:33:56 +02:00
|
|
|
{
|
builtins.c (interclass_mathfn_icode): New helper.
* builtins.c (interclass_mathfn_icode): New helper.
(expand_builtin_interclass_mathfn): Use it here, and split folding
into ...
(fold_builtin_interclass_mathfn): ... this new folder.
(build_call_nofold_loc): New static helper.
(build_call_nofold): New wrapper macro for above.
(expand_builtin_int_roundingfn): Use it instead of build_call_expr.
(expand_builtin_pow): Ditto.
(expand_builtin_memset_args): Ditto.
(expand_builtin_printf): Ditto.
(expand_builtin_fprintf): Ditto.
(expand_builtin_sprintf): Ditto.
(expand_builtin_memory_chk): Ditto.
(expand_builtin_mempcpy_args): Ditto and don't call folders.
(expand_builtin_stpcpy): Ditto.
(expand_builtin_strcmp): Ditto.
(expand_builtin_strncmp): Ditto.
(expand_builtin_strcpy): Remove FNDECL and MODE arguments.
(expand_builtin_strcpy_args): Don't call folders.
(expand_builtin_memcmp): Ditto.
(expand_builtin_strncpy): Ditto, and use target.
(expand_builtin_memcpy): Ditto.
(expand_builtin_strstr, expand_builtin_strchr, expand_builtin_strrchr,
expand_builtin_strpbrk, expand_builtin_memmove,
expand_builtin_memmove_args, expand_builtin_bcopy,
expand_builtin_memchr, expand_builtin_strcat, expand_builtin_strncat,
expand_builtin_strspn, expand_builtin_strcspn,
expand_builtin_fputs): Remove these.
(expand_builtin): Don't call the above, change calls to other
expanders that changed prototype.
(fold_builtin_stpcpy): New folder split out from expand_builtin_stpcpy.
(fold_builtin_1 <ISFINITE, ISINF, ISNORMAL>): Call
fold_builtin_interclass_mathfn.
(fold_builtin_2 <STPCPY>): Call fold_builtin_stpcpy.
(fold_builtin_strcat): Add folding split from expand_builtin_strcat.
* fold-const.c (fold_binary_loc <NE_EXPR>): Add !exp != 0 -> !exp.
* passes.c (init_optimization_passes): Move pass_fold_builtins
after last phiopt pass.
* tree-inline.c (fold_marked_statements): When folding builtins
iterate over all instruction potentially generated.
* tree-ssa-ccp.c (gimplify_and_update_call_from_tree): Declare
earlier.
(fold_gimple_call): Use it to always fold calls (into potentially
multiple instructions).
* tree-ssa-dom.c (optimize_stmt): Resolve __builtin_constant_p
calls into zero at this time.
* tree-ssa-propagate.c (substitute_and_fold): Ignore multiple
statements generated by builtin folding.
testsuite/
* gcc.dg/builtins-44.c: Use __builtin_isinf_sign when checking
for sign of -Inf.
From-SVN: r152236
2009-09-28 14:54:23 +02:00
|
|
|
if (gimple_code (stmt) == GIMPLE_CALL)
|
|
|
|
{
|
|
|
|
/* Resolve __builtin_constant_p. If it hasn't been
|
|
|
|
folded to integer_one_node by now, it's fairly
|
|
|
|
certain that the value simply isn't constant. */
|
|
|
|
tree callee = gimple_call_fndecl (stmt);
|
|
|
|
if (callee
|
|
|
|
&& DECL_BUILT_IN_CLASS (callee) == BUILT_IN_NORMAL
|
|
|
|
&& DECL_FUNCTION_CODE (callee) == BUILT_IN_CONSTANT_P)
|
|
|
|
{
|
|
|
|
propagate_tree_value_into_stmt (&si, integer_zero_node);
|
|
|
|
stmt = gsi_stmt (si);
|
|
|
|
}
|
|
|
|
}
|
2009-10-09 20:30:05 +02:00
|
|
|
|
|
|
|
update_stmt_if_modified (stmt);
|
|
|
|
eliminate_redundant_computations (&si);
|
|
|
|
stmt = gsi_stmt (si);
|
2010-09-20 16:40:10 +02:00
|
|
|
|
|
|
|
/* Perform simple redundant store elimination. */
|
|
|
|
if (gimple_assign_single_p (stmt)
|
|
|
|
&& TREE_CODE (gimple_assign_lhs (stmt)) != SSA_NAME)
|
|
|
|
{
|
|
|
|
tree lhs = gimple_assign_lhs (stmt);
|
|
|
|
tree rhs = gimple_assign_rhs1 (stmt);
|
|
|
|
tree cached_lhs;
|
2014-11-19 18:00:54 +01:00
|
|
|
gassign *new_stmt;
|
2015-09-01 12:51:43 +02:00
|
|
|
rhs = dom_valueize (rhs);
|
2010-09-20 16:40:10 +02:00
|
|
|
/* Build a new statement with the RHS and LHS exchanged. */
|
|
|
|
if (TREE_CODE (rhs) == SSA_NAME)
|
|
|
|
{
|
|
|
|
gimple defstmt = SSA_NAME_DEF_STMT (rhs);
|
|
|
|
new_stmt = gimple_build_assign (rhs, lhs);
|
|
|
|
SSA_NAME_DEF_STMT (rhs) = defstmt;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
new_stmt = gimple_build_assign (rhs, lhs);
|
|
|
|
gimple_set_vuse (new_stmt, gimple_vuse (stmt));
|
|
|
|
cached_lhs = lookup_avail_expr (new_stmt, false);
|
|
|
|
if (cached_lhs
|
|
|
|
&& rhs == cached_lhs)
|
|
|
|
{
|
|
|
|
basic_block bb = gimple_bb (stmt);
|
|
|
|
unlink_stmt_vdef (stmt);
|
2012-04-05 11:43:48 +02:00
|
|
|
if (gsi_remove (&si, true))
|
2010-09-20 16:40:10 +02:00
|
|
|
{
|
|
|
|
bitmap_set_bit (need_eh_cleanup, bb->index);
|
|
|
|
if (dump_file && (dump_flags & TDF_DETAILS))
|
|
|
|
fprintf (dump_file, " Flagged to clear EH edges.\n");
|
|
|
|
}
|
2012-04-05 11:45:18 +02:00
|
|
|
release_defs (stmt);
|
2010-09-20 16:40:10 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2008-07-28 16:33:56 +02:00
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
/* Record any additional equivalences created by this statement. */
|
2008-07-28 16:33:56 +02:00
|
|
|
if (is_gimple_assign (stmt))
|
|
|
|
record_equivalences_from_stmt (stmt, may_optimize_p);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
/* If STMT is a COND_EXPR and it was modified, then we may know
|
|
|
|
where it goes. If that is the case, then mark the CFG as altered.
|
|
|
|
|
|
|
|
This will cause us to later call remove_unreachable_blocks and
|
2009-11-25 11:55:54 +01:00
|
|
|
cleanup_tree_cfg when it is safe to do so. It is not safe to
|
2004-05-13 08:41:07 +02:00
|
|
|
clean things up here since removal of edges and such can trigger
|
|
|
|
the removal of PHI nodes, which in turn can release SSA_NAMEs to
|
|
|
|
the manager.
|
|
|
|
|
|
|
|
That's all fine and good, except that once SSA_NAMEs are released
|
|
|
|
to the manager, we must not call create_ssa_name until all references
|
|
|
|
to released SSA_NAMEs have been eliminated.
|
|
|
|
|
|
|
|
All references to the deleted SSA_NAMEs can not be eliminated until
|
|
|
|
we remove unreachable blocks.
|
|
|
|
|
|
|
|
We can not remove unreachable blocks until after we have completed
|
|
|
|
any queued jump threading.
|
|
|
|
|
|
|
|
We can not complete any queued jump threads until we have taken
|
|
|
|
appropriate variables out of SSA form. Taking variables out of
|
|
|
|
SSA form can call create_ssa_name and thus we lose.
|
|
|
|
|
|
|
|
Ultimately I suspect we're going to need to change the interface
|
|
|
|
into the SSA_NAME manager. */
|
2008-09-08 21:31:18 +02:00
|
|
|
if (gimple_modified_p (stmt) || modified_p)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
|
|
|
tree val = NULL;
|
2009-11-25 11:55:54 +01:00
|
|
|
|
2009-10-09 20:30:05 +02:00
|
|
|
update_stmt_if_modified (stmt);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
if (gimple_code (stmt) == GIMPLE_COND)
|
re PR c/40435 (Revision 148442 caused many regressions on trunk)
2009-07-17 Aldy Hernandez <aldyh@redhat.com>
Manuel López-Ibáñez <manu@gcc.gnu.org>
PR 40435
* tree-complex.c, tree-loop-distribution.c,
tree.c, tree.h, builtins.c, fold-const.c, omp-low.c,
cgraphunit.c, tree-ssa-ccp.c, tree-ssa-dom.c,
gimple-low.c, expr.c, tree-ssa-ifcombine.c, c-decl.c,
stor-layout.c, tree-if-conv.c, c-typeck.c,
gimplify.c, calls.c, tree-sra.c, tree-mudflap.c,
tree-ssa-copy.c, tree-ssa-forwprop.c, c-convert.c, c-omp.c,
varasm.c, tree-inline.c, c-common.c,
c-common.h, gimple.c, tree-switch-conversion.c, gimple.h,
tree-cfg.c, c-parser.c, convert.c: Add location
argument to fold_{unary,binary,ternary}, fold_build[123],
build_call_expr, build_size_arg, build_fold_addr_expr,
build_call_array, non_lvalue, size_diffop,
fold_build1_initializer, fold_build2_initializer,
fold_build3_initializer, fold_build_call_array,
fold_build_call_array_initializer, fold_single_bit_test,
omit_one_operand, omit_two_operands, invert_truthvalue,
fold_truth_not_expr, build_fold_indirect_ref, fold_indirect_ref,
combine_comparisons, fold_builtin_*, fold_call_expr,
build_range_check, maybe_fold_offset_to_address, round_up,
round_down.
objc/
* objc-act.c: Add location argument to all calls to
build_fold_addr_expr.
testsuite/
* gcc.dg/pr36902.c: Add column info.
* g++.dg/gcov/gcov-2.C: Change count for definition.
cp/
* typeck.c, init.c, class.c, method.c, rtti.c, except.c, error.c,
tree.c, cp-gimplify.c, cxx-pretty-print.c, pt.c, semantics.c,
call.c, cvt.c, mangle.c: Add location argument to
fold_{unary,binary,ternary}, fold_build[123], build_call_expr,
build_size_arg, build_fold_addr_expr, build_call_array,
non_lvalue, size_diffop, fold_build1_initializer,
fold_build2_initializer, fold_build3_initializer,
fold_build_call_array, fold_build_call_array_initializer,
fold_single_bit_test, omit_one_operand, omit_two_operands,
invert_truthvalue, fold_truth_not_expr, build_fold_indirect_ref,
fold_indirect_ref, combine_comparisons, fold_builtin_*,
fold_call_expr, build_range_check, maybe_fold_offset_to_address,
round_up, round_down.
fortran/
* trans-expr.c, trans-array.c, trans-openmp.c, trans-stmt.c,
trans.c, trans-io.c, trans-decl.c, trans-intrinsic.c: Add location
argument to fold_{unary,binary,ternary}, fold_build[123],
build_call_expr, build_size_arg, build_fold_addr_expr,
build_call_array, non_lvalue, size_diffop,
fold_build1_initializer, fold_build2_initializer,
fold_build3_initializer, fold_build_call_array,
fold_build_call_array_initializer, fold_single_bit_test,
omit_one_operand, omit_two_operands, invert_truthvalue,
fold_truth_not_expr, build_fold_indirect_ref, fold_indirect_ref,
combine_comparisons, fold_builtin_*, fold_call_expr,
build_range_check, maybe_fold_offset_to_address, round_up,
round_down.
Co-Authored-By: Manuel López-Ibáñez <manu@gcc.gnu.org>
From-SVN: r149722
2009-07-17 00:29:52 +02:00
|
|
|
val = fold_binary_loc (gimple_location (stmt),
|
|
|
|
gimple_cond_code (stmt), boolean_type_node,
|
2008-07-28 16:33:56 +02:00
|
|
|
gimple_cond_lhs (stmt), gimple_cond_rhs (stmt));
|
2014-11-19 18:00:54 +01:00
|
|
|
else if (gswitch *swtch_stmt = dyn_cast <gswitch *> (stmt))
|
|
|
|
val = gimple_switch_index (swtch_stmt);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2004-06-29 08:59:35 +02:00
|
|
|
if (val && TREE_CODE (val) == INTEGER_CST && find_taken_edge (bb, val))
|
2004-05-13 08:41:07 +02:00
|
|
|
cfg_altered = true;
|
2004-06-29 08:59:35 +02:00
|
|
|
|
|
|
|
/* If we simplified a statement in such a way as to be shown that it
|
|
|
|
cannot trap, update the eh information and the cfg to match. */
|
2005-05-17 01:14:02 +02:00
|
|
|
if (maybe_clean_or_replace_eh_stmt (old_stmt, stmt))
|
2004-06-29 08:59:35 +02:00
|
|
|
{
|
|
|
|
bitmap_set_bit (need_eh_cleanup, bb->index);
|
|
|
|
if (dump_file && (dump_flags & TDF_DETAILS))
|
|
|
|
fprintf (dump_file, " Flagged to clear EH edges.\n");
|
|
|
|
}
|
2015-03-13 09:47:14 +01:00
|
|
|
|
|
|
|
if (!was_noreturn
|
|
|
|
&& is_gimple_call (stmt) && gimple_call_noreturn_p (stmt))
|
|
|
|
need_noreturn_fixup.safe_push (stmt);
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-11-20 09:40:52 +01:00
|
|
|
/* Helper for walk_non_aliased_vuses. Determine if we arrived at
|
|
|
|
the desired memory state. */
|
|
|
|
|
|
|
|
static void *
|
|
|
|
vuse_eq (ao_ref *, tree vuse1, unsigned int cnt, void *data)
|
|
|
|
{
|
|
|
|
tree vuse2 = (tree) data;
|
|
|
|
if (vuse1 == vuse2)
|
|
|
|
return data;
|
|
|
|
|
|
|
|
/* This bounds the stmt walks we perform on reference lookups
|
|
|
|
to O(1) instead of O(N) where N is the number of dominating
|
|
|
|
stores leading to a candidate. We re-use the SCCVN param
|
|
|
|
for this as it is basically the same complexity. */
|
|
|
|
if (cnt > (unsigned) PARAM_VALUE (PARAM_SCCVN_MAX_ALIAS_QUERIES_PER_ACCESS))
|
|
|
|
return (void *)-1;
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
/* Search for an existing instance of STMT in the AVAIL_EXPRS table.
|
|
|
|
If found, return its LHS. Otherwise insert STMT in the table and
|
|
|
|
return NULL_TREE.
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
Also, when an expression is first inserted in the table, it is also
|
|
|
|
is also added to AVAIL_EXPRS_STACK, so that it can be removed when
|
|
|
|
we finish processing this block and its children. */
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
static tree
|
2008-07-28 16:33:56 +02:00
|
|
|
lookup_avail_expr (gimple stmt, bool insert)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-26 02:28:35 +02:00
|
|
|
expr_hash_elt **slot;
|
2004-05-13 08:41:07 +02:00
|
|
|
tree lhs;
|
|
|
|
|
2011-12-08 23:00:38 +01:00
|
|
|
/* Get LHS of phi, assignment, or call; else NULL_TREE. */
|
|
|
|
if (gimple_code (stmt) == GIMPLE_PHI)
|
|
|
|
lhs = gimple_phi_result (stmt);
|
|
|
|
else
|
|
|
|
lhs = gimple_get_lhs (stmt);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2015-09-15 19:03:49 +02:00
|
|
|
class expr_hash_elt element (stmt, lhs);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
if (dump_file && (dump_flags & TDF_DETAILS))
|
|
|
|
{
|
|
|
|
fprintf (dump_file, "LKUP ");
|
2015-09-15 19:03:49 +02:00
|
|
|
element.print (dump_file);
|
2008-07-28 16:33:56 +02:00
|
|
|
}
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
/* Don't bother remembering constant assignments and copy operations.
|
|
|
|
Constants and copy operations are handled by the constant/copy propagator
|
|
|
|
in optimize_stmt. */
|
2015-09-15 19:03:49 +02:00
|
|
|
if (element.expr()->kind == EXPR_SINGLE
|
|
|
|
&& (TREE_CODE (element.expr()->ops.single.rhs) == SSA_NAME
|
|
|
|
|| is_gimple_min_invariant (element.expr()->ops.single.rhs)))
|
2010-01-04 22:02:42 +01:00
|
|
|
return NULL_TREE;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
/* Finally try to find the expression in the main expression hash table. */
|
Remove a layer of indirection from hash_table
gcc/
* hash-table.h: Remove a layer of indirection from hash_table so that
it contains the hash table's data instead of a pointer to the data.
* alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c,
config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c,
config/mips/mips.c, config/sol2.c, coverage.c, cselib.c,
data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c,
fold-const.c, gcse.c, ggc-common.c,
gimple-ssa-strength-reduction.c, gimplify.c,
graphite-clast-to-gimple.c, graphite-dependences.c,
graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c,
ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c,
loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c,
lto-streamer.c, lto-streamer.h, passes.c, plugin.c,
postreload-gcse.c, sese.c, statistics.c, store-motion.c,
trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c,
tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c,
tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c,
tree-ssa-live.c, tree-ssa-loop-im.c,
tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-tail-merge.c,
tree-ssa-threadupdate.c, tree-ssa-uncprop.c,
tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c,
tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c,
vtable-verify.c, vtable-verify.h: Adjust.
gcc/c/
* c-decl.c: Adjust.
gcc/cp/
* class.c, semantics.c, tree.c, vtable-class-hierarchy.c:
Adjust.
gcc/java/
* jcf-io.c: Adjust.
gcc/lto/
* lto.c: Adjust.
gcc/objc/
* objc-act.c: Adjust.
From-SVN: r211936
2014-06-24 15:21:35 +02:00
|
|
|
slot = avail_exprs->find_slot (&element, (insert ? INSERT : NO_INSERT));
|
2004-05-13 08:41:07 +02:00
|
|
|
if (slot == NULL)
|
2012-08-21 13:48:42 +02:00
|
|
|
{
|
|
|
|
return NULL_TREE;
|
|
|
|
}
|
|
|
|
else if (*slot == NULL)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2015-09-15 19:03:49 +02:00
|
|
|
class expr_hash_elt *element2 = new expr_hash_elt (element);
|
2013-04-26 02:28:35 +02:00
|
|
|
*slot = element2;
|
2008-07-28 16:33:56 +02:00
|
|
|
|
2015-09-15 19:03:49 +02:00
|
|
|
avail_exprs_stack->record_expr (element2, NULL, '2');
|
2004-05-13 08:41:07 +02:00
|
|
|
return NULL_TREE;
|
|
|
|
}
|
2014-11-20 09:40:52 +01:00
|
|
|
|
|
|
|
/* If we found a redundant memory operation do an alias walk to
|
|
|
|
check if we can re-use it. */
|
2015-09-15 19:03:49 +02:00
|
|
|
if (gimple_vuse (stmt) != (*slot)->vop ())
|
2014-11-20 09:40:52 +01:00
|
|
|
{
|
2015-09-15 19:03:49 +02:00
|
|
|
tree vuse1 = (*slot)->vop ();
|
2014-11-20 09:40:52 +01:00
|
|
|
tree vuse2 = gimple_vuse (stmt);
|
|
|
|
/* If we have a load of a register and a candidate in the
|
|
|
|
hash with vuse1 then try to reach its stmt by walking
|
|
|
|
up the virtual use-def chain using walk_non_aliased_vuses.
|
|
|
|
But don't do this when removing expressions from the hash. */
|
|
|
|
ao_ref ref;
|
|
|
|
if (!(vuse1 && vuse2
|
|
|
|
&& gimple_assign_single_p (stmt)
|
|
|
|
&& TREE_CODE (gimple_assign_lhs (stmt)) == SSA_NAME
|
|
|
|
&& (ao_ref_init (&ref, gimple_assign_rhs1 (stmt)), true)
|
|
|
|
&& walk_non_aliased_vuses (&ref, vuse2,
|
2014-12-09 15:25:09 +01:00
|
|
|
vuse_eq, NULL, NULL, vuse1) != NULL))
|
2014-11-20 09:40:52 +01:00
|
|
|
{
|
2015-03-03 12:54:49 +01:00
|
|
|
if (insert)
|
2014-11-20 09:40:52 +01:00
|
|
|
{
|
2015-09-15 19:03:49 +02:00
|
|
|
class expr_hash_elt *element2 = new expr_hash_elt (element);
|
2015-03-03 12:54:49 +01:00
|
|
|
|
|
|
|
/* Insert the expr into the hash by replacing the current
|
|
|
|
entry and recording the value to restore in the
|
|
|
|
avail_exprs_stack. */
|
2015-09-15 19:03:49 +02:00
|
|
|
avail_exprs_stack->record_expr (element2, *slot, '2');
|
2015-03-03 12:54:49 +01:00
|
|
|
*slot = element2;
|
2014-11-20 09:40:52 +01:00
|
|
|
}
|
|
|
|
return NULL_TREE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
/* Extract the LHS of the assignment so that it can be used as the current
|
|
|
|
definition of another variable. */
|
2015-09-15 19:03:49 +02:00
|
|
|
lhs = (*slot)->lhs ();
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2015-09-01 12:51:43 +02:00
|
|
|
lhs = dom_valueize (lhs);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
if (dump_file && (dump_flags & TDF_DETAILS))
|
|
|
|
{
|
|
|
|
fprintf (dump_file, "FIND: ");
|
|
|
|
print_generic_expr (dump_file, lhs, 0);
|
|
|
|
fprintf (dump_file, "\n");
|
|
|
|
}
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
return lhs;
|
|
|
|
}
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
/* Hashing and equality functions for AVAIL_EXPRS. We compute a value number
|
|
|
|
for expressions using the code of the expression and the SSA numbers of
|
|
|
|
its operands. */
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
static hashval_t
|
2015-09-15 19:03:49 +02:00
|
|
|
avail_expr_hash (class expr_hash_elt *p)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2015-09-15 19:03:49 +02:00
|
|
|
const struct hashable_expr *expr = p->expr ();
|
2014-08-01 04:52:30 +02:00
|
|
|
inchash::hash hstate;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2014-08-01 04:52:30 +02:00
|
|
|
inchash::add_hashable_expr (expr, hstate);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2014-08-01 04:52:30 +02:00
|
|
|
return hstate.end ();
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2006-03-21 06:07:37 +01:00
|
|
|
/* PHI-ONLY copy and constant propagation. This pass is meant to clean
|
|
|
|
up degenerate PHIs created by or exposed by jump threading. */
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
/* Given a statement STMT, which is either a PHI node or an assignment,
|
2006-03-21 06:07:37 +01:00
|
|
|
remove it from the IL. */
|
|
|
|
|
|
|
|
static void
|
2008-07-28 16:33:56 +02:00
|
|
|
remove_stmt_or_phi (gimple stmt)
|
2006-03-21 06:07:37 +01:00
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
gimple_stmt_iterator gsi = gsi_for_stmt (stmt);
|
|
|
|
|
|
|
|
if (gimple_code (stmt) == GIMPLE_PHI)
|
|
|
|
remove_phi_node (&gsi, true);
|
2006-03-21 06:07:37 +01:00
|
|
|
else
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
gsi_remove (&gsi, true);
|
|
|
|
release_defs (stmt);
|
2006-03-21 06:07:37 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
/* Given a statement STMT, which is either a PHI node or an assignment,
|
2006-03-21 06:07:37 +01:00
|
|
|
return the "rhs" of the node, in the case of a non-degenerate
|
2008-07-28 16:33:56 +02:00
|
|
|
phi, NULL is returned. */
|
2006-03-21 06:07:37 +01:00
|
|
|
|
|
|
|
static tree
|
2008-07-28 16:33:56 +02:00
|
|
|
get_rhs_or_phi_arg (gimple stmt)
|
2006-03-21 06:07:37 +01:00
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
if (gimple_code (stmt) == GIMPLE_PHI)
|
2014-11-19 18:00:54 +01:00
|
|
|
return degenerate_phi_result (as_a <gphi *> (stmt));
|
2008-07-28 16:33:56 +02:00
|
|
|
else if (gimple_assign_single_p (stmt))
|
|
|
|
return gimple_assign_rhs1 (stmt);
|
|
|
|
else
|
|
|
|
gcc_unreachable ();
|
2006-03-21 06:07:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
/* Given a statement STMT, which is either a PHI node or an assignment,
|
2006-03-21 06:07:37 +01:00
|
|
|
return the "lhs" of the node. */
|
|
|
|
|
|
|
|
static tree
|
2008-07-28 16:33:56 +02:00
|
|
|
get_lhs_or_phi_result (gimple stmt)
|
2006-03-21 06:07:37 +01:00
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
if (gimple_code (stmt) == GIMPLE_PHI)
|
|
|
|
return gimple_phi_result (stmt);
|
|
|
|
else if (is_gimple_assign (stmt))
|
|
|
|
return gimple_assign_lhs (stmt);
|
|
|
|
else
|
|
|
|
gcc_unreachable ();
|
2006-03-21 06:07:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Propagate RHS into all uses of LHS (when possible).
|
|
|
|
|
|
|
|
RHS and LHS are derived from STMT, which is passed in solely so
|
|
|
|
that we can remove it if propagation is successful.
|
|
|
|
|
|
|
|
When propagating into a PHI node or into a statement which turns
|
|
|
|
into a trivial copy or constant initialization, set the
|
|
|
|
appropriate bit in INTERESTING_NAMEs so that we will visit those
|
|
|
|
nodes as well in an effort to pick up secondary optimization
|
|
|
|
opportunities. */
|
|
|
|
|
2009-11-25 11:55:54 +01:00
|
|
|
static void
|
2008-07-28 16:33:56 +02:00
|
|
|
propagate_rhs_into_lhs (gimple stmt, tree lhs, tree rhs, bitmap interesting_names)
|
2006-03-21 06:07:37 +01:00
|
|
|
{
|
2014-07-08 11:22:54 +02:00
|
|
|
/* First verify that propagation is valid. */
|
2014-07-14 12:50:46 +02:00
|
|
|
if (may_propagate_copy (lhs, rhs))
|
2006-03-21 06:07:37 +01:00
|
|
|
{
|
|
|
|
use_operand_p use_p;
|
|
|
|
imm_use_iterator iter;
|
2008-07-28 16:33:56 +02:00
|
|
|
gimple use_stmt;
|
2006-03-21 06:07:37 +01:00
|
|
|
bool all = true;
|
|
|
|
|
|
|
|
/* Dump details. */
|
|
|
|
if (dump_file && (dump_flags & TDF_DETAILS))
|
|
|
|
{
|
|
|
|
fprintf (dump_file, " Replacing '");
|
|
|
|
print_generic_expr (dump_file, lhs, dump_flags);
|
|
|
|
fprintf (dump_file, "' with %s '",
|
|
|
|
(TREE_CODE (rhs) != SSA_NAME ? "constant" : "variable"));
|
|
|
|
print_generic_expr (dump_file, rhs, dump_flags);
|
|
|
|
fprintf (dump_file, "'\n");
|
|
|
|
}
|
|
|
|
|
2009-11-25 11:55:54 +01:00
|
|
|
/* Walk over every use of LHS and try to replace the use with RHS.
|
2006-03-21 06:07:37 +01:00
|
|
|
At this point the only reason why such a propagation would not
|
|
|
|
be successful would be if the use occurs in an ASM_EXPR. */
|
2006-04-27 22:22:17 +02:00
|
|
|
FOR_EACH_IMM_USE_STMT (use_stmt, iter, lhs)
|
2006-03-21 06:07:37 +01:00
|
|
|
{
|
invoke.texi (-fvar-tracking-assignments): New.
gcc/ChangeLog:
* doc/invoke.texi (-fvar-tracking-assignments): New.
(-fvar-tracking-assignments-toggle): New.
(-fdump-final-insns=file): Mark filename as optional.
(--param min-nondebug-insn-uid): New.
(-gdwarf-@{version}): Mention version 4.
* opts.c (common_handle_option): Accept it.
* tree-vrp.c (find_assert_locations_1): Skip debug stmts.
* regrename.c (regrename_optimize): Drop last. Don't count debug
insns as uses. Don't reject change because of debug insn.
(do_replace): Reject DEBUG_INSN as chain starter. Take base_regno
from the chain starter, and check for inexact matches in
DEBUG_INSNS.
(scan_rtx_reg): Accept inexact matches in DEBUG_INSNs.
(build_def_use): Simplify and fix the marking of DEBUG_INSNs.
* sched-ebb.c (schedule_ebbs): Skip boundary debug insns.
* fwprop.c (forward_propagate_and_simplify): ...into debug insns.
* doc/gimple.texi (is_gimple_debug): New.
(gimple_debug_bind_p): New.
(is_gimple_call, gimple_assign_cast_p): End sentence with period.
* doc/install.texi (bootstrap-debug): More details.
(bootstrap-debug-big, bootstrap-debug-lean): Document.
(bootstrap-debug-lib): More details.
(bootstrap-debug-ckovw): Update.
(bootstrap-time): New.
* tree-into-ssa.c (mark_def_sites): Skip debug stmts.
(insert_phi_nodes_for): Insert debug stmts.
(rewrite_stmt): Take iterator. Insert debug stmts.
(rewrite_enter_block): Adjust.
(maybe_replace_use_in_debug_stmt): New.
(rewrite_update_stmt): Use it.
(mark_use_interesting): Return early for debug stmts.
* tree-ssa-loop-im.c (rewrite_bittest): Propagate DEFs into debug
stmts before replacing stmt.
(move_computations_stmt): Likewise.
* ira-conflicts.c (add_copies): Skip debug insns.
* regstat.c (regstat_init_n_sets_and_refs): Discount debug insns.
(regstat_bb_compute_ri): Skip debug insns.
* tree-ssa-threadupdate.c (redirection_block_p): Skip debug stmts.
* tree-ssa-loop-manip.c (find_uses_to_rename_stmt,
check_loop_closed_ssa_stmt): Skip debug stmts.
* tree-tailcall.c (find_tail_calls): Likewise.
* tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise.
* tree.h (MAY_HAVE_DEBUG_STMTS): New.
(build_var_debug_value_stat): Declare.
(build_var_debug_value): Define.
(target_for_debug_bind): Declare.
* reload.c (find_equiv_reg): Skip debug insns.
* rtlanal.c (reg_used_between_p): Skip debug insns.
(side_effects_p): Likewise.
(canonicalize_condition): Likewise.
* ddg.c (create_ddg_dep_from_intra_loop_link): Check that non-debug
insns never depend on debug insns.
(create_ddg_dep_no_link): Likewise.
(add_cross_iteration_register_deps): Use ANTI_DEP for debug insns.
Don't add inter-loop dependencies for debug insns.
(build_intra_loop_deps): Likewise.
(create_ddg): Count debug insns.
* ddg.h (struct ddg::num_debug): New.
(num_backargs): Pair up with previous int field.
* diagnostic.c (diagnostic_report_diagnostic): Skip notes on
-fcompare-debug-second.
* final.c (get_attr_length_1): Skip debug insns.
(rest_of_clean-state): Don't dump CFA_RESTORE_STATE.
* gcc.c (invoke_as): Call compare-debug-dump-opt.
(driver_self_specs): Map -fdump-final-insns to
-fdump-final-insns=..
(get_local_tick): New.
(compare_debug_dump_opt_spec_function): Test for . argument and
compute output name. Compute temp output spec without flag name.
Compute -frandom-seed.
(OPT): Undef after use.
* cfgloopanal.c (num_loop_insns): Skip debug insns.
(average_num_loop_insns): Likewise.
* params.h (MIN_NONDEBUG_INSN_UID): New.
* gimple.def (GIMPLE_DEBUG): New.
* ipa-reference.c (scan_stmt_for_static_refs): Skip debug stmts.
* auto-inc-dec.c (merge_in_block): Skip debug insns.
(merge_in_block): Fix whitespace.
* toplev.c (flag_var_tracking): Update comment.
(flag_var_tracking_assignments): New.
(flag_var_tracking_assignments_toggle): New.
(process_options): Don't open final insns dump file if we're not
going to write to it. Compute defaults for var_tracking.
* df-scan.c (df_insn_rescan_debug_internal): New.
(df_uses_record): Handle debug insns.
* haifa-sched.c (ready): Initialize n_debug.
(contributes_to_priority): Skip debug insns.
(dep_list_size): New.
(priority): Use it.
(rank_for_schedule): Likewise. Schedule debug insns as soon as
they're ready. Disregard previous debug insns to make decisions.
(queue_insn): Never queue debug insns.
(ready_add, ready_remove_first, ready_remove): Count debug insns.
(schedule_insn): Don't reject debug insns because of issue rate.
(get_ebb_head_tail, no_real_insns_p): Skip boundary debug insns.
(queue_to_ready): Skip and discount debug insns.
(choose_ready): Let debug insns through.
(schedule_block): Check boundary debug insns. Discount debug
insns, schedule them early. Adjust whitespace.
(set_priorities): Check for boundary debug insns.
(add_jump_dependencies): Use dep_list_size.
(prev_non_location_insn): New.
(check_cfg): Use it.
* tree-ssa-loop-ivopts.c (find-interesting_users): Skip debug
stmts.
(remove_unused_ivs): Reset debug stmts.
* modulo-sched.c (const_iteration_count): Skip debug insns.
(res_MII): Discount debug insns.
(loop_single_full_bb_p): Skip debug insns.
(sms_schedule): Likewise.
(sms_schedule_by_order): Likewise.
(ps_has_conflicts): Likewise.
* caller-save.c (refmarker_fn): New.
(save_call_clobbered_regs): Replace regs with saved mem in
debug insns.
(mark_referenced_regs): Take pointer, mark and arg. Adjust.
Call refmarker_fn mark for hardregnos.
(mark_reg_as_referenced): New.
(replace_reg_with_saved_mem): New.
* ipa-pure-const.c (check_stmt): Skip debug stmts.
* cse.c (cse_insn): Canonicalize debug insns. Skip them when
searching back.
(cse_extended_basic_block): Skip debug insns.
(count_reg_usage): Likewise.
(is_dead_reg): New, split out of...
(set_live_p): ... here.
(insn_live_p): Use it for debug insns.
* tree-stdarg.c (check_all_va_list_escapes): Skip debug stmts.
(execute_optimize_stdarg): Likewise.
* tree-ssa-dom.c (propagate_rhs_into_lhs): Likewise.
* tree-ssa-propagate.c (substitute_and_fold): Don't regard
changes in debug stmts as changes.
* sel-sched.c (moving_insn_creates_bookkeeping_block_p): New.
(moveup_expr): Don't move across debug insns. Don't move
debug insn if it would create a bookkeeping block.
(moveup_expr_cached): Don't use cache for debug insns that
are heads of blocks.
(compute_av_set_inside_bb): Skip debug insns.
(sel_rank_for_schedule): Schedule debug insns first. Remove
dead code.
(block_valid_for_bookkeeping_p); Support lax searches.
(create_block_for_bookkeeping): Adjust block numbers when
encountering debug-only blocks.
(find_place_for_bookkeeping): Deal with debug-only blocks.
(generate_bookkeeping_insn): Accept no place to insert.
(remove_temp_moveop_nops): New argument full_tidying.
(prepare_place_to_insert): Deal with debug insns.
(advance_state_on_fence): Debug insns don't start cycles.
(update_boundaries): Take fence as argument. Deal with
debug insns.
(schedule_expr_on_boundary): No full_tidying on debug insns.
(fill_insns): Deal with debug insns.
(track_scheduled_insns_and_blocks): Don't count debug insns.
(need_nop_to_preserve_insn_bb): New, split out of...
(remove_insn_from_stream): ... this.
(fur_orig_expr_not_found): Skip debug insns.
* rtl.def (VALUE): Move up.
(DEBUG_INSN): New.
* tree-ssa-sink.c (all_immediate_uses_same_place): Skip debug
stmts.
(nearest_common_dominator_of_uses): Take debug_stmts argument.
Set it if debug stmts are found.
(statement_sink_location): Skip debug stmts. Propagate
moving defs into debug stmts.
* ifcvt.c (first_active_insn): Skip debug insns.
(last_active_insns): Likewise.
(cond_exec_process_insns): Likewise.
(noce_process_if_block): Likewise.
(check_cond_move_block): Likewise.
(cond_move_convert_if_block): Likewise.
(block_jumps_and_fallthru_p): Likewise.
(dead_or_predicable): Likewise.
* dwarf2out.c (debug_str_hash_forced): New.
(find_AT_string): Add comment.
(gen_label_for_indirect_string): New.
(get_debug_string_label): New.
(AT_string_form): Use it.
(mem_loc_descriptor): Handle non-TLS symbols. Handle MINUS , DIV,
MOD, AND, IOR, XOR, NOT, ABS, NEG, and CONST_STRING. Accept but
discard COMPARE, IF_THEN_ELSE, ROTATE, ROTATERT, TRUNCATE and
several operations that cannot be represented with DWARF opcodes.
(loc_descriptor): Ignore SIGN_EXTEND and ZERO_EXTEND. Require
dwarf_version 4 for DW_OP_implicit_value and DW_OP_stack_value.
(dwarf2out_var_location): Take during-call mark into account.
(output_indirect_string): Update comment. Output if there are
label and references.
(prune_indirect_string): New.
(prune_unused_types): Call it if debug_str_hash_forced.
More in dwarf2out.c, from Jakub Jelinek <jakub@redhat.com>:
(dw_long_long_const): Remove.
(struct dw_val_struct): Change val_long_long type to rtx.
(print_die, attr_checksum, same_dw_val_p, loc_descriptor): Adjust for
val_long_long change to CONST_DOUBLE rtx from a long hi/lo pair.
(output_die): Likewise. Use HOST_BITS_PER_WIDE_INT size of each
component instead of HOST_BITS_PER_LONG.
(output_loc_operands): Likewise. For const8* assert
HOST_BITS_PER_WIDE_INT rather than HOST_BITS_PER_LONG is >= 64.
(output_loc_operands_raw): For const8* assert HOST_BITS_PER_WIDE_INT
rather than HOST_BITS_PER_LONG is >= 64.
(add_AT_long_long): Remove val_hi and val_lo arguments, add
val_const_double.
(size_of_die): Use HOST_BITS_PER_WIDE_INT size multiplier instead of
HOST_BITS_PER_LONG for dw_val_class_long_long.
(add_const_value_attribute): Adjust add_AT_long_long caller. Don't
handle TLS SYMBOL_REFs. If CONST wraps a constant, tail recurse.
(dwarf_stack_op_name): Handle DW_OP_implicit_value and
DW_OP_stack_value.
(size_of_loc_descr, output_loc_operands, output_loc_operands_raw):
Handle DW_OP_implicit_value.
(extract_int): Move prototype earlier.
(mem_loc_descriptor): For SUBREG punt if inner
mode size is wider than DWARF2_ADDR_SIZE. Handle SIGN_EXTEND
and ZERO_EXTEND by DW_OP_shl and DW_OP_shr{a,}. Handle
EQ, NE, GT, GE, LT, LE, GTU, GEU, LTU, LEU, SMIN, SMAX, UMIN,
UMAX, SIGN_EXTRACT, ZERO_EXTRACT.
(loc_descriptor): Compare mode size with DWARF2_ADDR_SIZE
instead of Pmode size.
(loc_descriptor): Add MODE argument. Handle CONST_INT, CONST_DOUBLE,
CONST_VECTOR, CONST, LABEL_REF and SYMBOL_REF if mode != VOIDmode,
attempt to handle other expressions. Don't handle TLS SYMBOL_REFs.
(concat_loc_descriptor, concatn_loc_descriptor,
loc_descriptor_from_tree_1): Adjust loc_descriptor callers.
(add_location_or_const_value_attribute): Likewise. For single
location loc_lists attempt to use add_const_value_attribute
for constant decls. Add DW_AT_const_value even if
NOTE_VAR_LOCATION is VAR_LOCATION with CONSTANT_P or CONST_STRING
in its expression.
* cfgbuild.c (inside_basic_block_p): Handle debug insns.
(control_flow_insn_p): Likewise.
* tree-parloops.c (eliminate_local_variables_stmt): Handle debug
stmt.
(separate_decls_in_region_debug_bind): New.
(separate_decls_in_region): Process debug bind stmts afterwards.
* recog.c (verify_changes): Handle debug insns.
(extract_insn): Likewise.
(peephole2_optimize): Skip debug insns.
* dse.c (scan_insn): Skip debug insns.
* sel-sched-ir.c (return_nop_to_pool): Take full_tidying argument.
Pass it on.
(setup_id_for_insn): Handle debug insns.
(maybe_tidy_empty_bb): Adjust whitespace.
(tidy_control_flow): Skip debug insns.
(sel_remove_insn): Adjust for debug insns.
(sel_estimate_number_of_insns): Skip debug insns.
(create_insn_rtx_from_pattern): Handle debug insns.
(create_copy_of_insn_rtx): Likewise.
* sel-sched-.h (sel_bb_end): Declare.
(sel_bb_empty_or_nop_p): New.
(get_all_loop_exits): Use it.
(_eligible_successor_edge_p): Likewise.
(return_nop_to_pool): Adjust.
* tree-eh.c (tre_empty_eh_handler_p): Skip debug stmts.
* ira-lives.c (process_bb_node_lives): Skip debug insns.
* gimple-pretty-print.c (dump_gimple_debug): New.
(dump_gimple_stmt): Use it.
(dump_bb_header): Skip gimple debug stmts.
* regmove.c (optimize_reg_copy_1): Discount debug insns.
(fixup_match_2): Likewise.
(regmove_backward_pass): Likewise. Simplify combined
replacement. Handle debug insns.
* function.c (instantiate_virtual_regs): Handle debug insns.
* function.h (struct emit_status): Add x_cur_debug_insn_uid.
* print-rtl.h: Include cselib.h.
(print_rtx): Print VALUEs. Split out and recurse for
VAR_LOCATIONs.
* df.h (df_inns_rescan_debug_internal): Declare.
* gcse.c (alloc_hash_table): Estimate n_insns.
(cprop_insn): Don't regard debug insns as changes.
(bypass_conditional_jumps): Skip debug insns.
(one_pre_gcse_pass): Adjust.
(one_code_hoisting_pass): Likewise.
(compute_ld_motion_mems): Skip debug insns.
(one_cprop_pass): Adjust.
* tree-if-conv.c (tree_if_convert_stmt): Reset debug stmts.
(if_convertible_stmt_p): Handle debug stmts.
* init-regs.c (initialize_uninitialized_regs): Skip debug insns.
* tree-vect-loop.c (vect_is_simple_reduction): Skip debug stmts.
* ira-build.c (create_bb_allocnos): Skip debug insns.
* tree-flow-inline.h (has_zero_uses): Discount debug stmts.
(has_single_use): Likewise.
(single_imm_use): Likewise.
(num_imm_uses): Likewise.
* tree-ssa-phiopt.c (empty_block_p): Skip debug stmts.
* tree-ssa-coalesce.c (build_ssa_conflict_graph): Skip debug stmts.
(create_outofssa_var_map): Likewise.
* lower-subreg.c (adjust_decomposed_uses): New.
(resolve_debug): New.
(decompose_multiword_subregs): Use it.
* tree-dfa.c (find_referenced_vars): Skip debug stmts.
* emit-rtl.c: Include params.h.
(cur_debug_insn_uid): Define.
(set_new_first_and_last_insn): Set cur_debug_insn_uid too.
(copy_rtx_if_shared_1): Handle debug insns.
(reset_used_flags): Likewise.
(set_used_flags): LIkewise.
(get_max_insn_count): New.
(next_nondebug_insn): New.
(prev_nondebug_insn): New.
(make_debug_insn_raw): New.
(emit_insn_before_noloc): Handle debug insns.
(emit_jump_insn_before_noloc): Likewise.
(emit_call_insn_before_noloc): Likewise.
(emit_debug_insn_before_noloc): New.
(emit_insn_after_noloc): Handle debug insns.
(emit_jump_insn_after_noloc): Likewise.
(emit_call_insn_after_noloc): Likewise.
(emit_debug_insn_after_noloc): Likewise.
(emit_insn_after): Take loc from earlier non-debug insn.
(emit_jump_insn_after): Likewise.
(emit_call_insn_after): Likewise.
(emit_debug_insn_after_setloc): New.
(emit_debug_insn_after): New.
(emit_insn_before): Take loc from later non-debug insn.
(emit_jump_insn_before): Likewise.
(emit_call_insn_before): Likewise.
(emit_debug_insn_before_setloc): New.
(emit_debug_insn_before): New.
(emit_insn): Handle debug insns.
(emit_debug_insn): New.
(emit_jump_insn): Handle debug insns.
(emit_call_insn): Likewise.
(emit): Likewise.
(init_emit): Take min-nondebug-insn-uid into account.
Initialize cur_debug_insn_uid.
(emit_copy_of_insn_after): Handle debug insns.
* cfgexpand.c (gimple_assign_rhs_to_tree): Do not overwrite
location of single rhs in place.
(maybe_dump_rtl_for_gimple_stmt): Dump lineno.
(floor_sdiv_adjust): New.
(cell_sdiv_adjust): New.
(cell_udiv_adjust): New.
(round_sdiv_adjust): New.
(round_udiv_adjust): New.
(wrap_constant): Moved from cselib.
(unwrap_constant): New.
(expand_debug_expr): New.
(expand_debug_locations): New.
(expand_gimple_basic_block): Drop hiding redeclaration. Expand
debug bind stmts.
(gimple_expand_cfg): Expand debug locations.
* cselib.c: Include tree-pass.h.
(struct expand_value_data): New.
(cselib_record_sets_hook): New.
(PRESERVED_VALUE_P, LONG_TERM_PRESERVED_VALUE_P): New.
(cselib_clear_table): Move, and implemnet in terms of...
(cselib_reset_table_with_next_value): ... this.
(cselib_get_next_unknown_value): New.
(discard_useless_locs): Don't discard preserved values.
(cselib_preserve_value): New.
(cselib_preserved_value_p): New.
(cselib_preserve_definitely): New.
(cselib_clear_preserve): New.
(cselib_preserve_only_values): New.
(new_cselib_val): Take rtx argument. Dump it in details.
(cselib_lookup_mem): Adjust.
(expand_loc): Take regs_active in struct. Adjust. Silence
dumps unless details are requested.
(cselib_expand_value_rtx_cb): New.
(cselib_expand_value_rtx): Rename and reimplment in terms of...
(cselib_expand_value_rtx_1): ... this. Adjust. Silence dumps
without details. Copy more subregs. Try to resolve values
using a callback. Wrap constants.
(cselib_subst_to_values): Adjust.
(cselib_log_lookup): New.
(cselib_lookup): Call it.
(cselib_invalidate_regno): Don't count preserved values as
useless.
(cselib_invalidate_mem): Likewise.
(cselib_record_set): Likewise.
(struct set): Renamed to cselib_set, moved to cselib.h.
(cselib_record_sets): Adjust. Call hook.
(cselib_process_insn): Reset table when it would be cleared.
(dump_cselib_val): New.
(dump_cselib_table): New.
* tree-cfgcleanup.c (tree_forwarded_block_p): Skip debug stmts.
(remove_forwarder_block): Support moving debug stmts.
* cselib.h (cselib_record_sets_hook): Declare.
(cselib_expand_callback): New type.
(cselib_expand_value_rtx_cb): Declare.
(cselib_reset_table_with_next_value): Declare.
(cselib_get_next_unknown_value): Declare.
(cselib_preserve_value): Declare.
(cselib_preserved_value_p): Declare.
(cselib_preserve_only_values): Declare.
(dump_cselib_table): Declare.
* cfgcleanup.c (flow_find_cross_jump): Skip debug insns.
(try_crossjump_to_edge): Likewise.
(delete_unreachable_blocks): Remove dominant GIMPLE blocks after
dominated blocks when debug stmts are present.
* simplify-rtx.c (delegitimize_mem_from_attrs): New.
* tree-ssa-live.c (remove_unused_locals): Skip debug stmts.
(set_var_live_on_entry): Likewise.
* loop-invariant.c (find_invariants_bb): Skip debug insns.
* cfglayout.c (curr_location, last_location): Make static.
(set_curr_insn_source_location): Don't avoid bouncing.
(get_curr_insn_source_location): New.
(get_curr_insn_block): New.
(duplicate_insn_chain): Handle debug insns.
* tree-ssa-forwprop.c (forward_propagate_addr_expr): Propagate
into debug stmts.
* common.opt (fcompare-debug): Move to sort order.
(fdump-unnumbered-links): Likewise.
(fvar-tracking-assignments): New.
(fvar-tracking-assignments-toggle): New.
* tree-ssa-dce.c (mark_stmt_necessary): Don't mark blocks
because of debug stmts.
(mark_stmt_if_obviously_necessary): Mark debug stmts.
(eliminate_unnecessary_stmts): Walk dominated blocks before
dominators.
* tree-ssa-ter.c (find_replaceable_in_bb): Skip debug stmts.
* ira.c (memref_used_between_p): Skip debug insns.
(update_equiv_regs): Likewise.
* sched-deps.c (sd_lists_size): Accept empty list.
(sd_init_insn): Mark debug insns.
(sd_finish_insn): Unmark them.
(sd_add_dep): Reject non-debug deps on debug insns.
(fixup_sched_groups): Give debug insns group treatment.
Skip debug insns.
(sched_analyze_reg): Don't mark debug insns for sched before call.
(sched_analyze_2): Handle debug insns.
(sched_analyze_insn): Compute next non-debug insn. Handle debug
insns.
(deps_analyze_insn): Handle debug insns.
(deps_start_bb): Skip debug insns.
(init_deps): Initialize last_debug_insn.
* tree-ssa.c (target_for_debug_bind): New.
(find_released_ssa_name): New.
(propagate_var_def_into_debug_stmts): New.
(propagate_defs_into_debug_stmts): New.
(verify_ssa): Skip debug bind stmts without values.
(warn_uninialized_vars): Skip debug stmts.
* target-def.h (TARGET_DELEGITIMIZE_ADDRESS): Set default.
* rtl.c (rtx_equal_p_cb): Handle VALUEs.
(rtx_equal_p): Likewise.
* ira-costs.c (scan_one_insn): Skip debug insns.
(process_bb_node_for_hard_reg_moves): Likewise.
* rtl.h (DEBUG_INSN_P): New.
(NONDEBUG_INSN_P): New.
(MAY_HAVE_DEBUG_INSNS): New.
(INSN_P): Accept debug insns.
(RTX_FRAME_RELATED_P): Likewise.
(INSN_DELETED_P): Likewise
(PAT_VAR_LOCATION_DECL): New.
(PAT_VAR_LOCATION_LOC): New.
(PAT_VAR_OCATION_STATUS): New.
(NOTE_VAR_LOCATION_DECL): Reimplement.
(NOTE_VAR_LOCATION_LOC): Likewise.
(NOTE_VAR_LOCATION_STATUS): Likewise.
(INSN_VAR_LOCATION): New.
(INSN_VAR_LOCATION_DECL): New.
(INSN_VAR_LOCATION_LOC): New.
(INSN_VAR_LOCATION_STATUS): New.
(gen_rtx_UNKNOWN_VAR_LOC): New.
(VAR_LOC_UNKNOWN_P): New.
(NOTE_DURING_CALL_P): New.
(SCHED_GROUP_P): Accept debug insns.
(emit_debug_insn_before): Declare.
(emit_debug_insn_before_noloc): Declare.
(emit_debug_insn_beore_setloc): Declare.
(emit_debug_insn_after): Declare.
(emit_debug_insn_after_noloc): Declare.
(emit_debug_insn_after_setloc): Declare.
(emit_debug_insn): Declare.
(make_debug_insn_raw): Declare.
(prev_nondebug_insn): Declare.
(next_nondebug_insn): Declare.
(delegitimize_mem_from_attrs): Declare.
(get_max_insn_count): Declare.
(wrap_constant): Declare.
(unwrap_constant): Declare.
(get_curr_insn_source_location): Declare.
(get_curr_insn_block): Declare.
* tree-inline.c (insert_debug_decl_map): New.
(processing_debug_stmt): New.
(remap_decl): Don't create new mappings in debug stmts.
(remap_gimple_op_r): Don't add references in debug stmts.
(copy_tree_body_r): Likewise.
(remap_gimple_stmt): Handle debug bind stmts.
(copy_bb): Skip debug stmts.
(copy_edges_for_bb): Likewise.
(copy_debug_stmt): New.
(copy_debug_stmts): New.
(copy_body): Copy debug stmts at the end.
(insert_init_debug_bind): New.
(insert_init_stmt): Take id. Skip and emit debug stmts.
(setup_one_parameter): Remap variable earlier, register debug
mapping.
(estimate_num_insns): Skip debug stmts.
(expand_call_inline): Preserve debug_map.
(optimize_inline_calls): Check for no debug_stmts left-overs.
(unsave_expr_now): Preserve debug_map.
(copy_gimple_seq_and_replace_locals): Likewise.
(tree_function_versioning): Check for no debug_stmts left-overs.
Init and destroy debug_map as needed. Split edges unconditionally.
(build_duplicate_type): Init and destroy debug_map as needed.
* tree-inline.h: Include gimple.h instead of pointer-set.h.
(struct copy_body_data): Add debug_stmts and debug_map.
* sched-int.h (struct ready_list): Add n_debug.
(struct deps): Add last_debug_insn.
(DEBUG_INSN_SCHED_P): New.
(BOUNDARY_DEBUG_INSN_P): New.
(SCHEDULE_DEBUG_INSN_P): New.
(sd_iterator_cond): Accept empty list.
* combine.c (create_log_links): Skip debug insns.
(combine_instructions): Likewise.
(cleanup_auto_inc_dec): New. From Jakub Jelinek: Make sure the
return value is always unshared.
(struct rtx_subst_pair): New.
(auto_adjust_pair): New.
(propagate_for_debug_subst): New.
(propagate_for_debug): New.
(try_combine): Skip debug insns. Propagate removed defs into
debug insns.
(next_nonnote_nondebug_insn): New.
(distribute_notes): Use it. Skip debug insns.
(distribute_links): Skip debug insns.
* tree-outof-ssa.c (set_location_for_edge): Likewise.
* resource.c (mark_target_live_regs): Likewise.
* var-tracking.c: Include cselib.h and target.h.
(enum micro_operation_type): Add MO_VAL_USE, MO_VAL_LOC, and
MO_VAL_SET.
(micro_operation_type_name): New.
(enum emit_note_where): Add EMIT_NOTE_AFTER_CALL_INSN.
(struct micro_operation_def): Update comments.
(decl_or_value): New type. Use instead of decls.
(struct emit_note_data_def): Add vars.
(struct attrs_def): Use decl_or_value.
(struct variable_tracking_info_def): Add permp, flooded.
(struct location_chain_def): Update comment.
(struct variable_part_def): Use decl_or_value.
(struct variable_def): Make var_part a variable length array.
(valvar_pool): New.
(scratch_regs): New.
(cselib_hook_called): New.
(dv_is_decl_p): New.
(dv_is_value_p): New.
(dv_as_decl): New.
(dv_as_value): New.
(dv_as_opaque): New.
(dv_onepart_p): New.
(dv_pool): New.
(IS_DECL_CODE): New.
(check_value_is_not_decl): New.
(dv_from_decl): New.
(dv_from_value): New.
(dv_htab_hash): New.
(variable_htab_hash): Use it.
(variable_htab_eq): Support values.
(variable_htab_free): Free from the right pool.
(attrs_list_member, attrs_list_insert): Use decl_or_value.
(attrs_list_union): Adjust.
(attrs_list_mpdv_union): New.
(tie_break_pointers): New.
(canon_value_cmp): New.
(unshare_variable): Return possibly-modified slot.
(vars_copy_1): Adjust.
(var_reg_decl_set): Adjust. Split out of...
(var_reg_set): ... this.
(get_init_value): Adjust.
(var_reg_delete_and_set): Adjust.
(var_reg_delete): Adjust.
(var_regno_delete): Adjust.
(var_mem_decl_set): Split out of...
(var_mem_set): ... this.
(var_mem_delete_and_set): Adjust.
(var_mem_delete): Adjust.
(val_store): New.
(val_reset): New.
(val_resolve): New.
(variable_union): Adjust. Speed up merge of 1-part vars.
(variable_canonicalize): Use unshared slot.
(VALUED_RECURSED_INTO): New.
(find_loc_in_1pdv): New.
(struct dfset_merge): New.
(insert_into_intersection): New.
(intersect_loc_chains): New.
(loc_cmp): New.
(canonicalize_loc_order_check): New.
(canonicalize_values_mark): New.
(canonicalize_values_star): New.
(variable_merge_over_cur): New.
(variable_merge_over_src): New.
(dataflow_set_merge): New.
(dataflow_set_equiv_regs): New.
(remove_duplicate_values): New.
(struct dfset_post_merge): New.
(variable_post_merge_new_vals): New.
(variable_post_merge_perm_vals): New.
(dataflow_post_merge_adjust): New.
(find_mem_expr_in_1pdv): New.
(dataflow_set_preserve_mem_locs): New.
(dataflow_set_remove_mem_locs): New.
(dataflow_set_clear_at_call): New.
(onepart_variable_different_p): New.
(variable_different_p): Use it.
(dataflow_set_different_1): Adjust. Make detailed dump
more verbose.
(track_expr_p): Add need_rtl parameter. Don't generate rtl
if not needed.
(track_loc_p): Pass it true.
(struct count_use_info): New.
(find_use_val): New.
(replace_expr_with_values): New.
(log_op_type): New.
(use_type): New, partially split out of...
(count_uses): ... this. Count new micro-ops.
(count_uses_1): Adjust.
(count_stores): Adjust.
(count_with_sets): New.
(VAL_NEEDS_RESOLUTION): New.
(VAL_HOLDS_TRACK_EXPR): New.
(VAL_EXPR_IS_COPIED): New.
(VAL_EXPR_IS_CLOBBERED): New.
(add_uses): Adjust. Generate new micro-ops.
(add_uses_1): Adjust.
(add_stores): Generate new micro-ops.
(add_with_sets): New.
(find_src_status): Adjust.
(find_src_set_src): Adjust.
(compute_bb_dataflow): Use dataflow_set_clear_at_call.
Handle new micro-ops. Canonicalize value equivalances.
(vt_find_locations): Compute total size of hash tables for
dumping. Perform merge for var-tracking-assignments. Don't
disregard single-block loops.
(dump_attrs_list): Handle decl_or_value.
(dump_variable): Take variable. Deal with decl_or_value.
(dump_variable_slot): New.
(dump_vars): Use it.
(dump_dataflow_sets): Adjust.
(set_slot_part): New, extended to support one-part variables
after splitting out of...
(set_variable_part): ... this.
(clobber_slot_part): New, split out of...
(clobber_variable_part): ... this.
(delete_slot_part): New, split out of...
(delete_variable_part): .... this.
(check_wrap_constant): New.
(vt_expand_loc_callback): New.
(vt_expand_loc): New.
(emit_note_insn_var_location): Adjust. Handle values. Handle
EMIT_NOTE_AFTER_CALL_INSN.
(emit_notes_for_differences_1): Adjust. Handle values.
(emit_notes_for_differences_2): Likewise.
(emit_notes_for_differences): Adjust.
(emit_notes_in_bb): Take pointer to set. Emit AFTER_CALL_INSN
notes. Adjust. Handle new micro-ops.
(vt_add_function_parameters): Adjust. Create and bind values.
(vt_initialize): Adjust. Initialize scratch_regs and
valvar_pool, flooded and perm.. Initialize and use cselib. Log
operations. Move some code to count_with_sets and add_with_sets.
(delete_debug_insns): New.
(vt_debug_insns_local): New.
(vt_finalize): Release permp, valvar_pool, scratch_regs. Finish
cselib.
(var_tracking_main): If var-tracking-assignments is enabled
but var-tracking isn't, delete debug insns and leave. Likewise
if we exceed limits or fail the stack adjustments tests, and
after all var-tracking processing.
More in var-tracking, from Jakub Jelinek <jakub@redhat.com>:
(dataflow_set): Add traversed_vars.
(value_chain, const_value_chain): New typedefs.
(value_chain_pool, value_chains): New variables.
(value_chain_htab_hash, value_chain_htab_eq, add_value_chain,
add_value_chains, add_cselib_value_chains, remove_value_chain,
remove_value_chains, remove_cselib_value_chains): New functions.
(shared_hash_find_slot_unshare_1, shared_hash_find_slot_1,
shared_hash_find_slot_noinsert_1, shared_hash_find_1): New
static inlines.
(shared_hash_find_slot_unshare, shared_hash_find_slot,
shared_hash_find_slot_noinsert, shared_hash_find): Update.
(dst_can_be_shared): New variable.
(unshare_variable): Unshare set->vars if shared, use shared_hash_*.
Clear dst_can_be_shared. If set->traversed_vars is non-NULL and
different from set->vars, look up slot again instead of using the
passed in slot.
(dataflow_set_init): Initialize traversed_vars.
(variable_union): Use shared_hash_*. Use initially NO_INSERT
lookup if set->vars is shared. Don't keep slot cleared before
calling unshare_variable. Unshare set->vars if needed. Adjust
unshare_variable callers. Clear dst_can_be_shared if needed.
Even ->refcount == 1 vars must be unshared if set->vars is shared
and var needs to be modified.
(dataflow_set_union): Set traversed_vars during canonicalization.
(VALUE_CHANGED, DECL_CHANGED): Define.
(set_dv_changed, dv_changed_p): New static inlines.
(track_expr_p): Clear DECL_CHANGED.
(dump_dataflow_sets): Set it.
(variable_was_changed): Call set_dv_changed.
(emit_note_insn_var_location): Likewise.
(changed_variables_stack): New variable.
(check_changed_vars_1, check_changed_vars_2): New functions.
(emit_notes_for_changes): Do nothing if changed_variables is
empty. Traverse changed_variables with check_changed_vars_1,
call check_changed_vars_2 on each changed_variables_stack entry.
(emit_notes_in_bb): Add SET argument. Just clear it at the
beginning, use it instead of local &set, don't destroy it at the
end.
(vt_emit_notes): Call dataflow_set_clear early on all
VTI(bb)->out sets, never use them, instead use emit_notes_in_bb
computed set, dataflow_set_clear also VTI(bb)->in when we are
done with the basic block. Initialize changed_variables_stack,
free it afterwards. If ENABLE_CHECKING verify that after noting
differences to an empty set value_chains hash table is empty.
(vt_initialize): Initialize value_chains and value_chain_pool.
(vt_finalize): Delete value_chains htab, free value_chain_pool.
(variable_tracking_main): Call dump_dataflow_sets before calling
vt_emit_notes, not after it.
* tree-flow.h (propagate_defs_into_debug_stmts): Declare.
(propagate_var_def_into_debug_stmts): Declare.
* df-problems.c (df_lr_bb_local_compute): Skip debug insns.
(df_set_note): Reject debug insns.
(df_whole_mw_reg_dead_p): Take added_notes_p argument. Don't
add notes to debug insns.
(df_note_bb_compute): Adjust. Likewise.
(df_simulate_uses): Skip debug insns.
(df_simulate_initialize_backwards): Likewise.
* reg-stack.c (subst_stack_regs_in_debug_insn): New.
(subst_stack_regs_pat): Reject debug insns.
(convert_regs_1): Handle debug insns.
* Makefile.in (TREE_INLINE_H): Take pointer-set.h from GIMPLE_H.
(print-rtl.o): Depend on cselib.h.
(cselib.o): Depend on TREE_PASS_H.
(var-tracking.o): Depend on cselib.h and TARGET_H.
* sched-rgn.c (rgn_estimate_number_of_insns): Discount
debug insns.
(init_ready_list): Skip boundary debug insns.
(add_branch_dependences): Skip debug insns.
(free_block_dependencies): Check for blocks with only debug
insns.
(compute_priorities): Likewise.
* gimple.c (gss_for_code): Handle GIMPLE_DEBUG.
(gimple_build_with_ops_stat): Take subcode as unsigned. Adjust
all callers.
(gimple_build_debug_bind_stat): New.
(empty_body_p): Skip debug stmts.
(gimple_has_side_effects): Likewise.
(gimple_rhs_has_side_effects): Likewise.
* gimple.h (enum gimple_debug_subcode, GIMPLE_DEBUG_BIND): New.
(gimple_build_debug_bind_stat): Declare.
(gimple_build_debug_bind): Define.
(is_gimple_debug): New.
(gimple_debug_bind_p): New.
(gimple_debug_bind_get_var): New.
(gimple_debug_bind_get_value): New.
(gimple_debug_bind_get_value_ptr): New.
(gimple_debug_bind_set_var): New.
(gimple_debug_bind_set_value): New.
(GIMPLE_DEBUG_BIND_NOVALUE): New internal temporary macro.
(gimple_debug_bind_reset_value): New.
(gimple_debug_bind_has_value_p): New.
(gsi_next_nondebug): New.
(gsi_prev_nondebug): New.
(gsi_start_nondebug_bb): New.
(gsi_last_nondebug_bb): New.
* sched-vis.c (print_pattern): Handle VAR_LOCATION.
(print_insn): Handle DEBUG_INSN.
* tree-cfg.c (remove_bb): Walk stmts backwards. Let loc
of first insn prevail.
(first_stmt): Skip debug stmts.
(first_non_label_stmt): Likewise.
(last_stmt): Likewise.
(has_zero_uses_1): New.
(single_imm_use_1): New.
(verify_gimple_debug): New.
(verify_types_in_gimple_stmt): Handle debug stmts.
(verify_stmt): Likewise.
(debug_loop_num): Skip debug stmts.
(remove_edge_and_dominated_blocks): Remove dominators last.
* tree-ssa-reasssoc.c (rewrite_expr_tree): Propagate into
debug stmts.
(linearize_expr): Likewise.
* config/i386/i386.c (ix86_delegitimize_address): Call
default implementation.
* config/ia64/ia64.c (ia64_safe_itanium_class): Handle debug
insns.
(group_barrier_needed): Skip debug insns.
(emit_insn_group_barriers): Likewise.
(emit_all_insn_group_barriers): Likewise.
(ia64_variable_issue): Handle debug insns.
(ia64_dfa_new_cycle): Likewise.
(final_emit_insn_group_barriers): Skip debug insns.
(ia64_dwarf2out_def_steady_cfa): Take frame argument. Don't
def cfa without frame.
(process_set): Likewise.
(process_for_unwind_directive): Pass frame on.
* config/rs6000/rs6000.c (TARGET_DELEGITIMIZE_ADDRESS): Define.
(rs6000_delegitimize_address): New.
(rs6000_debug_adjust_cost): Handle debug insns.
(is_microcoded_insn): Likewise.
(is_cracked_insn): Likewise.
(is_nonpipeline_insn): Likewise.
(insn_must_be_first_in_group): Likewise.
(insn_must_be_last_in_group): Likewise.
(force_new_group): Likewise.
* cfgrtl.c (rtl_split_block): Emit INSN_DELETED note if block
contains only debug insns.
(rtl_merge_blocks): Skip debug insns.
(purge_dead_edges): Likewise.
(rtl_block_ends_with_call_p): Skip debug insns.
* dce.c (deletable_insn_p): Handle VAR_LOCATION.
(mark_reg_dependencies): Skip debug insns.
* params.def (PARAM_MIN_NONDEBUG_INSN_UID): New.
* tree-ssanames.c (release_ssa_name): Propagate def into
debug stmts.
* tree-ssa-threadedge.c
(record_temporary_equivalences_from_stmts): Skip debug stmts.
* regcprop.c (replace_oldest_value_addr): Skip debug insns.
(replace_oldest_value_mem): Use ALL_REGS for debug insns.
(copyprop_hardreg_forward_1): Handle debug insns.
* reload1.c (reload): Skip debug insns. Replace unassigned
pseudos in debug insns with their equivalences.
(eliminate_regs_in_insn): Skip debug insns.
(emit_input_reload_insns): Skip debug insns at first, adjust
them later.
* tree-ssa-operands.c (add_virtual_operand): Reject debug stmts.
(get_indirect_ref_operands): Pass opf_no_vops on.
(get_expr_operands): Likewise. Skip debug stmts.
(parse_ssa_operands): Scan debug insns with opf_no_vops.
gcc/testsuite/ChangeLog:
* gcc.dg/guality/guality.c: New.
* gcc.dg/guality/guality.h: New.
* gcc.dg/guality/guality.exp: New.
* gcc.dg/guality/example.c: New.
* lib/gcc-dg.exp (cleanup-dump): Remove .gk files.
(cleanup-saved-temps): Likewise, .gkd files too.
gcc/cp/ChangeLog:
* cp-tree.h (TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS): New.
* cp-lang.c (cxx_dwarf_name): Pass it.
* error.c (count_non_default_template_args): Take flags as
argument. Adjust all callers. Skip counting of default
arguments if the new flag is given.
ChangeLog:
* Makefile.tpl (BUILD_CONFIG): Default to bootstrap-debug.
* Makefile.in: Rebuilt.
contrib/ChangeLog:
* compare-debug: Look for .gkd files and compare them.
config/ChangeLog:
* bootstrap-debug.mk: Add comments.
* bootstrap-debug-big.mk: New.
* bootstrap-debug-lean.mk: New.
* bootstrap-debug-ckovw.mk: Add comments.
* bootstrap-debug-lib.mk: Drop CFLAGS for stages. Use -g0
for TFLAGS in stage1. Drop -fvar-tracking-assignments-toggle.
From-SVN: r151312
2009-09-02 04:42:21 +02:00
|
|
|
/* Leave debug stmts alone. If we succeed in propagating
|
|
|
|
all non-debug uses, we'll drop the DEF, and propagation
|
|
|
|
into debug stmts will occur then. */
|
|
|
|
if (gimple_debug_bind_p (use_stmt))
|
|
|
|
continue;
|
2009-11-25 11:55:54 +01:00
|
|
|
|
2006-03-21 06:07:37 +01:00
|
|
|
/* It's not always safe to propagate into an ASM_EXPR. */
|
2008-07-28 16:33:56 +02:00
|
|
|
if (gimple_code (use_stmt) == GIMPLE_ASM
|
|
|
|
&& ! may_propagate_copy_into_asm (lhs))
|
2006-03-21 06:07:37 +01:00
|
|
|
{
|
|
|
|
all = false;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2010-07-20 14:41:20 +02:00
|
|
|
/* It's not ok to propagate into the definition stmt of RHS.
|
|
|
|
<bb 9>:
|
|
|
|
# prephitmp.12_36 = PHI <g_67.1_6(9)>
|
|
|
|
g_67.1_6 = prephitmp.12_36;
|
|
|
|
goto <bb 9>;
|
|
|
|
While this is strictly all dead code we do not want to
|
|
|
|
deal with this here. */
|
|
|
|
if (TREE_CODE (rhs) == SSA_NAME
|
|
|
|
&& SSA_NAME_DEF_STMT (rhs) == use_stmt)
|
|
|
|
{
|
|
|
|
all = false;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2006-03-21 06:07:37 +01:00
|
|
|
/* Dump details. */
|
|
|
|
if (dump_file && (dump_flags & TDF_DETAILS))
|
|
|
|
{
|
|
|
|
fprintf (dump_file, " Original statement:");
|
2008-07-28 16:33:56 +02:00
|
|
|
print_gimple_stmt (dump_file, use_stmt, 0, dump_flags);
|
2006-03-21 06:07:37 +01:00
|
|
|
}
|
|
|
|
|
2006-04-03 19:08:42 +02:00
|
|
|
/* Propagate the RHS into this use of the LHS. */
|
2006-04-27 22:22:17 +02:00
|
|
|
FOR_EACH_IMM_USE_ON_STMT (use_p, iter)
|
|
|
|
propagate_value (use_p, rhs);
|
2006-04-03 19:08:42 +02:00
|
|
|
|
|
|
|
/* Special cases to avoid useless calls into the folding
|
|
|
|
routines, operand scanning, etc.
|
|
|
|
|
2012-08-08 16:40:30 +02:00
|
|
|
Propagation into a PHI may cause the PHI to become
|
2006-04-03 19:08:42 +02:00
|
|
|
a degenerate, so mark the PHI as interesting. No other
|
2012-08-08 16:40:30 +02:00
|
|
|
actions are necessary. */
|
|
|
|
if (gimple_code (use_stmt) == GIMPLE_PHI)
|
2006-04-03 19:08:42 +02:00
|
|
|
{
|
2012-08-08 16:40:30 +02:00
|
|
|
tree result;
|
|
|
|
|
2006-04-03 19:08:42 +02:00
|
|
|
/* Dump details. */
|
|
|
|
if (dump_file && (dump_flags & TDF_DETAILS))
|
|
|
|
{
|
|
|
|
fprintf (dump_file, " Updated statement:");
|
2008-07-28 16:33:56 +02:00
|
|
|
print_gimple_stmt (dump_file, use_stmt, 0, dump_flags);
|
2006-04-03 19:08:42 +02:00
|
|
|
}
|
|
|
|
|
2012-08-08 16:40:30 +02:00
|
|
|
result = get_lhs_or_phi_result (use_stmt);
|
|
|
|
bitmap_set_bit (interesting_names, SSA_NAME_VERSION (result));
|
2006-04-03 19:08:42 +02:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2009-11-25 11:55:54 +01:00
|
|
|
/* From this point onward we are propagating into a
|
2006-04-03 19:08:42 +02:00
|
|
|
real statement. Folding may (or may not) be possible,
|
|
|
|
we may expose new operands, expose dead EH edges,
|
|
|
|
etc. */
|
2008-07-28 16:33:56 +02:00
|
|
|
/* NOTE tuples. In the tuples world, fold_stmt_inplace
|
|
|
|
cannot fold a call that simplifies to a constant,
|
|
|
|
because the GIMPLE_CALL must be replaced by a
|
|
|
|
GIMPLE_ASSIGN, and there is no way to effect such a
|
|
|
|
transformation in-place. We might want to consider
|
|
|
|
using the more general fold_stmt here. */
|
2011-09-09 13:52:51 +02:00
|
|
|
{
|
|
|
|
gimple_stmt_iterator gsi = gsi_for_stmt (use_stmt);
|
|
|
|
fold_stmt_inplace (&gsi);
|
|
|
|
}
|
2006-03-25 00:21:27 +01:00
|
|
|
|
|
|
|
/* Sometimes propagation can expose new operands to the
|
2009-05-24 13:20:29 +02:00
|
|
|
renamer. */
|
|
|
|
update_stmt (use_stmt);
|
2006-03-21 06:07:37 +01:00
|
|
|
|
|
|
|
/* Dump details. */
|
|
|
|
if (dump_file && (dump_flags & TDF_DETAILS))
|
|
|
|
{
|
|
|
|
fprintf (dump_file, " Updated statement:");
|
2008-07-28 16:33:56 +02:00
|
|
|
print_gimple_stmt (dump_file, use_stmt, 0, dump_flags);
|
2006-03-21 06:07:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* If we replaced a variable index with a constant, then
|
|
|
|
we would need to update the invariant flag for ADDR_EXPRs. */
|
2008-07-28 16:33:56 +02:00
|
|
|
if (gimple_assign_single_p (use_stmt)
|
|
|
|
&& TREE_CODE (gimple_assign_rhs1 (use_stmt)) == ADDR_EXPR)
|
2006-12-05 18:26:05 +01:00
|
|
|
recompute_tree_invariant_for_addr_expr
|
2008-07-28 16:33:56 +02:00
|
|
|
(gimple_assign_rhs1 (use_stmt));
|
2006-03-21 06:07:37 +01:00
|
|
|
|
|
|
|
/* If we cleaned up EH information from the statement,
|
2006-03-28 17:35:47 +02:00
|
|
|
mark its containing block as needing EH cleanups. */
|
2006-03-21 06:07:37 +01:00
|
|
|
if (maybe_clean_or_replace_eh_stmt (use_stmt, use_stmt))
|
2006-03-28 17:35:47 +02:00
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
bitmap_set_bit (need_eh_cleanup, gimple_bb (use_stmt)->index);
|
2006-03-28 17:35:47 +02:00
|
|
|
if (dump_file && (dump_flags & TDF_DETAILS))
|
|
|
|
fprintf (dump_file, " Flagged to clear EH edges.\n");
|
|
|
|
}
|
2006-03-21 06:07:37 +01:00
|
|
|
|
2006-04-03 19:08:42 +02:00
|
|
|
/* Propagation may expose new trivial copy/constant propagation
|
|
|
|
opportunities. */
|
2008-07-28 16:33:56 +02:00
|
|
|
if (gimple_assign_single_p (use_stmt)
|
|
|
|
&& TREE_CODE (gimple_assign_lhs (use_stmt)) == SSA_NAME
|
|
|
|
&& (TREE_CODE (gimple_assign_rhs1 (use_stmt)) == SSA_NAME
|
|
|
|
|| is_gimple_min_invariant (gimple_assign_rhs1 (use_stmt))))
|
|
|
|
{
|
2006-03-21 06:07:37 +01:00
|
|
|
tree result = get_lhs_or_phi_result (use_stmt);
|
|
|
|
bitmap_set_bit (interesting_names, SSA_NAME_VERSION (result));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Propagation into these nodes may make certain edges in
|
|
|
|
the CFG unexecutable. We want to identify them as PHI nodes
|
|
|
|
at the destination of those unexecutable edges may become
|
|
|
|
degenerates. */
|
2008-07-28 16:33:56 +02:00
|
|
|
else if (gimple_code (use_stmt) == GIMPLE_COND
|
|
|
|
|| gimple_code (use_stmt) == GIMPLE_SWITCH
|
|
|
|
|| gimple_code (use_stmt) == GIMPLE_GOTO)
|
|
|
|
{
|
2006-03-21 06:07:37 +01:00
|
|
|
tree val;
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
if (gimple_code (use_stmt) == GIMPLE_COND)
|
re PR c/40435 (Revision 148442 caused many regressions on trunk)
2009-07-17 Aldy Hernandez <aldyh@redhat.com>
Manuel López-Ibáñez <manu@gcc.gnu.org>
PR 40435
* tree-complex.c, tree-loop-distribution.c,
tree.c, tree.h, builtins.c, fold-const.c, omp-low.c,
cgraphunit.c, tree-ssa-ccp.c, tree-ssa-dom.c,
gimple-low.c, expr.c, tree-ssa-ifcombine.c, c-decl.c,
stor-layout.c, tree-if-conv.c, c-typeck.c,
gimplify.c, calls.c, tree-sra.c, tree-mudflap.c,
tree-ssa-copy.c, tree-ssa-forwprop.c, c-convert.c, c-omp.c,
varasm.c, tree-inline.c, c-common.c,
c-common.h, gimple.c, tree-switch-conversion.c, gimple.h,
tree-cfg.c, c-parser.c, convert.c: Add location
argument to fold_{unary,binary,ternary}, fold_build[123],
build_call_expr, build_size_arg, build_fold_addr_expr,
build_call_array, non_lvalue, size_diffop,
fold_build1_initializer, fold_build2_initializer,
fold_build3_initializer, fold_build_call_array,
fold_build_call_array_initializer, fold_single_bit_test,
omit_one_operand, omit_two_operands, invert_truthvalue,
fold_truth_not_expr, build_fold_indirect_ref, fold_indirect_ref,
combine_comparisons, fold_builtin_*, fold_call_expr,
build_range_check, maybe_fold_offset_to_address, round_up,
round_down.
objc/
* objc-act.c: Add location argument to all calls to
build_fold_addr_expr.
testsuite/
* gcc.dg/pr36902.c: Add column info.
* g++.dg/gcov/gcov-2.C: Change count for definition.
cp/
* typeck.c, init.c, class.c, method.c, rtti.c, except.c, error.c,
tree.c, cp-gimplify.c, cxx-pretty-print.c, pt.c, semantics.c,
call.c, cvt.c, mangle.c: Add location argument to
fold_{unary,binary,ternary}, fold_build[123], build_call_expr,
build_size_arg, build_fold_addr_expr, build_call_array,
non_lvalue, size_diffop, fold_build1_initializer,
fold_build2_initializer, fold_build3_initializer,
fold_build_call_array, fold_build_call_array_initializer,
fold_single_bit_test, omit_one_operand, omit_two_operands,
invert_truthvalue, fold_truth_not_expr, build_fold_indirect_ref,
fold_indirect_ref, combine_comparisons, fold_builtin_*,
fold_call_expr, build_range_check, maybe_fold_offset_to_address,
round_up, round_down.
fortran/
* trans-expr.c, trans-array.c, trans-openmp.c, trans-stmt.c,
trans.c, trans-io.c, trans-decl.c, trans-intrinsic.c: Add location
argument to fold_{unary,binary,ternary}, fold_build[123],
build_call_expr, build_size_arg, build_fold_addr_expr,
build_call_array, non_lvalue, size_diffop,
fold_build1_initializer, fold_build2_initializer,
fold_build3_initializer, fold_build_call_array,
fold_build_call_array_initializer, fold_single_bit_test,
omit_one_operand, omit_two_operands, invert_truthvalue,
fold_truth_not_expr, build_fold_indirect_ref, fold_indirect_ref,
combine_comparisons, fold_builtin_*, fold_call_expr,
build_range_check, maybe_fold_offset_to_address, round_up,
round_down.
Co-Authored-By: Manuel López-Ibáñez <manu@gcc.gnu.org>
From-SVN: r149722
2009-07-17 00:29:52 +02:00
|
|
|
val = fold_binary_loc (gimple_location (use_stmt),
|
|
|
|
gimple_cond_code (use_stmt),
|
2008-07-28 16:33:56 +02:00
|
|
|
boolean_type_node,
|
|
|
|
gimple_cond_lhs (use_stmt),
|
|
|
|
gimple_cond_rhs (use_stmt));
|
|
|
|
else if (gimple_code (use_stmt) == GIMPLE_SWITCH)
|
2014-11-19 18:00:54 +01:00
|
|
|
val = gimple_switch_index (as_a <gswitch *> (use_stmt));
|
2006-03-21 06:07:37 +01:00
|
|
|
else
|
2008-07-28 16:33:56 +02:00
|
|
|
val = gimple_goto_dest (use_stmt);
|
2006-03-21 06:07:37 +01:00
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
if (val && is_gimple_min_invariant (val))
|
2006-03-21 06:07:37 +01:00
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
basic_block bb = gimple_bb (use_stmt);
|
2006-03-21 06:07:37 +01:00
|
|
|
edge te = find_taken_edge (bb, val);
|
2015-05-13 12:59:49 +02:00
|
|
|
if (!te)
|
|
|
|
continue;
|
|
|
|
|
2006-03-21 06:07:37 +01:00
|
|
|
edge_iterator ei;
|
|
|
|
edge e;
|
2014-11-19 18:00:54 +01:00
|
|
|
gimple_stmt_iterator gsi;
|
|
|
|
gphi_iterator psi;
|
2006-03-21 06:07:37 +01:00
|
|
|
|
|
|
|
/* Remove all outgoing edges except TE. */
|
|
|
|
for (ei = ei_start (bb->succs); (e = ei_safe_edge (ei));)
|
|
|
|
{
|
|
|
|
if (e != te)
|
|
|
|
{
|
|
|
|
/* Mark all the PHI nodes at the destination of
|
|
|
|
the unexecutable edge as interesting. */
|
2008-07-28 16:33:56 +02:00
|
|
|
for (psi = gsi_start_phis (e->dest);
|
|
|
|
!gsi_end_p (psi);
|
|
|
|
gsi_next (&psi))
|
|
|
|
{
|
2014-11-19 18:00:54 +01:00
|
|
|
gphi *phi = psi.phi ();
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
|
|
tree result = gimple_phi_result (phi);
|
2006-03-21 06:07:37 +01:00
|
|
|
int version = SSA_NAME_VERSION (result);
|
|
|
|
|
|
|
|
bitmap_set_bit (interesting_names, version);
|
|
|
|
}
|
|
|
|
|
|
|
|
te->probability += e->probability;
|
|
|
|
|
|
|
|
te->count += e->count;
|
|
|
|
remove_edge (e);
|
2007-05-07 13:42:21 +02:00
|
|
|
cfg_altered = true;
|
2006-03-21 06:07:37 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
ei_next (&ei);
|
|
|
|
}
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
gsi = gsi_last_bb (gimple_bb (use_stmt));
|
|
|
|
gsi_remove (&gsi, true);
|
2006-03-21 06:07:37 +01:00
|
|
|
|
|
|
|
/* And fixup the flags on the single remaining edge. */
|
|
|
|
te->flags &= ~(EDGE_TRUE_VALUE | EDGE_FALSE_VALUE);
|
|
|
|
te->flags &= ~EDGE_ABNORMAL;
|
|
|
|
te->flags |= EDGE_FALLTHRU;
|
|
|
|
if (te->probability > REG_BR_PROB_BASE)
|
|
|
|
te->probability = REG_BR_PROB_BASE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-11-25 11:55:54 +01:00
|
|
|
/* Ensure there is nothing else to do. */
|
2006-04-28 22:39:18 +02:00
|
|
|
gcc_assert (!all || has_zero_uses (lhs));
|
2006-03-24 08:51:32 +01:00
|
|
|
|
2006-03-21 06:07:37 +01:00
|
|
|
/* If we were able to propagate away all uses of LHS, then
|
|
|
|
we can remove STMT. */
|
|
|
|
if (all)
|
|
|
|
remove_stmt_or_phi (stmt);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
/* STMT is either a PHI node (potentially a degenerate PHI node) or
|
2006-03-21 06:07:37 +01:00
|
|
|
a statement that is a trivial copy or constant initialization.
|
|
|
|
|
|
|
|
Attempt to eliminate T by propagating its RHS into all uses of
|
|
|
|
its LHS. This may in turn set new bits in INTERESTING_NAMES
|
|
|
|
for nodes we want to revisit later.
|
|
|
|
|
|
|
|
All exit paths should clear INTERESTING_NAMES for the result
|
2008-07-28 16:33:56 +02:00
|
|
|
of STMT. */
|
2006-03-21 06:07:37 +01:00
|
|
|
|
|
|
|
static void
|
2008-07-28 16:33:56 +02:00
|
|
|
eliminate_const_or_copy (gimple stmt, bitmap interesting_names)
|
2006-03-21 06:07:37 +01:00
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
tree lhs = get_lhs_or_phi_result (stmt);
|
2006-03-21 06:07:37 +01:00
|
|
|
tree rhs;
|
|
|
|
int version = SSA_NAME_VERSION (lhs);
|
|
|
|
|
|
|
|
/* If the LHS of this statement or PHI has no uses, then we can
|
|
|
|
just eliminate it. This can occur if, for example, the PHI
|
|
|
|
was created by block duplication due to threading and its only
|
|
|
|
use was in the conditional at the end of the block which was
|
|
|
|
deleted. */
|
|
|
|
if (has_zero_uses (lhs))
|
|
|
|
{
|
|
|
|
bitmap_clear_bit (interesting_names, version);
|
2008-07-28 16:33:56 +02:00
|
|
|
remove_stmt_or_phi (stmt);
|
2006-03-21 06:07:37 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Get the RHS of the assignment or PHI node if the PHI is a
|
|
|
|
degenerate. */
|
2008-07-28 16:33:56 +02:00
|
|
|
rhs = get_rhs_or_phi_arg (stmt);
|
2006-03-21 06:07:37 +01:00
|
|
|
if (!rhs)
|
|
|
|
{
|
|
|
|
bitmap_clear_bit (interesting_names, version);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-05-28 12:54:33 +02:00
|
|
|
if (!virtual_operand_p (lhs))
|
|
|
|
propagate_rhs_into_lhs (stmt, lhs, rhs, interesting_names);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gimple use_stmt;
|
|
|
|
imm_use_iterator iter;
|
|
|
|
use_operand_p use_p;
|
|
|
|
/* For virtual operands we have to propagate into all uses as
|
|
|
|
otherwise we will create overlapping life-ranges. */
|
|
|
|
FOR_EACH_IMM_USE_STMT (use_stmt, iter, lhs)
|
|
|
|
FOR_EACH_IMM_USE_ON_STMT (use_p, iter)
|
|
|
|
SET_USE (use_p, rhs);
|
|
|
|
if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (lhs))
|
|
|
|
SSA_NAME_OCCURS_IN_ABNORMAL_PHI (rhs) = 1;
|
|
|
|
remove_stmt_or_phi (stmt);
|
|
|
|
}
|
2006-03-21 06:07:37 +01:00
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
/* Note that STMT may well have been deleted by now, so do
|
2006-03-21 06:07:37 +01:00
|
|
|
not access it, instead use the saved version # to clear
|
|
|
|
T's entry in the worklist. */
|
|
|
|
bitmap_clear_bit (interesting_names, version);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* The first phase in degenerate PHI elimination.
|
|
|
|
|
|
|
|
Eliminate the degenerate PHIs in BB, then recurse on the
|
|
|
|
dominator children of BB. */
|
|
|
|
|
|
|
|
static void
|
|
|
|
eliminate_degenerate_phis_1 (basic_block bb, bitmap interesting_names)
|
|
|
|
{
|
2014-11-19 18:00:54 +01:00
|
|
|
gphi_iterator gsi;
|
2006-03-21 06:07:37 +01:00
|
|
|
basic_block son;
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
|
2006-03-21 06:07:37 +01:00
|
|
|
{
|
2014-11-19 18:00:54 +01:00
|
|
|
gphi *phi = gsi.phi ();
|
2008-07-28 16:33:56 +02:00
|
|
|
|
2006-03-21 06:07:37 +01:00
|
|
|
eliminate_const_or_copy (phi, interesting_names);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Recurse into the dominator children of BB. */
|
|
|
|
for (son = first_dom_son (CDI_DOMINATORS, bb);
|
|
|
|
son;
|
|
|
|
son = next_dom_son (CDI_DOMINATORS, son))
|
|
|
|
eliminate_degenerate_phis_1 (son, interesting_names);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* A very simple pass to eliminate degenerate PHI nodes from the
|
|
|
|
IL. This is meant to be fast enough to be able to be run several
|
|
|
|
times in the optimization pipeline.
|
|
|
|
|
|
|
|
Certain optimizations, particularly those which duplicate blocks
|
|
|
|
or remove edges from the CFG can create or expose PHIs which are
|
|
|
|
trivial copies or constant initializations.
|
|
|
|
|
|
|
|
While we could pick up these optimizations in DOM or with the
|
|
|
|
combination of copy-prop and CCP, those solutions are far too
|
|
|
|
heavy-weight for our needs.
|
|
|
|
|
|
|
|
This implementation has two phases so that we can efficiently
|
|
|
|
eliminate the first order degenerate PHIs and second order
|
|
|
|
degenerate PHIs.
|
|
|
|
|
|
|
|
The first phase performs a dominator walk to identify and eliminate
|
|
|
|
the vast majority of the degenerate PHIs. When a degenerate PHI
|
|
|
|
is identified and eliminated any affected statements or PHIs
|
|
|
|
are put on a worklist.
|
|
|
|
|
|
|
|
The second phase eliminates degenerate PHIs and trivial copies
|
|
|
|
or constant initializations using the worklist. This is how we
|
|
|
|
pick up the secondary optimization opportunities with minimal
|
|
|
|
cost. */
|
|
|
|
|
pass cfun to pass::execute
gcc/
* passes.c (opt_pass::execute): Adjust.
(pass_manager::execute_pass_mode_switching): Likewise.
(early_local_passes::execute): Likewise.
(execute_one_pass): Pass cfun to the pass's execute method.
* tree-pass.h (opt_pass::execute): Add function * argument.
* asan.c, auto-inc-dec.c, bb-reorder.c, bt-load.c, cfgcleanup.c,
cfgexpand.c, cfgrtl.c, cgraphbuild.c, combine-stack-adj.c, combine.c,
compare-elim.c, config/arc/arc.c, config/epiphany/mode-switch-use.c,
config/epiphany/resolve-sw-modes.c, config/i386/i386.c,
config/mips/mips.c, config/rl78/rl78.c, config/s390/s390.c,
config/sparc/sparc.c, cprop.c, dce.c, df-core.c, dse.c, dwarf2cfi.c,
except.c, final.c, function.c, fwprop.c, gcse.c, gimple-low.c,
gimple-ssa-isolate-paths.c, gimple-ssa-strength-reduction.c,
graphite.c, ifcvt.c, init-regs.c, ipa-cp.c, ipa-devirt.c,
ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c,
ipa-reference.c, ipa-split.c, ipa.c, ira.c, jump.c, loop-init.c,
lower-subreg.c, mode-switching.c, omp-low.c, postreload-gcse.c,
postreload.c, predict.c, recog.c, ree.c, reg-stack.c, regcprop.c,
reginfo.c, regrename.c, reorg.c, sched-rgn.c, stack-ptr-mod.c,
store-motion.c, tracer.c, trans-mem.c, tree-call-cdce.c, tree-cfg.c,
tree-cfgcleanup.c, tree-complex.c, tree-eh.c, tree-emutls.c,
tree-if-conv.c, tree-into-ssa.c, tree-loop-distribution.c, tree-nrv.c,
tree-object-size.c, tree-parloops.c, tree-predcom.c, tree-ssa-ccp.c,
tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c,
tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c,
tree-ssa-ifcombine.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c,
tree-ssa-loop-ivcanon.c, tree-ssa-loop-prefetch.c,
tree-ssa-loop-unswitch.c, tree-ssa-loop.c, tree-ssa-math-opts.c,
tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-uncprop.c, tree-ssa-uninit.c,
tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c,
tree-tailcall.c, tree-vect-generic.c, tree-vectorizer.c, tree-vrp.c,
tree.c, tsan.c, ubsan.c, var-tracking.c, vtable-verify.c, web.c:
Adjust.
From-SVN: r209482
2014-04-17 14:37:34 +02:00
|
|
|
namespace {
|
|
|
|
|
|
|
|
const pass_data pass_data_phi_only_cprop =
|
|
|
|
{
|
|
|
|
GIMPLE_PASS, /* type */
|
|
|
|
"phicprop", /* name */
|
|
|
|
OPTGROUP_NONE, /* optinfo_flags */
|
|
|
|
TV_TREE_PHI_CPROP, /* tv_id */
|
|
|
|
( PROP_cfg | PROP_ssa ), /* properties_required */
|
|
|
|
0, /* properties_provided */
|
|
|
|
0, /* properties_destroyed */
|
|
|
|
0, /* todo_flags_start */
|
2014-05-06 15:35:40 +02:00
|
|
|
( TODO_cleanup_cfg | TODO_update_ssa ), /* todo_flags_finish */
|
pass cfun to pass::execute
gcc/
* passes.c (opt_pass::execute): Adjust.
(pass_manager::execute_pass_mode_switching): Likewise.
(early_local_passes::execute): Likewise.
(execute_one_pass): Pass cfun to the pass's execute method.
* tree-pass.h (opt_pass::execute): Add function * argument.
* asan.c, auto-inc-dec.c, bb-reorder.c, bt-load.c, cfgcleanup.c,
cfgexpand.c, cfgrtl.c, cgraphbuild.c, combine-stack-adj.c, combine.c,
compare-elim.c, config/arc/arc.c, config/epiphany/mode-switch-use.c,
config/epiphany/resolve-sw-modes.c, config/i386/i386.c,
config/mips/mips.c, config/rl78/rl78.c, config/s390/s390.c,
config/sparc/sparc.c, cprop.c, dce.c, df-core.c, dse.c, dwarf2cfi.c,
except.c, final.c, function.c, fwprop.c, gcse.c, gimple-low.c,
gimple-ssa-isolate-paths.c, gimple-ssa-strength-reduction.c,
graphite.c, ifcvt.c, init-regs.c, ipa-cp.c, ipa-devirt.c,
ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c,
ipa-reference.c, ipa-split.c, ipa.c, ira.c, jump.c, loop-init.c,
lower-subreg.c, mode-switching.c, omp-low.c, postreload-gcse.c,
postreload.c, predict.c, recog.c, ree.c, reg-stack.c, regcprop.c,
reginfo.c, regrename.c, reorg.c, sched-rgn.c, stack-ptr-mod.c,
store-motion.c, tracer.c, trans-mem.c, tree-call-cdce.c, tree-cfg.c,
tree-cfgcleanup.c, tree-complex.c, tree-eh.c, tree-emutls.c,
tree-if-conv.c, tree-into-ssa.c, tree-loop-distribution.c, tree-nrv.c,
tree-object-size.c, tree-parloops.c, tree-predcom.c, tree-ssa-ccp.c,
tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c,
tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c,
tree-ssa-ifcombine.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c,
tree-ssa-loop-ivcanon.c, tree-ssa-loop-prefetch.c,
tree-ssa-loop-unswitch.c, tree-ssa-loop.c, tree-ssa-math-opts.c,
tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-uncprop.c, tree-ssa-uninit.c,
tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c,
tree-tailcall.c, tree-vect-generic.c, tree-vectorizer.c, tree-vrp.c,
tree.c, tsan.c, ubsan.c, var-tracking.c, vtable-verify.c, web.c:
Adjust.
From-SVN: r209482
2014-04-17 14:37:34 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class pass_phi_only_cprop : public gimple_opt_pass
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
pass_phi_only_cprop (gcc::context *ctxt)
|
|
|
|
: gimple_opt_pass (pass_data_phi_only_cprop, ctxt)
|
|
|
|
{}
|
|
|
|
|
|
|
|
/* opt_pass methods: */
|
|
|
|
opt_pass * clone () { return new pass_phi_only_cprop (m_ctxt); }
|
|
|
|
virtual bool gate (function *) { return flag_tree_dom != 0; }
|
|
|
|
virtual unsigned int execute (function *);
|
|
|
|
|
|
|
|
}; // class pass_phi_only_cprop
|
|
|
|
|
|
|
|
unsigned int
|
|
|
|
pass_phi_only_cprop::execute (function *fun)
|
2006-03-21 06:07:37 +01:00
|
|
|
{
|
|
|
|
bitmap interesting_names;
|
2006-12-12 23:45:25 +01:00
|
|
|
bitmap interesting_names1;
|
2006-03-21 06:07:37 +01:00
|
|
|
|
2006-03-28 17:35:47 +02:00
|
|
|
/* Bitmap of blocks which need EH information updated. We can not
|
|
|
|
update it on-the-fly as doing so invalidates the dominator tree. */
|
|
|
|
need_eh_cleanup = BITMAP_ALLOC (NULL);
|
|
|
|
|
2006-03-21 06:07:37 +01:00
|
|
|
/* INTERESTING_NAMES is effectively our worklist, indexed by
|
|
|
|
SSA_NAME_VERSION.
|
|
|
|
|
|
|
|
A set bit indicates that the statement or PHI node which
|
|
|
|
defines the SSA_NAME should be (re)examined to determine if
|
2006-04-22 18:19:56 +02:00
|
|
|
it has become a degenerate PHI or trivial const/copy propagation
|
2009-11-25 11:55:54 +01:00
|
|
|
opportunity.
|
2006-03-21 06:07:37 +01:00
|
|
|
|
|
|
|
Experiments have show we generally get better compilation
|
|
|
|
time behavior with bitmaps rather than sbitmaps. */
|
|
|
|
interesting_names = BITMAP_ALLOC (NULL);
|
2006-12-12 23:45:25 +01:00
|
|
|
interesting_names1 = BITMAP_ALLOC (NULL);
|
2006-03-21 06:07:37 +01:00
|
|
|
|
2007-05-07 13:42:21 +02:00
|
|
|
calculate_dominance_info (CDI_DOMINATORS);
|
|
|
|
cfg_altered = false;
|
|
|
|
|
builtins.c, [...]: Fix comment typos.
* builtins.c, config/arm/arm.c, config/i386/cygwin.h,
config/i386/i386.c, config/ia64/ia64.c, config/s390/fixdfdi.h,
config/sh/sh.c, config/sh/sh.h, df-scan.c, except.c,
haifa-sched.c, optabs.c, rtl.h, sched-deps.c, sched-int.h,
sched-rgn.c, tree-inline.h, tree-ssa-dom.c,
tree-ssa-loop-prefetch.c, tree-ssa-operands.c,
tree-vect-patterns.c, tree-vrp.c: Fix comment typos. Follow
spelling convensions.
* config/ia64/ia64.opt, doc/contrib.texi, doc/invoke.texi,
doc/passes.texi, doc/tm.texi, doc/tree-ssa.texi: Fix comment
typos. Follow spelling conventions.
From-SVN: r112782
2006-04-08 19:01:17 +02:00
|
|
|
/* First phase. Eliminate degenerate PHIs via a dominator
|
2006-03-21 06:07:37 +01:00
|
|
|
walk of the CFG.
|
|
|
|
|
|
|
|
Experiments have indicated that we generally get better
|
|
|
|
compile-time behavior by visiting blocks in the first
|
|
|
|
phase in dominator order. Presumably this is because walking
|
|
|
|
in dominator order leaves fewer PHIs for later examination
|
|
|
|
by the worklist phase. */
|
pass cfun to pass::execute
gcc/
* passes.c (opt_pass::execute): Adjust.
(pass_manager::execute_pass_mode_switching): Likewise.
(early_local_passes::execute): Likewise.
(execute_one_pass): Pass cfun to the pass's execute method.
* tree-pass.h (opt_pass::execute): Add function * argument.
* asan.c, auto-inc-dec.c, bb-reorder.c, bt-load.c, cfgcleanup.c,
cfgexpand.c, cfgrtl.c, cgraphbuild.c, combine-stack-adj.c, combine.c,
compare-elim.c, config/arc/arc.c, config/epiphany/mode-switch-use.c,
config/epiphany/resolve-sw-modes.c, config/i386/i386.c,
config/mips/mips.c, config/rl78/rl78.c, config/s390/s390.c,
config/sparc/sparc.c, cprop.c, dce.c, df-core.c, dse.c, dwarf2cfi.c,
except.c, final.c, function.c, fwprop.c, gcse.c, gimple-low.c,
gimple-ssa-isolate-paths.c, gimple-ssa-strength-reduction.c,
graphite.c, ifcvt.c, init-regs.c, ipa-cp.c, ipa-devirt.c,
ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c,
ipa-reference.c, ipa-split.c, ipa.c, ira.c, jump.c, loop-init.c,
lower-subreg.c, mode-switching.c, omp-low.c, postreload-gcse.c,
postreload.c, predict.c, recog.c, ree.c, reg-stack.c, regcprop.c,
reginfo.c, regrename.c, reorg.c, sched-rgn.c, stack-ptr-mod.c,
store-motion.c, tracer.c, trans-mem.c, tree-call-cdce.c, tree-cfg.c,
tree-cfgcleanup.c, tree-complex.c, tree-eh.c, tree-emutls.c,
tree-if-conv.c, tree-into-ssa.c, tree-loop-distribution.c, tree-nrv.c,
tree-object-size.c, tree-parloops.c, tree-predcom.c, tree-ssa-ccp.c,
tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c,
tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c,
tree-ssa-ifcombine.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c,
tree-ssa-loop-ivcanon.c, tree-ssa-loop-prefetch.c,
tree-ssa-loop-unswitch.c, tree-ssa-loop.c, tree-ssa-math-opts.c,
tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-uncprop.c, tree-ssa-uninit.c,
tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c,
tree-tailcall.c, tree-vect-generic.c, tree-vectorizer.c, tree-vrp.c,
tree.c, tsan.c, ubsan.c, var-tracking.c, vtable-verify.c, web.c:
Adjust.
From-SVN: r209482
2014-04-17 14:37:34 +02:00
|
|
|
eliminate_degenerate_phis_1 (ENTRY_BLOCK_PTR_FOR_FN (fun),
|
Eliminate ENTRY_BLOCK_PTR and EXIT_BLOCK_PTR macros
gcc/
* basic-block.h (ENTRY_BLOCK_PTR_FOR_FUNCTION): Rename macro to...
(EXIT_BLOCK_PTR_FOR_FUNCTION): ...this.
(ENTRY_BLOCK_PTR_FOR_FN): Renamed macro to...
(EXIT_BLOCK_PTR_FOR_FN): ...this.
(ENTRY_BLOCK_PTR): Eliminate macro as work towards making uses of
cfun be explicit.
(EXIT_BLOCK_PTR): Likewise.
(FOR_ALL_BB): Rework for now to eliminate use of "ENTRY_BLOCK_PTR".
(FOR_ALL_BB_FN): Update for renaming of
"ENTRY_BLOCK_PTR_FOR_FUNCTION" to "ENTRY_BLOCK_PTR_FOR_FN".
* cfg.c (init_flow): Likewise.
(check_bb_profile): Likewise.
* cfganal.c (pre_and_rev_post_order_compute_fn): Likewise.
* cfgcleanup.c (walk_to_nondebug_insn): Likewise.
* cfghooks.c (account_profile_record): Likewise.
* cfgloop.c (init_loops_structure): Likewise.
* cgraphbuild.c (record_eh_tables): Likewise.
(compute_call_stmt_bb_frequency): Likewise.
* ipa-inline-analysis.c (compute_bb_predicates): Likewise.
* lto-streamer-in.c (input_cfg): Likewise.
* predict.c (maybe_hot_frequency_p): Likewise.
* tree-cfg.c (init_empty_tree_cfg_for_function): Likewise.
* tree-inline.c (initialize_cfun): Likewise.
(copy_cfg_body): Likewise.
(copy_body): Likewise.
(tree_function_versioning): Likewise.
* bb-reorder.c (add_labels_and_missing_jumps): Remove uses of macros:
ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR.
(duplicate_computed_gotos): Remove usage of EXIT_BLOCK_PTR macro.
(find_rarely_executed_basic_blocks_and_crossing_edges): Remove uses of
macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR.
(connect_traces): Likewise.
(rest_of_handle_reorder_blocks): Remove usage of EXIT_BLOCK_PTR macro.
(bb_to_key): Remove usage of ENTRY_BLOCK_PTR macro.
(fix_crossing_conditional_branches): Remove usage of EXIT_BLOCK_PTR
macro.
(find_traces_1_round): Remove uses of macros: ENTRY_BLOCK_PTR,
EXIT_BLOCK_PTR.
(fix_up_fall_thru_edges): Remove usage of EXIT_BLOCK_PTR macro.
(find_traces): Remove usage of ENTRY_BLOCK_PTR macro.
(fix_up_crossing_landing_pad): Remove usage of EXIT_BLOCK_PTR macro.
(rotate_loop): Likewise.
* bt-load.c (migrate_btr_def): Remove usage of ENTRY_BLOCK_PTR macro.
* cfg.c (clear_aux_for_edges): Remove uses of macros: ENTRY_BLOCK_PTR,
EXIT_BLOCK_PTR.
(alloc_aux_for_edges): Likewise.
(clear_bb_flags): Remove usage of ENTRY_BLOCK_PTR macro.
(cached_make_edge): Remove uses of macros: ENTRY_BLOCK_PTR,
EXIT_BLOCK_PTR.
(compact_blocks): Likewise.
(clear_edges): Likewise.
* cfganal.c (single_pred_before_succ_order): Remove usage of
ENTRY_BLOCK_PTR macro.
(bitmap_union_of_succs): Remove usage of EXIT_BLOCK_PTR macro.
(bitmap_union_of_preds): Remove usage of ENTRY_BLOCK_PTR macro.
(bitmap_intersection_of_succs): Remove usage of EXIT_BLOCK_PTR macro.
(bitmap_intersection_of_preds): Remove usage of ENTRY_BLOCK_PTR macro.
(inverted_post_order_compute): Remove uses of macros: ENTRY_BLOCK_PTR,
EXIT_BLOCK_PTR.
(compute_dominance_frontiers_1): Remove usage of ENTRY_BLOCK_PTR
macro.
(post_order_compute): Remove uses of macros: ENTRY_BLOCK_PTR,
EXIT_BLOCK_PTR.
(connect_infinite_loops_to_exit): Remove usage of EXIT_BLOCK_PTR
macro.
(remove_fake_edges): Remove usage of ENTRY_BLOCK_PTR macro.
(add_noreturn_fake_exit_edges): Remove usage of EXIT_BLOCK_PTR macro.
(find_pdom): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR.
(remove_fake_exit_edges): Remove usage of EXIT_BLOCK_PTR macro.
(verify_edge_list): Remove uses of macros: ENTRY_BLOCK_PTR,
EXIT_BLOCK_PTR.
(print_edge_list): Likewise.
(create_edge_list): Likewise.
(find_unreachable_blocks): Remove usage of ENTRY_BLOCK_PTR macro.
(mark_dfs_back_edges): Remove uses of macros: ENTRY_BLOCK_PTR,
EXIT_BLOCK_PTR.
* cfgbuild.c (find_bb_boundaries): Remove usage of ENTRY_BLOCK_PTR
macro.
(find_many_sub_basic_blocks): Remove usage of EXIT_BLOCK_PTR macro.
(make_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR.
* cfgcleanup.c (delete_unreachable_blocks): Likewise.
(try_optimize_cfg): Likewise.
(try_head_merge_bb): Remove usage of EXIT_BLOCK_PTR macro.
(try_crossjump_to_edge): Remove usage of ENTRY_BLOCK_PTR macro.
(try_crossjump_bb): Remove usage of EXIT_BLOCK_PTR macro.
(merge_blocks_move): Remove usage of ENTRY_BLOCK_PTR macro.
(outgoing_edges_match): Remove usage of EXIT_BLOCK_PTR macro.
(try_forward_edges): Likewise.
(try_simplify_condjump): Likewise.
* cfgexpand.c (gimple_expand_cfg): Remove uses of macros:
ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR.
(construct_exit_block): Remove usage of EXIT_BLOCK_PTR macro.
(construct_init_block): Remove uses of macros: ENTRY_BLOCK_PTR,
EXIT_BLOCK_PTR.
(expand_gimple_basic_block): Remove usage of EXIT_BLOCK_PTR macro.
(expand_gimple_tailcall): Likewise.
* cfghooks.c (can_duplicate_block_p): Remove uses of macros:
ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR.
(tidy_fallthru_edges): Likewise.
(verify_flow_info): Likewise.
* cfgloop.c (flow_bb_inside_loop_p): Likewise.
(num_loop_branches): Remove usage of EXIT_BLOCK_PTR macro.
(disambiguate_multiple_latches): Remove usage of ENTRY_BLOCK_PTR
macro.
(get_loop_exit_edges): Remove usage of EXIT_BLOCK_PTR macro.
(bb_loop_header_p): Remove usage of ENTRY_BLOCK_PTR macro.
(get_loop_body_in_bfs_order): Remove usage of EXIT_BLOCK_PTR macro.
(get_loop_body_in_dom_order): Likewise.
(get_loop_body): Likewise.
* cfgloopanal.c (mark_irreducible_loops): Remove uses of macros:
ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR.
* cfgloopmanip.c (create_preheader): Remove usage of ENTRY_BLOCK_PTR
macro.
(remove_path): Remove usage of EXIT_BLOCK_PTR macro.
(fix_bb_placement): Likewise.
* cfgrtl.c (rtl_block_empty_p): Remove uses of macros:
ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR.
(rtl_can_remove_branch_p): Remove usage of EXIT_BLOCK_PTR macro.
(cfg_layout_split_edge): Remove uses of macros: ENTRY_BLOCK_PTR,
EXIT_BLOCK_PTR.
(rtl_flow_call_edges_add): Remove usage of EXIT_BLOCK_PTR macro.
(cfg_layout_can_merge_blocks_p): Remove uses of macros:
ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR.
(cfg_layout_redirect_edge_and_branch): Remove usage of ENTRY_BLOCK_PTR
macro.
(fixup_fallthru_exit_predecessor): Remove uses of macros:
ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR.
(fixup_reorder_chain): Likewise.
(relink_block_chain): Likewise.
(cfg_layout_delete_block): Remove usage of EXIT_BLOCK_PTR macro.
(rtl_verify_bb_layout): Remove usage of ENTRY_BLOCK_PTR macro.
(cfg_layout_duplicate_bb): Remove usage of EXIT_BLOCK_PTR macro.
(force_one_exit_fallthru): Likewise.
(rtl_verify_fallthru): Remove uses of macros: ENTRY_BLOCK_PTR,
EXIT_BLOCK_PTR.
(rtl_verify_edges): Likewise.
(commit_edge_insertions): Likewise.
(commit_one_edge_insertion): Likewise.
(rtl_split_edge): Likewise.
(force_nonfallthru_and_redirect): Likewise.
(outof_cfg_layout_mode): Remove usage of EXIT_BLOCK_PTR macro.
(skip_insns_after_block): Likewise.
(fixup_partition_crossing): Remove uses of macros: ENTRY_BLOCK_PTR,
EXIT_BLOCK_PTR.
(purge_dead_edges): Remove usage of EXIT_BLOCK_PTR macro.
(rtl_can_merge_blocks): Remove uses of macros: ENTRY_BLOCK_PTR,
EXIT_BLOCK_PTR.
(contains_no_active_insn_p): Likewise.
(emit_insn_at_entry): Remove usage of ENTRY_BLOCK_PTR macro.
(entry_of_function): Likewise.
(last_bb_in_partition): Remove usage of EXIT_BLOCK_PTR macro.
(fixup_new_cold_bb): Likewise.
(patch_jump_insn): Likewise.
(try_redirect_by_replacing_jump): Likewise.
(block_label): Likewise.
(could_fall_through): Likewise.
(can_fallthru): Likewise.
* cgraphbuild.c (cgraph_rebuild_references): Remove usage of
ENTRY_BLOCK_PTR macro.
(rebuild_cgraph_edges): Likewise.
* cgraphunit.c (init_lowered_empty_function): Remove uses of macros:
ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR.
(expand_thunk): Remove usage of EXIT_BLOCK_PTR macro.
* combine.c (get_last_value): Remove usage of ENTRY_BLOCK_PTR macro.
(distribute_links): Remove usage of EXIT_BLOCK_PTR macro.
(get_last_value_validate): Remove usage of ENTRY_BLOCK_PTR macro.
(try_combine): Remove usage of EXIT_BLOCK_PTR macro.
(reg_num_sign_bit_copies_for_combine): Remove usage of ENTRY_BLOCK_PTR
macro.
(reg_nonzero_bits_for_combine): Likewise.
(set_nonzero_bits_and_sign_copies): Likewise.
(combine_instructions): Likewise.
* cprop.c (one_cprop_pass): Remove uses of macros: ENTRY_BLOCK_PTR,
EXIT_BLOCK_PTR.
(bypass_conditional_jumps): Likewise.
(bypass_block): Remove usage of EXIT_BLOCK_PTR macro.
(find_implicit_sets): Likewise.
(cprop_jump): Likewise.
* cse.c (cse_cc_succs): Likewise.
(cse_find_path): Likewise.
* df-problems.c (df_lr_confluence_0): Likewise.
* df-scan.c (df_entry_block_defs_collect): Remove usage of
ENTRY_BLOCK_PTR macro.
(df_exit_block_uses_collect): Remove usage of EXIT_BLOCK_PTR macro.
* dominance.c (iterate_fix_dominators): Remove usage of
ENTRY_BLOCK_PTR macro.
(calc_idoms): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR.
(determine_dominators_for_sons): Remove usage of ENTRY_BLOCK_PTR
macro.
(calc_dfs_tree): Remove uses of macros: ENTRY_BLOCK_PTR,
EXIT_BLOCK_PTR.
(prune_bbs_to_update_dominators): Remove usage of ENTRY_BLOCK_PTR
macro.
(calc_dfs_tree_nonrec): Remove uses of macros: ENTRY_BLOCK_PTR,
EXIT_BLOCK_PTR.
* domwalk.c (cmp_bb_postorder): Likewise.
* dse.c (dse_step1): Remove usage of EXIT_BLOCK_PTR macro.
* except.c (finish_eh_generation): Remove usage of ENTRY_BLOCK_PTR
macro.
(sjlj_emit_function_enter): Likewise.
* final.c (compute_alignments): Likewise.
* function.c (thread_prologue_and_epilogue_insns): Remove uses of
macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR.
(reposition_prologue_and_epilogue_notes): Remove usage of
EXIT_BLOCK_PTR macro.
(convert_jumps_to_returns): Remove uses of macros: ENTRY_BLOCK_PTR,
EXIT_BLOCK_PTR.
(regno_clobbered_at_setjmp): Remove usage of ENTRY_BLOCK_PTR macro.
(next_block_for_reg): Remove usage of EXIT_BLOCK_PTR macro.
* gcse.c (hoist_code): Remove usage of ENTRY_BLOCK_PTR macro.
(update_bb_reg_pressure): Remove usage of EXIT_BLOCK_PTR macro.
(compute_code_hoist_vbeinout): Likewise.
(should_hoist_expr_to_dom): Remove usage of ENTRY_BLOCK_PTR macro.
(pre_expr_reaches_here_p_work): Likewise.
* gimple-iterator.c (gsi_commit_edge_inserts): Likewise.
(gimple_find_edge_insert_loc): Remove uses of macros: ENTRY_BLOCK_PTR,
EXIT_BLOCK_PTR.
* gimple-ssa-strength-reduction.c (slsr_process_phi): Remove usage of
ENTRY_BLOCK_PTR macro.
* graph.c (draw_cfg_nodes_for_loop): Remove usage of EXIT_BLOCK_PTR
macro.
* graphite-clast-to-gimple.c (translate_clast_user): Remove usage of
ENTRY_BLOCK_PTR macro.
* graphite-scop-detection.c (build_scops): Likewise.
(create_sese_edges): Remove usage of EXIT_BLOCK_PTR macro.
(scopdet_basic_block_info): Remove usage of ENTRY_BLOCK_PTR macro.
* haifa-sched.c (restore_bb_notes): Remove usage of EXIT_BLOCK_PTR
macro.
(unlink_bb_notes): Likewise.
(create_check_block_twin): Likewise.
(init_before_recovery): Likewise.
(sched_extend_bb): Likewise.
(priority): Likewise.
* hw-doloop.c (reorder_loops): Likewise.
(discover_loop): Likewise.
* ifcvt.c (dead_or_predicable): Remove uses of macros:
ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR.
(find_if_case_1): Remove usage of EXIT_BLOCK_PTR macro.
(block_has_only_trap): Likewise.
(cond_exec_find_if_block): Likewise.
(merge_if_block): Likewise.
* ipa-inline-analysis.c (param_change_prob): Remove usage of
ENTRY_BLOCK_PTR macro.
(record_modified): Likewise.
* ipa-pure-const.c (execute_warn_function_noreturn): Remove usage of
EXIT_BLOCK_PTR macro.
(local_pure_const): Likewise.
* ipa-split.c (split_function): Remove uses of macros:
ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR.
(find_split_points): Likewise.
(consider_split): Likewise.
(find_return_bb): Remove usage of EXIT_BLOCK_PTR macro.
(verify_non_ssa_vars): Remove usage of ENTRY_BLOCK_PTR macro.
* ira-build.c (ira_loop_tree_body_rev_postorder): Likewise.
* ira-color.c (print_loop_title): Remove usage of EXIT_BLOCK_PTR
macro.
* ira-emit.c (entered_from_non_parent_p): Remove usage of
ENTRY_BLOCK_PTR macro.
(ira_emit): Remove usage of EXIT_BLOCK_PTR macro.
* ira-int.h (ira_assert): Remove usage of ENTRY_BLOCK_PTR macro.
* ira.c (split_live_ranges_for_shrink_wrap): Remove uses of macros:
ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR.
* lcm.c (compute_rev_insert_delete): Remove usage of ENTRY_BLOCK_PTR
macro.
(compute_nearerout): Remove uses of macros: ENTRY_BLOCK_PTR,
EXIT_BLOCK_PTR.
(compute_farthest): Likewise.
(compute_available): Likewise.
(compute_insert_delete): Remove usage of EXIT_BLOCK_PTR macro.
(compute_laterin): Remove uses of macros: ENTRY_BLOCK_PTR,
EXIT_BLOCK_PTR.
(compute_earliest): Likewise.
(compute_antinout_edge): Likewise.
* loop-iv.c (simplify_using_initial_values): Remove usage of
ENTRY_BLOCK_PTR macro.
* loop-unswitch.c (unswitch_loop): Remove usage of EXIT_BLOCK_PTR
macro.
* lra-assigns.c (find_hard_regno_for): Remove usage of ENTRY_BLOCK_PTR
macro.
* lra-constraints.c (lra_inheritance): Remove usage of EXIT_BLOCK_PTR
macro.
* lra-lives.c (lra_create_live_ranges): Remove uses of macros:
ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR.
* lra.c (has_nonexceptional_receiver): Remove usage of EXIT_BLOCK_PTR
macro.
* lto-streamer-in.c (input_function): Remove usage of ENTRY_BLOCK_PTR
macro.
* lto-streamer-out.c (output_cfg): Likewise.
* mcf.c (adjust_cfg_counts): Remove uses of macros: ENTRY_BLOCK_PTR,
EXIT_BLOCK_PTR.
(create_fixup_graph): Remove usage of ENTRY_BLOCK_PTR macro.
* mode-switching.c (optimize_mode_switching): Likewise.
(create_pre_exit): Remove usage of EXIT_BLOCK_PTR macro.
* modulo-sched.c (rest_of_handle_sms): Likewise.
(canon_loop): Likewise.
* omp-low.c (build_omp_regions): Remove usage of ENTRY_BLOCK_PTR
macro.
* postreload-gcse.c (eliminate_partially_redundant_loads): Remove uses
of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR.
* predict.c (rebuild_frequencies): Remove usage of ENTRY_BLOCK_PTR
macro.
(propagate_freq): Remove usage of EXIT_BLOCK_PTR macro.
(estimate_bb_frequencies): Remove usage of ENTRY_BLOCK_PTR macro.
(tree_estimate_probability_bb): Remove usage of EXIT_BLOCK_PTR macro.
(expensive_function_p): Remove usage of ENTRY_BLOCK_PTR macro.
(tree_bb_level_predictions): Remove usage of EXIT_BLOCK_PTR macro.
(counts_to_freqs): Remove usage of ENTRY_BLOCK_PTR macro.
(apply_return_prediction): Remove usage of EXIT_BLOCK_PTR macro.
(estimate_loops): Remove usage of ENTRY_BLOCK_PTR macro.
(gimple_predict_edge): Likewise.
(probably_never_executed): Likewise.
* profile.c (find_spanning_tree): Remove uses of macros:
ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR.
(branch_prob): Likewise.
(compute_branch_probabilities): Likewise.
(compute_frequency_overlap): Remove usage of ENTRY_BLOCK_PTR macro.
(is_inconsistent): Remove usage of EXIT_BLOCK_PTR macro.
(read_profile_edge_counts): Remove usage of ENTRY_BLOCK_PTR macro.
(set_bb_counts): Likewise.
(correct_negative_edge_counts): Likewise.
(get_exec_counts): Likewise.
(instrument_values): Likewise.
(instrument_edges): Likewise.
* reg-stack.c (convert_regs): Remove uses of macros: ENTRY_BLOCK_PTR,
EXIT_BLOCK_PTR.
(compensate_edges): Remove usage of ENTRY_BLOCK_PTR macro.
(convert_regs_exit): Remove usage of EXIT_BLOCK_PTR macro.
(convert_regs_entry): Remove usage of ENTRY_BLOCK_PTR macro.
(reg_to_stack): Likewise.
* regs.h (REG_N_SETS): Likewise.
* reload.c (find_dummy_reload): Likewise.
(combine_reloads): Likewise.
(push_reload): Likewise.
* reload1.c (has_nonexceptional_receiver): Remove usage of
EXIT_BLOCK_PTR macro.
* resource.c (mark_target_live_regs): Remove usage of ENTRY_BLOCK_PTR
macro.
(find_basic_block): Likewise.
* sched-ebb.c (ebb_add_block): Remove usage of EXIT_BLOCK_PTR macro.
(schedule_ebbs): Likewise.
* sched-int.h (sel_sched_p): Likewise.
* sched-rgn.c (compute_dom_prob_ps): Remove usage of ENTRY_BLOCK_PTR
macro.
(rgn_add_block): Remove usage of EXIT_BLOCK_PTR macro.
(haifa_find_rgns): Remove uses of macros: ENTRY_BLOCK_PTR,
EXIT_BLOCK_PTR.
(propagate_deps): Remove usage of EXIT_BLOCK_PTR macro.
(extend_rgns): Likewise.
(find_single_block_region): Likewise.
* sel-sched-ir.c (sel_remove_loop_preheader): Remove usage of
ENTRY_BLOCK_PTR macro.
(setup_nop_and_exit_insns): Remove usage of EXIT_BLOCK_PTR macro.
(sel_create_recovery_block): Likewise.
(bb_ends_ebb_p): Likewise.
(sel_bb_end): Likewise.
(sel_bb_head): Likewise.
(free_lv_sets): Likewise.
(init_lv_sets): Likewise.
(tidy_control_flow): Likewise.
(maybe_tidy_empty_bb): Likewise.
* sel-sched-ir.h (_succ_iter_cond): Likewise.
(_succ_iter_start): Likewise.
(sel_bb_empty_or_nop_p): Likewise.
(get_loop_exit_edges_unique_dests): Likewise.
(inner_loop_header_p): Likewise.
* sel-sched.c (create_block_for_bookkeeping): Likewise.
(find_block_for_bookkeeping): Likewise.
* store-motion.c (remove_reachable_equiv_notes): Likewise.
(insert_store): Likewise.
* trans-mem.c (ipa_tm_transform_clone): Remove usage of
ENTRY_BLOCK_PTR macro.
(tm_memopt_compute_available): Remove usage of EXIT_BLOCK_PTR macro.
(ipa_tm_scan_irr_function): Remove usage of ENTRY_BLOCK_PTR macro.
(gate_tm_init): Likewise.
(tm_region_init): Likewise.
* tree-cfg.c (execute_fixup_cfg): Remove uses of macros:
ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR.
(execute_warn_function_return): Remove usage of EXIT_BLOCK_PTR macro.
(split_critical_edges): Remove uses of macros: ENTRY_BLOCK_PTR,
EXIT_BLOCK_PTR.
(print_loops): Remove usage of ENTRY_BLOCK_PTR macro.
(move_sese_region_to_fn): Remove uses of macros: ENTRY_BLOCK_PTR,
EXIT_BLOCK_PTR.
(gimple_redirect_edge_and_branch): Remove usage of ENTRY_BLOCK_PTR
macro.
(gimple_verify_flow_info): Remove uses of macros: ENTRY_BLOCK_PTR,
EXIT_BLOCK_PTR.
(remove_edge_and_dominated_blocks): Remove usage of EXIT_BLOCK_PTR
macro.
(make_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR.
(gimple_flow_call_edges_add): Remove usage of EXIT_BLOCK_PTR macro.
(make_blocks): Remove usage of ENTRY_BLOCK_PTR macro.
(build_gimple_cfg): Likewise.
(gimple_duplicate_bb): Remove usage of EXIT_BLOCK_PTR macro.
(gimple_can_merge_blocks_p): Likewise.
* tree-cfgcleanup.c (tree_forwarder_block_p): Remove uses of macros:
ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR.
* tree-complex.c (update_parameter_components): Remove usage of
ENTRY_BLOCK_PTR macro.
* tree-if-conv.c (get_loop_body_in_if_conv_order): Remove usage of
EXIT_BLOCK_PTR macro.
* tree-inline.c (tree_function_versioning): Remove uses of macros:
ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR.
(delete_unreachable_blocks_update_callgraph): Likewise.
(initialize_cfun): Likewise.
(copy_cfg_body): Remove usage of ENTRY_BLOCK_PTR macro.
(copy_edges_for_bb): Remove usage of EXIT_BLOCK_PTR macro.
(remap_ssa_name): Remove usage of ENTRY_BLOCK_PTR macro.
* tree-into-ssa.c (update_ssa): Likewise.
(maybe_register_def): Remove usage of EXIT_BLOCK_PTR macro.
(insert_updated_phi_nodes_for): Remove usage of ENTRY_BLOCK_PTR macro.
(rewrite_into_ssa): Likewise.
(rewrite_debug_stmt_uses): Likewise.
* tree-outof-ssa.c (expand_phi_nodes): Remove uses of macros:
ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR.
* tree-profile.c (gimple_gen_ic_func_profiler): Remove usage of
ENTRY_BLOCK_PTR macro.
* tree-scalar-evolution.h (block_before_loop): Likewise.
* tree-sra.c (sra_ipa_reset_debug_stmts): Likewise.
(dump_dereferences_table): Remove uses of macros: ENTRY_BLOCK_PTR,
EXIT_BLOCK_PTR.
(analyze_caller_dereference_legality): Remove usage of ENTRY_BLOCK_PTR
macro.
(propagate_dereference_distances): Remove uses of macros:
ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR.
(initialize_parameter_reductions): Remove usage of ENTRY_BLOCK_PTR
macro.
* tree-ssa-ccp.c (gsi_prev_dom_bb_nondebug): Likewise.
(optimize_stack_restore): Remove usage of EXIT_BLOCK_PTR macro.
* tree-ssa-coalesce.c (create_outofssa_var_map): Likewise.
* tree-ssa-dce.c (eliminate_unnecessary_stmts): Remove uses of macros:
ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR.
(remove_dead_stmt): Remove usage of EXIT_BLOCK_PTR macro.
(propagate_necessity): Remove usage of ENTRY_BLOCK_PTR macro.
(mark_control_dependent_edges_necessary): Remove uses of macros:
ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR.
* tree-ssa-dom.c (eliminate_degenerate_phis): Remove usage of
ENTRY_BLOCK_PTR macro.
(tree_ssa_dominator_optimize): Remove usage of EXIT_BLOCK_PTR macro.
* tree-ssa-live.c (verify_live_on_entry): Remove uses of macros:
ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR.
(calculate_live_on_exit): Likewise.
(set_var_live_on_entry): Remove usage of ENTRY_BLOCK_PTR macro.
(loe_visit_block): Likewise.
* tree-ssa-live.h (live_on_exit): Remove uses of macros:
ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR.
(live_on_entry): Likewise.
* tree-ssa-loop-ivopts.c (find_interesting_uses): Remove usage of
EXIT_BLOCK_PTR macro.
* tree-ssa-loop-manip.c (compute_live_loop_exits): Remove usage of
ENTRY_BLOCK_PTR macro.
* tree-ssa-loop-niter.c (simplify_using_initial_conditions): Likewise.
(bound_difference): Likewise.
* tree-ssa-loop-prefetch.c (may_use_storent_in_loop_p): Remove usage
of EXIT_BLOCK_PTR macro.
* tree-ssa-loop-unswitch.c (simplify_using_entry_checks): Remove usage
of ENTRY_BLOCK_PTR macro.
* tree-ssa-math-opts.c (register_division_in): Likewise.
* tree-ssa-phiprop.c (tree_ssa_phiprop): Likewise.
* tree-ssa-pre.c (compute_avail): Likewise.
(compute_antic): Remove usage of EXIT_BLOCK_PTR macro.
(insert): Remove usage of ENTRY_BLOCK_PTR macro.
* tree-ssa-propagate.c (ssa_prop_init): Likewise.
(simulate_block): Remove usage of EXIT_BLOCK_PTR macro.
(cfg_blocks_add): Remove uses of macros: ENTRY_BLOCK_PTR,
EXIT_BLOCK_PTR.
(add_control_edge): Remove usage of EXIT_BLOCK_PTR macro.
* tree-ssa-reassoc.c (do_reassoc): Remove uses of macros:
ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR.
(build_and_add_sum): Remove usage of ENTRY_BLOCK_PTR macro.
* tree-ssa-sink.c (nearest_common_dominator_of_uses): Likewise.
(execute_sink_code): Remove usage of EXIT_BLOCK_PTR macro.
* tree-ssa-uninit.c (find_dom): Remove usage of ENTRY_BLOCK_PTR macro.
(compute_control_dep_chain): Remove usage of EXIT_BLOCK_PTR macro.
(find_pdom): Likewise.
(warn_uninitialized_vars): Remove usage of ENTRY_BLOCK_PTR macro.
* tree-stdarg.c (reachable_at_most_once): Likewise.
* tree-tailcall.c (tree_optimize_tail_calls_1): Remove uses of macros:
ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR.
(eliminate_tail_call): Likewise.
* tsan.c (instrument_func_entry): Remove usage of ENTRY_BLOCK_PTR
macro.
(instrument_func_exit): Remove usage of EXIT_BLOCK_PTR macro.
* var-tracking.c (vt_initialize): Remove uses of macros:
ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR.
(vt_add_function_parameter): Remove usage of ENTRY_BLOCK_PTR macro.
(vt_find_locations): Remove usage of EXIT_BLOCK_PTR macro.
(vt_stack_adjustments): Remove uses of macros: ENTRY_BLOCK_PTR,
EXIT_BLOCK_PTR.
* varasm.c (assemble_start_function): Remove usage of ENTRY_BLOCK_PTR
macro.
* config/bfin/bfin.c (hwloop_optimize): Likewise.
* config/nds32/nds32.c (nds32_fp_as_gp_check_available): Remove usage
of EXIT_BLOCK_PTR macro.
* config/arm/arm.c (require_pic_register): Remove usage of
ENTRY_BLOCK_PTR macro.
(arm_r3_live_at_start_p): Likewise.
(any_sibcall_could_use_r3): Remove usage of EXIT_BLOCK_PTR macro.
* config/rs6000/rs6000.c (rs6000_emit_prologue): Likewise.
* config/frv/frv.c (frv_optimize_membar_global): Likewise.
* config/alpha/alpha.c (alpha_gp_save_rtx): Remove usage of
ENTRY_BLOCK_PTR macro.
* config/i386/i386.c (ix86_count_insn): Likewise.
(ix86_seh_fixup_eh_fallthru): Remove usage of EXIT_BLOCK_PTR macro.
(ix86_pad_short_function): Likewise.
(ix86_compute_frame_layout): Remove usage of ENTRY_BLOCK_PTR macro.
(ix86_pad_returns): Remove usage of EXIT_BLOCK_PTR macro.
(ix86_eax_live_at_start_p): Remove usage of ENTRY_BLOCK_PTR macro.
(add_condition_to_bb): Remove usage of EXIT_BLOCK_PTR macro.
(ix86_expand_epilogue): Likewise.
* config/ia64/ia64.c (ia64_asm_unwind_emit): Likewise.
(ia64_expand_prologue): Likewise.
From-SVN: r205055
2013-11-19 22:57:13 +01:00
|
|
|
interesting_names);
|
2006-03-21 06:07:37 +01:00
|
|
|
|
builtins.c, [...]: Fix comment typos.
* builtins.c, config/arm/arm.c, config/i386/cygwin.h,
config/i386/i386.c, config/ia64/ia64.c, config/s390/fixdfdi.h,
config/sh/sh.c, config/sh/sh.h, df-scan.c, except.c,
haifa-sched.c, optabs.c, rtl.h, sched-deps.c, sched-int.h,
sched-rgn.c, tree-inline.h, tree-ssa-dom.c,
tree-ssa-loop-prefetch.c, tree-ssa-operands.c,
tree-vect-patterns.c, tree-vrp.c: Fix comment typos. Follow
spelling convensions.
* config/ia64/ia64.opt, doc/contrib.texi, doc/invoke.texi,
doc/passes.texi, doc/tm.texi, doc/tree-ssa.texi: Fix comment
typos. Follow spelling conventions.
From-SVN: r112782
2006-04-08 19:01:17 +02:00
|
|
|
/* Second phase. Eliminate second order degenerate PHIs as well
|
2006-03-21 06:07:37 +01:00
|
|
|
as trivial copies or constant initializations identified by
|
|
|
|
the first phase or this phase. Basically we keep iterating
|
|
|
|
until our set of INTERESTING_NAMEs is empty. */
|
|
|
|
while (!bitmap_empty_p (interesting_names))
|
|
|
|
{
|
|
|
|
unsigned int i;
|
|
|
|
bitmap_iterator bi;
|
|
|
|
|
2006-12-12 23:45:25 +01:00
|
|
|
/* EXECUTE_IF_SET_IN_BITMAP does not like its bitmap
|
|
|
|
changed during the loop. Copy it to another bitmap and
|
|
|
|
use that. */
|
|
|
|
bitmap_copy (interesting_names1, interesting_names);
|
|
|
|
|
|
|
|
EXECUTE_IF_SET_IN_BITMAP (interesting_names1, 0, i, bi)
|
2006-03-21 06:07:37 +01:00
|
|
|
{
|
|
|
|
tree name = ssa_name (i);
|
|
|
|
|
|
|
|
/* Ignore SSA_NAMEs that have been released because
|
|
|
|
their defining statement was deleted (unreachable). */
|
|
|
|
if (name)
|
|
|
|
eliminate_const_or_copy (SSA_NAME_DEF_STMT (ssa_name (i)),
|
|
|
|
interesting_names);
|
|
|
|
}
|
|
|
|
}
|
2006-03-28 17:35:47 +02:00
|
|
|
|
2007-05-07 13:42:21 +02:00
|
|
|
if (cfg_altered)
|
2013-01-29 11:40:24 +01:00
|
|
|
{
|
|
|
|
free_dominance_info (CDI_DOMINATORS);
|
|
|
|
/* If we changed the CFG schedule loops for fixup by cfgcleanup. */
|
2014-06-06 09:38:07 +02:00
|
|
|
loops_state_set (LOOPS_NEED_FIXUP);
|
2013-01-29 11:40:24 +01:00
|
|
|
}
|
2007-05-07 13:42:21 +02:00
|
|
|
|
2006-03-28 17:35:47 +02:00
|
|
|
/* Propagation of const and copies may make some EH edges dead. Purge
|
|
|
|
such edges from the CFG as needed. */
|
|
|
|
if (!bitmap_empty_p (need_eh_cleanup))
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
gimple_purge_all_dead_eh_edges (need_eh_cleanup);
|
2006-03-28 17:35:47 +02:00
|
|
|
BITMAP_FREE (need_eh_cleanup);
|
|
|
|
}
|
2006-03-21 06:07:37 +01:00
|
|
|
|
|
|
|
BITMAP_FREE (interesting_names);
|
2006-12-12 23:45:25 +01:00
|
|
|
BITMAP_FREE (interesting_names1);
|
2006-03-21 06:07:37 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2013-08-05 22:16:05 +02:00
|
|
|
} // anon namespace
|
|
|
|
|
|
|
|
gimple_opt_pass *
|
|
|
|
make_pass_phi_only_cprop (gcc::context *ctxt)
|
|
|
|
{
|
|
|
|
return new pass_phi_only_cprop (ctxt);
|
|
|
|
}
|