aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-manip.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2022-01-14 16:56:44 +0100
committerMartin Liska <mliska@suse.cz>2022-01-17 22:12:04 +0100
commit5c69acb32329d49e58c26fa41ae74229a52b9106 (patch)
treeddb05f9d73afb6f998457d2ac4b720e3b3b60483 /gcc/tree-ssa-loop-manip.c
parent490e23032baaece71f2ec09fa1805064b150fbc2 (diff)
downloadgcc-5c69acb32329d49e58c26fa41ae74229a52b9106.zip
gcc-5c69acb32329d49e58c26fa41ae74229a52b9106.tar.gz
gcc-5c69acb32329d49e58c26fa41ae74229a52b9106.tar.bz2
Rename .c files to .cc files.
gcc/ada/ChangeLog: * adadecode.c: Moved to... * adadecode.cc: ...here. * affinity.c: Moved to... * affinity.cc: ...here. * argv-lynxos178-raven-cert.c: Moved to... * argv-lynxos178-raven-cert.cc: ...here. * argv.c: Moved to... * argv.cc: ...here. * aux-io.c: Moved to... * aux-io.cc: ...here. * cio.c: Moved to... * cio.cc: ...here. * cstreams.c: Moved to... * cstreams.cc: ...here. * env.c: Moved to... * env.cc: ...here. * exit.c: Moved to... * exit.cc: ...here. * expect.c: Moved to... * expect.cc: ...here. * final.c: Moved to... * final.cc: ...here. * gcc-interface/cuintp.c: Moved to... * gcc-interface/cuintp.cc: ...here. * gcc-interface/decl.c: Moved to... * gcc-interface/decl.cc: ...here. * gcc-interface/misc.c: Moved to... * gcc-interface/misc.cc: ...here. * gcc-interface/targtyps.c: Moved to... * gcc-interface/targtyps.cc: ...here. * gcc-interface/trans.c: Moved to... * gcc-interface/trans.cc: ...here. * gcc-interface/utils.c: Moved to... * gcc-interface/utils.cc: ...here. * gcc-interface/utils2.c: Moved to... * gcc-interface/utils2.cc: ...here. * init.c: Moved to... * init.cc: ...here. * initialize.c: Moved to... * initialize.cc: ...here. * libgnarl/thread.c: Moved to... * libgnarl/thread.cc: ...here. * link.c: Moved to... * link.cc: ...here. * locales.c: Moved to... * locales.cc: ...here. * mkdir.c: Moved to... * mkdir.cc: ...here. * raise.c: Moved to... * raise.cc: ...here. * rtfinal.c: Moved to... * rtfinal.cc: ...here. * rtinit.c: Moved to... * rtinit.cc: ...here. * seh_init.c: Moved to... * seh_init.cc: ...here. * sigtramp-armdroid.c: Moved to... * sigtramp-armdroid.cc: ...here. * sigtramp-ios.c: Moved to... * sigtramp-ios.cc: ...here. * sigtramp-qnx.c: Moved to... * sigtramp-qnx.cc: ...here. * sigtramp-vxworks.c: Moved to... * sigtramp-vxworks.cc: ...here. * socket.c: Moved to... * socket.cc: ...here. * tracebak.c: Moved to... * tracebak.cc: ...here. * version.c: Moved to... * version.cc: ...here. * vx_stack_info.c: Moved to... * vx_stack_info.cc: ...here. gcc/ChangeLog: * adjust-alignment.c: Moved to... * adjust-alignment.cc: ...here. * alias.c: Moved to... * alias.cc: ...here. * alloc-pool.c: Moved to... * alloc-pool.cc: ...here. * asan.c: Moved to... * asan.cc: ...here. * attribs.c: Moved to... * attribs.cc: ...here. * auto-inc-dec.c: Moved to... * auto-inc-dec.cc: ...here. * auto-profile.c: Moved to... * auto-profile.cc: ...here. * bb-reorder.c: Moved to... * bb-reorder.cc: ...here. * bitmap.c: Moved to... * bitmap.cc: ...here. * btfout.c: Moved to... * btfout.cc: ...here. * builtins.c: Moved to... * builtins.cc: ...here. * caller-save.c: Moved to... * caller-save.cc: ...here. * calls.c: Moved to... * calls.cc: ...here. * ccmp.c: Moved to... * ccmp.cc: ...here. * cfg.c: Moved to... * cfg.cc: ...here. * cfganal.c: Moved to... * cfganal.cc: ...here. * cfgbuild.c: Moved to... * cfgbuild.cc: ...here. * cfgcleanup.c: Moved to... * cfgcleanup.cc: ...here. * cfgexpand.c: Moved to... * cfgexpand.cc: ...here. * cfghooks.c: Moved to... * cfghooks.cc: ...here. * cfgloop.c: Moved to... * cfgloop.cc: ...here. * cfgloopanal.c: Moved to... * cfgloopanal.cc: ...here. * cfgloopmanip.c: Moved to... * cfgloopmanip.cc: ...here. * cfgrtl.c: Moved to... * cfgrtl.cc: ...here. * cgraph.c: Moved to... * cgraph.cc: ...here. * cgraphbuild.c: Moved to... * cgraphbuild.cc: ...here. * cgraphclones.c: Moved to... * cgraphclones.cc: ...here. * cgraphunit.c: Moved to... * cgraphunit.cc: ...here. * collect-utils.c: Moved to... * collect-utils.cc: ...here. * collect2-aix.c: Moved to... * collect2-aix.cc: ...here. * collect2.c: Moved to... * collect2.cc: ...here. * combine-stack-adj.c: Moved to... * combine-stack-adj.cc: ...here. * combine.c: Moved to... * combine.cc: ...here. * common/common-targhooks.c: Moved to... * common/common-targhooks.cc: ...here. * common/config/aarch64/aarch64-common.c: Moved to... * common/config/aarch64/aarch64-common.cc: ...here. * common/config/alpha/alpha-common.c: Moved to... * common/config/alpha/alpha-common.cc: ...here. * common/config/arc/arc-common.c: Moved to... * common/config/arc/arc-common.cc: ...here. * common/config/arm/arm-common.c: Moved to... * common/config/arm/arm-common.cc: ...here. * common/config/avr/avr-common.c: Moved to... * common/config/avr/avr-common.cc: ...here. * common/config/bfin/bfin-common.c: Moved to... * common/config/bfin/bfin-common.cc: ...here. * common/config/bpf/bpf-common.c: Moved to... * common/config/bpf/bpf-common.cc: ...here. * common/config/c6x/c6x-common.c: Moved to... * common/config/c6x/c6x-common.cc: ...here. * common/config/cr16/cr16-common.c: Moved to... * common/config/cr16/cr16-common.cc: ...here. * common/config/cris/cris-common.c: Moved to... * common/config/cris/cris-common.cc: ...here. * common/config/csky/csky-common.c: Moved to... * common/config/csky/csky-common.cc: ...here. * common/config/default-common.c: Moved to... * common/config/default-common.cc: ...here. * common/config/epiphany/epiphany-common.c: Moved to... * common/config/epiphany/epiphany-common.cc: ...here. * common/config/fr30/fr30-common.c: Moved to... * common/config/fr30/fr30-common.cc: ...here. * common/config/frv/frv-common.c: Moved to... * common/config/frv/frv-common.cc: ...here. * common/config/gcn/gcn-common.c: Moved to... * common/config/gcn/gcn-common.cc: ...here. * common/config/h8300/h8300-common.c: Moved to... * common/config/h8300/h8300-common.cc: ...here. * common/config/i386/i386-common.c: Moved to... * common/config/i386/i386-common.cc: ...here. * common/config/ia64/ia64-common.c: Moved to... * common/config/ia64/ia64-common.cc: ...here. * common/config/iq2000/iq2000-common.c: Moved to... * common/config/iq2000/iq2000-common.cc: ...here. * common/config/lm32/lm32-common.c: Moved to... * common/config/lm32/lm32-common.cc: ...here. * common/config/m32r/m32r-common.c: Moved to... * common/config/m32r/m32r-common.cc: ...here. * common/config/m68k/m68k-common.c: Moved to... * common/config/m68k/m68k-common.cc: ...here. * common/config/mcore/mcore-common.c: Moved to... * common/config/mcore/mcore-common.cc: ...here. * common/config/microblaze/microblaze-common.c: Moved to... * common/config/microblaze/microblaze-common.cc: ...here. * common/config/mips/mips-common.c: Moved to... * common/config/mips/mips-common.cc: ...here. * common/config/mmix/mmix-common.c: Moved to... * common/config/mmix/mmix-common.cc: ...here. * common/config/mn10300/mn10300-common.c: Moved to... * common/config/mn10300/mn10300-common.cc: ...here. * common/config/msp430/msp430-common.c: Moved to... * common/config/msp430/msp430-common.cc: ...here. * common/config/nds32/nds32-common.c: Moved to... * common/config/nds32/nds32-common.cc: ...here. * common/config/nios2/nios2-common.c: Moved to... * common/config/nios2/nios2-common.cc: ...here. * common/config/nvptx/nvptx-common.c: Moved to... * common/config/nvptx/nvptx-common.cc: ...here. * common/config/or1k/or1k-common.c: Moved to... * common/config/or1k/or1k-common.cc: ...here. * common/config/pa/pa-common.c: Moved to... * common/config/pa/pa-common.cc: ...here. * common/config/pdp11/pdp11-common.c: Moved to... * common/config/pdp11/pdp11-common.cc: ...here. * common/config/pru/pru-common.c: Moved to... * common/config/pru/pru-common.cc: ...here. * common/config/riscv/riscv-common.c: Moved to... * common/config/riscv/riscv-common.cc: ...here. * common/config/rs6000/rs6000-common.c: Moved to... * common/config/rs6000/rs6000-common.cc: ...here. * common/config/rx/rx-common.c: Moved to... * common/config/rx/rx-common.cc: ...here. * common/config/s390/s390-common.c: Moved to... * common/config/s390/s390-common.cc: ...here. * common/config/sh/sh-common.c: Moved to... * common/config/sh/sh-common.cc: ...here. * common/config/sparc/sparc-common.c: Moved to... * common/config/sparc/sparc-common.cc: ...here. * common/config/tilegx/tilegx-common.c: Moved to... * common/config/tilegx/tilegx-common.cc: ...here. * common/config/tilepro/tilepro-common.c: Moved to... * common/config/tilepro/tilepro-common.cc: ...here. * common/config/v850/v850-common.c: Moved to... * common/config/v850/v850-common.cc: ...here. * common/config/vax/vax-common.c: Moved to... * common/config/vax/vax-common.cc: ...here. * common/config/visium/visium-common.c: Moved to... * common/config/visium/visium-common.cc: ...here. * common/config/xstormy16/xstormy16-common.c: Moved to... * common/config/xstormy16/xstormy16-common.cc: ...here. * common/config/xtensa/xtensa-common.c: Moved to... * common/config/xtensa/xtensa-common.cc: ...here. * compare-elim.c: Moved to... * compare-elim.cc: ...here. * config/aarch64/aarch64-bti-insert.c: Moved to... * config/aarch64/aarch64-bti-insert.cc: ...here. * config/aarch64/aarch64-builtins.c: Moved to... * config/aarch64/aarch64-builtins.cc: ...here. * config/aarch64/aarch64-c.c: Moved to... * config/aarch64/aarch64-c.cc: ...here. * config/aarch64/aarch64-d.c: Moved to... * config/aarch64/aarch64-d.cc: ...here. * config/aarch64/aarch64.c: Moved to... * config/aarch64/aarch64.cc: ...here. * config/aarch64/cortex-a57-fma-steering.c: Moved to... * config/aarch64/cortex-a57-fma-steering.cc: ...here. * config/aarch64/driver-aarch64.c: Moved to... * config/aarch64/driver-aarch64.cc: ...here. * config/aarch64/falkor-tag-collision-avoidance.c: Moved to... * config/aarch64/falkor-tag-collision-avoidance.cc: ...here. * config/aarch64/host-aarch64-darwin.c: Moved to... * config/aarch64/host-aarch64-darwin.cc: ...here. * config/alpha/alpha.c: Moved to... * config/alpha/alpha.cc: ...here. * config/alpha/driver-alpha.c: Moved to... * config/alpha/driver-alpha.cc: ...here. * config/arc/arc-c.c: Moved to... * config/arc/arc-c.cc: ...here. * config/arc/arc.c: Moved to... * config/arc/arc.cc: ...here. * config/arc/driver-arc.c: Moved to... * config/arc/driver-arc.cc: ...here. * config/arm/aarch-common.c: Moved to... * config/arm/aarch-common.cc: ...here. * config/arm/arm-builtins.c: Moved to... * config/arm/arm-builtins.cc: ...here. * config/arm/arm-c.c: Moved to... * config/arm/arm-c.cc: ...here. * config/arm/arm-d.c: Moved to... * config/arm/arm-d.cc: ...here. * config/arm/arm.c: Moved to... * config/arm/arm.cc: ...here. * config/arm/driver-arm.c: Moved to... * config/arm/driver-arm.cc: ...here. * config/avr/avr-c.c: Moved to... * config/avr/avr-c.cc: ...here. * config/avr/avr-devices.c: Moved to... * config/avr/avr-devices.cc: ...here. * config/avr/avr-log.c: Moved to... * config/avr/avr-log.cc: ...here. * config/avr/avr.c: Moved to... * config/avr/avr.cc: ...here. * config/avr/driver-avr.c: Moved to... * config/avr/driver-avr.cc: ...here. * config/avr/gen-avr-mmcu-specs.c: Moved to... * config/avr/gen-avr-mmcu-specs.cc: ...here. * config/avr/gen-avr-mmcu-texi.c: Moved to... * config/avr/gen-avr-mmcu-texi.cc: ...here. * config/bfin/bfin.c: Moved to... * config/bfin/bfin.cc: ...here. * config/bpf/bpf.c: Moved to... * config/bpf/bpf.cc: ...here. * config/bpf/coreout.c: Moved to... * config/bpf/coreout.cc: ...here. * config/c6x/c6x.c: Moved to... * config/c6x/c6x.cc: ...here. * config/cr16/cr16.c: Moved to... * config/cr16/cr16.cc: ...here. * config/cris/cris.c: Moved to... * config/cris/cris.cc: ...here. * config/csky/csky.c: Moved to... * config/csky/csky.cc: ...here. * config/darwin-c.c: Moved to... * config/darwin-c.cc: ...here. * config/darwin-d.c: Moved to... * config/darwin-d.cc: ...here. * config/darwin-driver.c: Moved to... * config/darwin-driver.cc: ...here. * config/darwin-f.c: Moved to... * config/darwin-f.cc: ...here. * config/darwin.c: Moved to... * config/darwin.cc: ...here. * config/default-c.c: Moved to... * config/default-c.cc: ...here. * config/default-d.c: Moved to... * config/default-d.cc: ...here. * config/dragonfly-d.c: Moved to... * config/dragonfly-d.cc: ...here. * config/epiphany/epiphany.c: Moved to... * config/epiphany/epiphany.cc: ...here. * config/epiphany/mode-switch-use.c: Moved to... * config/epiphany/mode-switch-use.cc: ...here. * config/epiphany/resolve-sw-modes.c: Moved to... * config/epiphany/resolve-sw-modes.cc: ...here. * config/fr30/fr30.c: Moved to... * config/fr30/fr30.cc: ...here. * config/freebsd-d.c: Moved to... * config/freebsd-d.cc: ...here. * config/frv/frv.c: Moved to... * config/frv/frv.cc: ...here. * config/ft32/ft32.c: Moved to... * config/ft32/ft32.cc: ...here. * config/gcn/driver-gcn.c: Moved to... * config/gcn/driver-gcn.cc: ...here. * config/gcn/gcn-run.c: Moved to... * config/gcn/gcn-run.cc: ...here. * config/gcn/gcn-tree.c: Moved to... * config/gcn/gcn-tree.cc: ...here. * config/gcn/gcn.c: Moved to... * config/gcn/gcn.cc: ...here. * config/gcn/mkoffload.c: Moved to... * config/gcn/mkoffload.cc: ...here. * config/glibc-c.c: Moved to... * config/glibc-c.cc: ...here. * config/glibc-d.c: Moved to... * config/glibc-d.cc: ...here. * config/h8300/h8300.c: Moved to... * config/h8300/h8300.cc: ...here. * config/host-darwin.c: Moved to... * config/host-darwin.cc: ...here. * config/host-hpux.c: Moved to... * config/host-hpux.cc: ...here. * config/host-linux.c: Moved to... * config/host-linux.cc: ...here. * config/host-netbsd.c: Moved to... * config/host-netbsd.cc: ...here. * config/host-openbsd.c: Moved to... * config/host-openbsd.cc: ...here. * config/host-solaris.c: Moved to... * config/host-solaris.cc: ...here. * config/i386/djgpp.c: Moved to... * config/i386/djgpp.cc: ...here. * config/i386/driver-i386.c: Moved to... * config/i386/driver-i386.cc: ...here. * config/i386/driver-mingw32.c: Moved to... * config/i386/driver-mingw32.cc: ...here. * config/i386/gnu-property.c: Moved to... * config/i386/gnu-property.cc: ...here. * config/i386/host-cygwin.c: Moved to... * config/i386/host-cygwin.cc: ...here. * config/i386/host-i386-darwin.c: Moved to... * config/i386/host-i386-darwin.cc: ...here. * config/i386/host-mingw32.c: Moved to... * config/i386/host-mingw32.cc: ...here. * config/i386/i386-builtins.c: Moved to... * config/i386/i386-builtins.cc: ...here. * config/i386/i386-c.c: Moved to... * config/i386/i386-c.cc: ...here. * config/i386/i386-d.c: Moved to... * config/i386/i386-d.cc: ...here. * config/i386/i386-expand.c: Moved to... * config/i386/i386-expand.cc: ...here. * config/i386/i386-features.c: Moved to... * config/i386/i386-features.cc: ...here. * config/i386/i386-options.c: Moved to... * config/i386/i386-options.cc: ...here. * config/i386/i386.c: Moved to... * config/i386/i386.cc: ...here. * config/i386/intelmic-mkoffload.c: Moved to... * config/i386/intelmic-mkoffload.cc: ...here. * config/i386/msformat-c.c: Moved to... * config/i386/msformat-c.cc: ...here. * config/i386/winnt-cxx.c: Moved to... * config/i386/winnt-cxx.cc: ...here. * config/i386/winnt-d.c: Moved to... * config/i386/winnt-d.cc: ...here. * config/i386/winnt-stubs.c: Moved to... * config/i386/winnt-stubs.cc: ...here. * config/i386/winnt.c: Moved to... * config/i386/winnt.cc: ...here. * config/i386/x86-tune-sched-atom.c: Moved to... * config/i386/x86-tune-sched-atom.cc: ...here. * config/i386/x86-tune-sched-bd.c: Moved to... * config/i386/x86-tune-sched-bd.cc: ...here. * config/i386/x86-tune-sched-core.c: Moved to... * config/i386/x86-tune-sched-core.cc: ...here. * config/i386/x86-tune-sched.c: Moved to... * config/i386/x86-tune-sched.cc: ...here. * config/ia64/ia64-c.c: Moved to... * config/ia64/ia64-c.cc: ...here. * config/ia64/ia64.c: Moved to... * config/ia64/ia64.cc: ...here. * config/iq2000/iq2000.c: Moved to... * config/iq2000/iq2000.cc: ...here. * config/linux.c: Moved to... * config/linux.cc: ...here. * config/lm32/lm32.c: Moved to... * config/lm32/lm32.cc: ...here. * config/m32c/m32c-pragma.c: Moved to... * config/m32c/m32c-pragma.cc: ...here. * config/m32c/m32c.c: Moved to... * config/m32c/m32c.cc: ...here. * config/m32r/m32r.c: Moved to... * config/m32r/m32r.cc: ...here. * config/m68k/m68k.c: Moved to... * config/m68k/m68k.cc: ...here. * config/mcore/mcore.c: Moved to... * config/mcore/mcore.cc: ...here. * config/microblaze/microblaze-c.c: Moved to... * config/microblaze/microblaze-c.cc: ...here. * config/microblaze/microblaze.c: Moved to... * config/microblaze/microblaze.cc: ...here. * config/mips/driver-native.c: Moved to... * config/mips/driver-native.cc: ...here. * config/mips/frame-header-opt.c: Moved to... * config/mips/frame-header-opt.cc: ...here. * config/mips/mips-d.c: Moved to... * config/mips/mips-d.cc: ...here. * config/mips/mips.c: Moved to... * config/mips/mips.cc: ...here. * config/mmix/mmix.c: Moved to... * config/mmix/mmix.cc: ...here. * config/mn10300/mn10300.c: Moved to... * config/mn10300/mn10300.cc: ...here. * config/moxie/moxie.c: Moved to... * config/moxie/moxie.cc: ...here. * config/msp430/driver-msp430.c: Moved to... * config/msp430/driver-msp430.cc: ...here. * config/msp430/msp430-c.c: Moved to... * config/msp430/msp430-c.cc: ...here. * config/msp430/msp430-devices.c: Moved to... * config/msp430/msp430-devices.cc: ...here. * config/msp430/msp430.c: Moved to... * config/msp430/msp430.cc: ...here. * config/nds32/nds32-cost.c: Moved to... * config/nds32/nds32-cost.cc: ...here. * config/nds32/nds32-fp-as-gp.c: Moved to... * config/nds32/nds32-fp-as-gp.cc: ...here. * config/nds32/nds32-intrinsic.c: Moved to... * config/nds32/nds32-intrinsic.cc: ...here. * config/nds32/nds32-isr.c: Moved to... * config/nds32/nds32-isr.cc: ...here. * config/nds32/nds32-md-auxiliary.c: Moved to... * config/nds32/nds32-md-auxiliary.cc: ...here. * config/nds32/nds32-memory-manipulation.c: Moved to... * config/nds32/nds32-memory-manipulation.cc: ...here. * config/nds32/nds32-pipelines-auxiliary.c: Moved to... * config/nds32/nds32-pipelines-auxiliary.cc: ...here. * config/nds32/nds32-predicates.c: Moved to... * config/nds32/nds32-predicates.cc: ...here. * config/nds32/nds32-relax-opt.c: Moved to... * config/nds32/nds32-relax-opt.cc: ...here. * config/nds32/nds32-utils.c: Moved to... * config/nds32/nds32-utils.cc: ...here. * config/nds32/nds32.c: Moved to... * config/nds32/nds32.cc: ...here. * config/netbsd-d.c: Moved to... * config/netbsd-d.cc: ...here. * config/netbsd.c: Moved to... * config/netbsd.cc: ...here. * config/nios2/nios2.c: Moved to... * config/nios2/nios2.cc: ...here. * config/nvptx/mkoffload.c: Moved to... * config/nvptx/mkoffload.cc: ...here. * config/nvptx/nvptx-c.c: Moved to... * config/nvptx/nvptx-c.cc: ...here. * config/nvptx/nvptx.c: Moved to... * config/nvptx/nvptx.cc: ...here. * config/openbsd-d.c: Moved to... * config/openbsd-d.cc: ...here. * config/or1k/or1k.c: Moved to... * config/or1k/or1k.cc: ...here. * config/pa/pa-d.c: Moved to... * config/pa/pa-d.cc: ...here. * config/pa/pa.c: Moved to... * config/pa/pa.cc: ...here. * config/pdp11/pdp11.c: Moved to... * config/pdp11/pdp11.cc: ...here. * config/pru/pru-passes.c: Moved to... * config/pru/pru-passes.cc: ...here. * config/pru/pru-pragma.c: Moved to... * config/pru/pru-pragma.cc: ...here. * config/pru/pru.c: Moved to... * config/pru/pru.cc: ...here. * config/riscv/riscv-builtins.c: Moved to... * config/riscv/riscv-builtins.cc: ...here. * config/riscv/riscv-c.c: Moved to... * config/riscv/riscv-c.cc: ...here. * config/riscv/riscv-d.c: Moved to... * config/riscv/riscv-d.cc: ...here. * config/riscv/riscv-shorten-memrefs.c: Moved to... * config/riscv/riscv-shorten-memrefs.cc: ...here. * config/riscv/riscv-sr.c: Moved to... * config/riscv/riscv-sr.cc: ...here. * config/riscv/riscv.c: Moved to... * config/riscv/riscv.cc: ...here. * config/rl78/rl78-c.c: Moved to... * config/rl78/rl78-c.cc: ...here. * config/rl78/rl78.c: Moved to... * config/rl78/rl78.cc: ...here. * config/rs6000/driver-rs6000.c: Moved to... * config/rs6000/driver-rs6000.cc: ...here. * config/rs6000/host-darwin.c: Moved to... * config/rs6000/host-darwin.cc: ...here. * config/rs6000/host-ppc64-darwin.c: Moved to... * config/rs6000/host-ppc64-darwin.cc: ...here. * config/rs6000/rbtree.c: Moved to... * config/rs6000/rbtree.cc: ...here. * config/rs6000/rs6000-c.c: Moved to... * config/rs6000/rs6000-c.cc: ...here. * config/rs6000/rs6000-call.c: Moved to... * config/rs6000/rs6000-call.cc: ...here. * config/rs6000/rs6000-d.c: Moved to... * config/rs6000/rs6000-d.cc: ...here. * config/rs6000/rs6000-gen-builtins.c: Moved to... * config/rs6000/rs6000-gen-builtins.cc: ...here. * config/rs6000/rs6000-linux.c: Moved to... * config/rs6000/rs6000-linux.cc: ...here. * config/rs6000/rs6000-logue.c: Moved to... * config/rs6000/rs6000-logue.cc: ...here. * config/rs6000/rs6000-p8swap.c: Moved to... * config/rs6000/rs6000-p8swap.cc: ...here. * config/rs6000/rs6000-pcrel-opt.c: Moved to... * config/rs6000/rs6000-pcrel-opt.cc: ...here. * config/rs6000/rs6000-string.c: Moved to... * config/rs6000/rs6000-string.cc: ...here. * config/rs6000/rs6000.c: Moved to... * config/rs6000/rs6000.cc: ...here. * config/rx/rx.c: Moved to... * config/rx/rx.cc: ...here. * config/s390/driver-native.c: Moved to... * config/s390/driver-native.cc: ...here. * config/s390/s390-c.c: Moved to... * config/s390/s390-c.cc: ...here. * config/s390/s390-d.c: Moved to... * config/s390/s390-d.cc: ...here. * config/s390/s390.c: Moved to... * config/s390/s390.cc: ...here. * config/sh/divtab-sh4-300.c: Moved to... * config/sh/divtab-sh4-300.cc: ...here. * config/sh/divtab-sh4.c: Moved to... * config/sh/divtab-sh4.cc: ...here. * config/sh/divtab.c: Moved to... * config/sh/divtab.cc: ...here. * config/sh/sh-c.c: Moved to... * config/sh/sh-c.cc: ...here. * config/sh/sh.c: Moved to... * config/sh/sh.cc: ...here. * config/sol2-c.c: Moved to... * config/sol2-c.cc: ...here. * config/sol2-cxx.c: Moved to... * config/sol2-cxx.cc: ...here. * config/sol2-d.c: Moved to... * config/sol2-d.cc: ...here. * config/sol2-stubs.c: Moved to... * config/sol2-stubs.cc: ...here. * config/sol2.c: Moved to... * config/sol2.cc: ...here. * config/sparc/driver-sparc.c: Moved to... * config/sparc/driver-sparc.cc: ...here. * config/sparc/sparc-c.c: Moved to... * config/sparc/sparc-c.cc: ...here. * config/sparc/sparc-d.c: Moved to... * config/sparc/sparc-d.cc: ...here. * config/sparc/sparc.c: Moved to... * config/sparc/sparc.cc: ...here. * config/stormy16/stormy16.c: Moved to... * config/stormy16/stormy16.cc: ...here. * config/tilegx/mul-tables.c: Moved to... * config/tilegx/mul-tables.cc: ...here. * config/tilegx/tilegx-c.c: Moved to... * config/tilegx/tilegx-c.cc: ...here. * config/tilegx/tilegx.c: Moved to... * config/tilegx/tilegx.cc: ...here. * config/tilepro/mul-tables.c: Moved to... * config/tilepro/mul-tables.cc: ...here. * config/tilepro/tilepro-c.c: Moved to... * config/tilepro/tilepro-c.cc: ...here. * config/tilepro/tilepro.c: Moved to... * config/tilepro/tilepro.cc: ...here. * config/v850/v850-c.c: Moved to... * config/v850/v850-c.cc: ...here. * config/v850/v850.c: Moved to... * config/v850/v850.cc: ...here. * config/vax/vax.c: Moved to... * config/vax/vax.cc: ...here. * config/visium/visium.c: Moved to... * config/visium/visium.cc: ...here. * config/vms/vms-c.c: Moved to... * config/vms/vms-c.cc: ...here. * config/vms/vms-f.c: Moved to... * config/vms/vms-f.cc: ...here. * config/vms/vms.c: Moved to... * config/vms/vms.cc: ...here. * config/vxworks-c.c: Moved to... * config/vxworks-c.cc: ...here. * config/vxworks.c: Moved to... * config/vxworks.cc: ...here. * config/winnt-c.c: Moved to... * config/winnt-c.cc: ...here. * config/xtensa/xtensa.c: Moved to... * config/xtensa/xtensa.cc: ...here. * context.c: Moved to... * context.cc: ...here. * convert.c: Moved to... * convert.cc: ...here. * coverage.c: Moved to... * coverage.cc: ...here. * cppbuiltin.c: Moved to... * cppbuiltin.cc: ...here. * cppdefault.c: Moved to... * cppdefault.cc: ...here. * cprop.c: Moved to... * cprop.cc: ...here. * cse.c: Moved to... * cse.cc: ...here. * cselib.c: Moved to... * cselib.cc: ...here. * ctfc.c: Moved to... * ctfc.cc: ...here. * ctfout.c: Moved to... * ctfout.cc: ...here. * data-streamer-in.c: Moved to... * data-streamer-in.cc: ...here. * data-streamer-out.c: Moved to... * data-streamer-out.cc: ...here. * data-streamer.c: Moved to... * data-streamer.cc: ...here. * dbgcnt.c: Moved to... * dbgcnt.cc: ...here. * dbxout.c: Moved to... * dbxout.cc: ...here. * dce.c: Moved to... * dce.cc: ...here. * ddg.c: Moved to... * ddg.cc: ...here. * debug.c: Moved to... * debug.cc: ...here. * df-core.c: Moved to... * df-core.cc: ...here. * df-problems.c: Moved to... * df-problems.cc: ...here. * df-scan.c: Moved to... * df-scan.cc: ...here. * dfp.c: Moved to... * dfp.cc: ...here. * diagnostic-color.c: Moved to... * diagnostic-color.cc: ...here. * diagnostic-show-locus.c: Moved to... * diagnostic-show-locus.cc: ...here. * diagnostic-spec.c: Moved to... * diagnostic-spec.cc: ...here. * diagnostic.c: Moved to... * diagnostic.cc: ...here. * dojump.c: Moved to... * dojump.cc: ...here. * dominance.c: Moved to... * dominance.cc: ...here. * domwalk.c: Moved to... * domwalk.cc: ...here. * double-int.c: Moved to... * double-int.cc: ...here. * dse.c: Moved to... * dse.cc: ...here. * dumpfile.c: Moved to... * dumpfile.cc: ...here. * dwarf2asm.c: Moved to... * dwarf2asm.cc: ...here. * dwarf2cfi.c: Moved to... * dwarf2cfi.cc: ...here. * dwarf2ctf.c: Moved to... * dwarf2ctf.cc: ...here. * dwarf2out.c: Moved to... * dwarf2out.cc: ...here. * early-remat.c: Moved to... * early-remat.cc: ...here. * edit-context.c: Moved to... * edit-context.cc: ...here. * emit-rtl.c: Moved to... * emit-rtl.cc: ...here. * errors.c: Moved to... * errors.cc: ...here. * et-forest.c: Moved to... * et-forest.cc: ...here. * except.c: Moved to... * except.cc: ...here. * explow.c: Moved to... * explow.cc: ...here. * expmed.c: Moved to... * expmed.cc: ...here. * expr.c: Moved to... * expr.cc: ...here. * fibonacci_heap.c: Moved to... * fibonacci_heap.cc: ...here. * file-find.c: Moved to... * file-find.cc: ...here. * file-prefix-map.c: Moved to... * file-prefix-map.cc: ...here. * final.c: Moved to... * final.cc: ...here. * fixed-value.c: Moved to... * fixed-value.cc: ...here. * fold-const-call.c: Moved to... * fold-const-call.cc: ...here. * fold-const.c: Moved to... * fold-const.cc: ...here. * fp-test.c: Moved to... * fp-test.cc: ...here. * function-tests.c: Moved to... * function-tests.cc: ...here. * function.c: Moved to... * function.cc: ...here. * fwprop.c: Moved to... * fwprop.cc: ...here. * gcc-ar.c: Moved to... * gcc-ar.cc: ...here. * gcc-main.c: Moved to... * gcc-main.cc: ...here. * gcc-rich-location.c: Moved to... * gcc-rich-location.cc: ...here. * gcc.c: Moved to... * gcc.cc: ...here. * gcov-dump.c: Moved to... * gcov-dump.cc: ...here. * gcov-io.c: Moved to... * gcov-io.cc: ...here. * gcov-tool.c: Moved to... * gcov-tool.cc: ...here. * gcov.c: Moved to... * gcov.cc: ...here. * gcse-common.c: Moved to... * gcse-common.cc: ...here. * gcse.c: Moved to... * gcse.cc: ...here. * genattr-common.c: Moved to... * genattr-common.cc: ...here. * genattr.c: Moved to... * genattr.cc: ...here. * genattrtab.c: Moved to... * genattrtab.cc: ...here. * genautomata.c: Moved to... * genautomata.cc: ...here. * gencfn-macros.c: Moved to... * gencfn-macros.cc: ...here. * gencheck.c: Moved to... * gencheck.cc: ...here. * genchecksum.c: Moved to... * genchecksum.cc: ...here. * gencodes.c: Moved to... * gencodes.cc: ...here. * genconditions.c: Moved to... * genconditions.cc: ...here. * genconfig.c: Moved to... * genconfig.cc: ...here. * genconstants.c: Moved to... * genconstants.cc: ...here. * genemit.c: Moved to... * genemit.cc: ...here. * genenums.c: Moved to... * genenums.cc: ...here. * generic-match-head.c: Moved to... * generic-match-head.cc: ...here. * genextract.c: Moved to... * genextract.cc: ...here. * genflags.c: Moved to... * genflags.cc: ...here. * gengenrtl.c: Moved to... * gengenrtl.cc: ...here. * gengtype-parse.c: Moved to... * gengtype-parse.cc: ...here. * gengtype-state.c: Moved to... * gengtype-state.cc: ...here. * gengtype.c: Moved to... * gengtype.cc: ...here. * genhooks.c: Moved to... * genhooks.cc: ...here. * genmatch.c: Moved to... * genmatch.cc: ...here. * genmddeps.c: Moved to... * genmddeps.cc: ...here. * genmddump.c: Moved to... * genmddump.cc: ...here. * genmodes.c: Moved to... * genmodes.cc: ...here. * genopinit.c: Moved to... * genopinit.cc: ...here. * genoutput.c: Moved to... * genoutput.cc: ...here. * genpeep.c: Moved to... * genpeep.cc: ...here. * genpreds.c: Moved to... * genpreds.cc: ...here. * genrecog.c: Moved to... * genrecog.cc: ...here. * gensupport.c: Moved to... * gensupport.cc: ...here. * gentarget-def.c: Moved to... * gentarget-def.cc: ...here. * genversion.c: Moved to... * genversion.cc: ...here. * ggc-common.c: Moved to... * ggc-common.cc: ...here. * ggc-none.c: Moved to... * ggc-none.cc: ...here. * ggc-page.c: Moved to... * ggc-page.cc: ...here. * ggc-tests.c: Moved to... * ggc-tests.cc: ...here. * gimple-builder.c: Moved to... * gimple-builder.cc: ...here. * gimple-expr.c: Moved to... * gimple-expr.cc: ...here. * gimple-fold.c: Moved to... * gimple-fold.cc: ...here. * gimple-iterator.c: Moved to... * gimple-iterator.cc: ...here. * gimple-laddress.c: Moved to... * gimple-laddress.cc: ...here. * gimple-loop-jam.c: Moved to... * gimple-loop-jam.cc: ...here. * gimple-low.c: Moved to... * gimple-low.cc: ...here. * gimple-match-head.c: Moved to... * gimple-match-head.cc: ...here. * gimple-pretty-print.c: Moved to... * gimple-pretty-print.cc: ...here. * gimple-ssa-backprop.c: Moved to... * gimple-ssa-backprop.cc: ...here. * gimple-ssa-evrp-analyze.c: Moved to... * gimple-ssa-evrp-analyze.cc: ...here. * gimple-ssa-evrp.c: Moved to... * gimple-ssa-evrp.cc: ...here. * gimple-ssa-isolate-paths.c: Moved to... * gimple-ssa-isolate-paths.cc: ...here. * gimple-ssa-nonnull-compare.c: Moved to... * gimple-ssa-nonnull-compare.cc: ...here. * gimple-ssa-split-paths.c: Moved to... * gimple-ssa-split-paths.cc: ...here. * gimple-ssa-sprintf.c: Moved to... * gimple-ssa-sprintf.cc: ...here. * gimple-ssa-store-merging.c: Moved to... * gimple-ssa-store-merging.cc: ...here. * gimple-ssa-strength-reduction.c: Moved to... * gimple-ssa-strength-reduction.cc: ...here. * gimple-ssa-warn-alloca.c: Moved to... * gimple-ssa-warn-alloca.cc: ...here. * gimple-ssa-warn-restrict.c: Moved to... * gimple-ssa-warn-restrict.cc: ...here. * gimple-streamer-in.c: Moved to... * gimple-streamer-in.cc: ...here. * gimple-streamer-out.c: Moved to... * gimple-streamer-out.cc: ...here. * gimple-walk.c: Moved to... * gimple-walk.cc: ...here. * gimple-warn-recursion.c: Moved to... * gimple-warn-recursion.cc: ...here. * gimple.c: Moved to... * gimple.cc: ...here. * gimplify-me.c: Moved to... * gimplify-me.cc: ...here. * gimplify.c: Moved to... * gimplify.cc: ...here. * godump.c: Moved to... * godump.cc: ...here. * graph.c: Moved to... * graph.cc: ...here. * graphds.c: Moved to... * graphds.cc: ...here. * graphite-dependences.c: Moved to... * graphite-dependences.cc: ...here. * graphite-isl-ast-to-gimple.c: Moved to... * graphite-isl-ast-to-gimple.cc: ...here. * graphite-optimize-isl.c: Moved to... * graphite-optimize-isl.cc: ...here. * graphite-poly.c: Moved to... * graphite-poly.cc: ...here. * graphite-scop-detection.c: Moved to... * graphite-scop-detection.cc: ...here. * graphite-sese-to-poly.c: Moved to... * graphite-sese-to-poly.cc: ...here. * graphite.c: Moved to... * graphite.cc: ...here. * haifa-sched.c: Moved to... * haifa-sched.cc: ...here. * hash-map-tests.c: Moved to... * hash-map-tests.cc: ...here. * hash-set-tests.c: Moved to... * hash-set-tests.cc: ...here. * hash-table.c: Moved to... * hash-table.cc: ...here. * hooks.c: Moved to... * hooks.cc: ...here. * host-default.c: Moved to... * host-default.cc: ...here. * hw-doloop.c: Moved to... * hw-doloop.cc: ...here. * hwint.c: Moved to... * hwint.cc: ...here. * ifcvt.c: Moved to... * ifcvt.cc: ...here. * inchash.c: Moved to... * inchash.cc: ...here. * incpath.c: Moved to... * incpath.cc: ...here. * init-regs.c: Moved to... * init-regs.cc: ...here. * input.c: Moved to... * input.cc: ...here. * internal-fn.c: Moved to... * internal-fn.cc: ...here. * intl.c: Moved to... * intl.cc: ...here. * ipa-comdats.c: Moved to... * ipa-comdats.cc: ...here. * ipa-cp.c: Moved to... * ipa-cp.cc: ...here. * ipa-devirt.c: Moved to... * ipa-devirt.cc: ...here. * ipa-fnsummary.c: Moved to... * ipa-fnsummary.cc: ...here. * ipa-icf-gimple.c: Moved to... * ipa-icf-gimple.cc: ...here. * ipa-icf.c: Moved to... * ipa-icf.cc: ...here. * ipa-inline-analysis.c: Moved to... * ipa-inline-analysis.cc: ...here. * ipa-inline-transform.c: Moved to... * ipa-inline-transform.cc: ...here. * ipa-inline.c: Moved to... * ipa-inline.cc: ...here. * ipa-modref-tree.c: Moved to... * ipa-modref-tree.cc: ...here. * ipa-modref.c: Moved to... * ipa-modref.cc: ...here. * ipa-param-manipulation.c: Moved to... * ipa-param-manipulation.cc: ...here. * ipa-polymorphic-call.c: Moved to... * ipa-polymorphic-call.cc: ...here. * ipa-predicate.c: Moved to... * ipa-predicate.cc: ...here. * ipa-profile.c: Moved to... * ipa-profile.cc: ...here. * ipa-prop.c: Moved to... * ipa-prop.cc: ...here. * ipa-pure-const.c: Moved to... * ipa-pure-const.cc: ...here. * ipa-ref.c: Moved to... * ipa-ref.cc: ...here. * ipa-reference.c: Moved to... * ipa-reference.cc: ...here. * ipa-split.c: Moved to... * ipa-split.cc: ...here. * ipa-sra.c: Moved to... * ipa-sra.cc: ...here. * ipa-utils.c: Moved to... * ipa-utils.cc: ...here. * ipa-visibility.c: Moved to... * ipa-visibility.cc: ...here. * ipa.c: Moved to... * ipa.cc: ...here. * ira-build.c: Moved to... * ira-build.cc: ...here. * ira-color.c: Moved to... * ira-color.cc: ...here. * ira-conflicts.c: Moved to... * ira-conflicts.cc: ...here. * ira-costs.c: Moved to... * ira-costs.cc: ...here. * ira-emit.c: Moved to... * ira-emit.cc: ...here. * ira-lives.c: Moved to... * ira-lives.cc: ...here. * ira.c: Moved to... * ira.cc: ...here. * jump.c: Moved to... * jump.cc: ...here. * langhooks.c: Moved to... * langhooks.cc: ...here. * lcm.c: Moved to... * lcm.cc: ...here. * lists.c: Moved to... * lists.cc: ...here. * loop-doloop.c: Moved to... * loop-doloop.cc: ...here. * loop-init.c: Moved to... * loop-init.cc: ...here. * loop-invariant.c: Moved to... * loop-invariant.cc: ...here. * loop-iv.c: Moved to... * loop-iv.cc: ...here. * loop-unroll.c: Moved to... * loop-unroll.cc: ...here. * lower-subreg.c: Moved to... * lower-subreg.cc: ...here. * lra-assigns.c: Moved to... * lra-assigns.cc: ...here. * lra-coalesce.c: Moved to... * lra-coalesce.cc: ...here. * lra-constraints.c: Moved to... * lra-constraints.cc: ...here. * lra-eliminations.c: Moved to... * lra-eliminations.cc: ...here. * lra-lives.c: Moved to... * lra-lives.cc: ...here. * lra-remat.c: Moved to... * lra-remat.cc: ...here. * lra-spills.c: Moved to... * lra-spills.cc: ...here. * lra.c: Moved to... * lra.cc: ...here. * lto-cgraph.c: Moved to... * lto-cgraph.cc: ...here. * lto-compress.c: Moved to... * lto-compress.cc: ...here. * lto-opts.c: Moved to... * lto-opts.cc: ...here. * lto-section-in.c: Moved to... * lto-section-in.cc: ...here. * lto-section-out.c: Moved to... * lto-section-out.cc: ...here. * lto-streamer-in.c: Moved to... * lto-streamer-in.cc: ...here. * lto-streamer-out.c: Moved to... * lto-streamer-out.cc: ...here. * lto-streamer.c: Moved to... * lto-streamer.cc: ...here. * lto-wrapper.c: Moved to... * lto-wrapper.cc: ...here. * main.c: Moved to... * main.cc: ...here. * mcf.c: Moved to... * mcf.cc: ...here. * mode-switching.c: Moved to... * mode-switching.cc: ...here. * modulo-sched.c: Moved to... * modulo-sched.cc: ...here. * multiple_target.c: Moved to... * multiple_target.cc: ...here. * omp-expand.c: Moved to... * omp-expand.cc: ...here. * omp-general.c: Moved to... * omp-general.cc: ...here. * omp-low.c: Moved to... * omp-low.cc: ...here. * omp-offload.c: Moved to... * omp-offload.cc: ...here. * omp-simd-clone.c: Moved to... * omp-simd-clone.cc: ...here. * opt-suggestions.c: Moved to... * opt-suggestions.cc: ...here. * optabs-libfuncs.c: Moved to... * optabs-libfuncs.cc: ...here. * optabs-query.c: Moved to... * optabs-query.cc: ...here. * optabs-tree.c: Moved to... * optabs-tree.cc: ...here. * optabs.c: Moved to... * optabs.cc: ...here. * opts-common.c: Moved to... * opts-common.cc: ...here. * opts-global.c: Moved to... * opts-global.cc: ...here. * opts.c: Moved to... * opts.cc: ...here. * passes.c: Moved to... * passes.cc: ...here. * plugin.c: Moved to... * plugin.cc: ...here. * postreload-gcse.c: Moved to... * postreload-gcse.cc: ...here. * postreload.c: Moved to... * postreload.cc: ...here. * predict.c: Moved to... * predict.cc: ...here. * prefix.c: Moved to... * prefix.cc: ...here. * pretty-print.c: Moved to... * pretty-print.cc: ...here. * print-rtl-function.c: Moved to... * print-rtl-function.cc: ...here. * print-rtl.c: Moved to... * print-rtl.cc: ...here. * print-tree.c: Moved to... * print-tree.cc: ...here. * profile-count.c: Moved to... * profile-count.cc: ...here. * profile.c: Moved to... * profile.cc: ...here. * read-md.c: Moved to... * read-md.cc: ...here. * read-rtl-function.c: Moved to... * read-rtl-function.cc: ...here. * read-rtl.c: Moved to... * read-rtl.cc: ...here. * real.c: Moved to... * real.cc: ...here. * realmpfr.c: Moved to... * realmpfr.cc: ...here. * recog.c: Moved to... * recog.cc: ...here. * ree.c: Moved to... * ree.cc: ...here. * reg-stack.c: Moved to... * reg-stack.cc: ...here. * regcprop.c: Moved to... * regcprop.cc: ...here. * reginfo.c: Moved to... * reginfo.cc: ...here. * regrename.c: Moved to... * regrename.cc: ...here. * regstat.c: Moved to... * regstat.cc: ...here. * reload.c: Moved to... * reload.cc: ...here. * reload1.c: Moved to... * reload1.cc: ...here. * reorg.c: Moved to... * reorg.cc: ...here. * resource.c: Moved to... * resource.cc: ...here. * rtl-error.c: Moved to... * rtl-error.cc: ...here. * rtl-tests.c: Moved to... * rtl-tests.cc: ...here. * rtl.c: Moved to... * rtl.cc: ...here. * rtlanal.c: Moved to... * rtlanal.cc: ...here. * rtlhash.c: Moved to... * rtlhash.cc: ...here. * rtlhooks.c: Moved to... * rtlhooks.cc: ...here. * rtx-vector-builder.c: Moved to... * rtx-vector-builder.cc: ...here. * run-rtl-passes.c: Moved to... * run-rtl-passes.cc: ...here. * sancov.c: Moved to... * sancov.cc: ...here. * sanopt.c: Moved to... * sanopt.cc: ...here. * sbitmap.c: Moved to... * sbitmap.cc: ...here. * sched-deps.c: Moved to... * sched-deps.cc: ...here. * sched-ebb.c: Moved to... * sched-ebb.cc: ...here. * sched-rgn.c: Moved to... * sched-rgn.cc: ...here. * sel-sched-dump.c: Moved to... * sel-sched-dump.cc: ...here. * sel-sched-ir.c: Moved to... * sel-sched-ir.cc: ...here. * sel-sched.c: Moved to... * sel-sched.cc: ...here. * selftest-diagnostic.c: Moved to... * selftest-diagnostic.cc: ...here. * selftest-rtl.c: Moved to... * selftest-rtl.cc: ...here. * selftest-run-tests.c: Moved to... * selftest-run-tests.cc: ...here. * selftest.c: Moved to... * selftest.cc: ...here. * sese.c: Moved to... * sese.cc: ...here. * shrink-wrap.c: Moved to... * shrink-wrap.cc: ...here. * simplify-rtx.c: Moved to... * simplify-rtx.cc: ...here. * sparseset.c: Moved to... * sparseset.cc: ...here. * spellcheck-tree.c: Moved to... * spellcheck-tree.cc: ...here. * spellcheck.c: Moved to... * spellcheck.cc: ...here. * sreal.c: Moved to... * sreal.cc: ...here. * stack-ptr-mod.c: Moved to... * stack-ptr-mod.cc: ...here. * statistics.c: Moved to... * statistics.cc: ...here. * stmt.c: Moved to... * stmt.cc: ...here. * stor-layout.c: Moved to... * stor-layout.cc: ...here. * store-motion.c: Moved to... * store-motion.cc: ...here. * streamer-hooks.c: Moved to... * streamer-hooks.cc: ...here. * stringpool.c: Moved to... * stringpool.cc: ...here. * substring-locations.c: Moved to... * substring-locations.cc: ...here. * symtab.c: Moved to... * symtab.cc: ...here. * target-globals.c: Moved to... * target-globals.cc: ...here. * targhooks.c: Moved to... * targhooks.cc: ...here. * timevar.c: Moved to... * timevar.cc: ...here. * toplev.c: Moved to... * toplev.cc: ...here. * tracer.c: Moved to... * tracer.cc: ...here. * trans-mem.c: Moved to... * trans-mem.cc: ...here. * tree-affine.c: Moved to... * tree-affine.cc: ...here. * tree-call-cdce.c: Moved to... * tree-call-cdce.cc: ...here. * tree-cfg.c: Moved to... * tree-cfg.cc: ...here. * tree-cfgcleanup.c: Moved to... * tree-cfgcleanup.cc: ...here. * tree-chrec.c: Moved to... * tree-chrec.cc: ...here. * tree-complex.c: Moved to... * tree-complex.cc: ...here. * tree-data-ref.c: Moved to... * tree-data-ref.cc: ...here. * tree-dfa.c: Moved to... * tree-dfa.cc: ...here. * tree-diagnostic.c: Moved to... * tree-diagnostic.cc: ...here. * tree-dump.c: Moved to... * tree-dump.cc: ...here. * tree-eh.c: Moved to... * tree-eh.cc: ...here. * tree-emutls.c: Moved to... * tree-emutls.cc: ...here. * tree-if-conv.c: Moved to... * tree-if-conv.cc: ...here. * tree-inline.c: Moved to... * tree-inline.cc: ...here. * tree-into-ssa.c: Moved to... * tree-into-ssa.cc: ...here. * tree-iterator.c: Moved to... * tree-iterator.cc: ...here. * tree-loop-distribution.c: Moved to... * tree-loop-distribution.cc: ...here. * tree-nested.c: Moved to... * tree-nested.cc: ...here. * tree-nrv.c: Moved to... * tree-nrv.cc: ...here. * tree-object-size.c: Moved to... * tree-object-size.cc: ...here. * tree-outof-ssa.c: Moved to... * tree-outof-ssa.cc: ...here. * tree-parloops.c: Moved to... * tree-parloops.cc: ...here. * tree-phinodes.c: Moved to... * tree-phinodes.cc: ...here. * tree-predcom.c: Moved to... * tree-predcom.cc: ...here. * tree-pretty-print.c: Moved to... * tree-pretty-print.cc: ...here. * tree-profile.c: Moved to... * tree-profile.cc: ...here. * tree-scalar-evolution.c: Moved to... * tree-scalar-evolution.cc: ...here. * tree-sra.c: Moved to... * tree-sra.cc: ...here. * tree-ssa-address.c: Moved to... * tree-ssa-address.cc: ...here. * tree-ssa-alias.c: Moved to... * tree-ssa-alias.cc: ...here. * tree-ssa-ccp.c: Moved to... * tree-ssa-ccp.cc: ...here. * tree-ssa-coalesce.c: Moved to... * tree-ssa-coalesce.cc: ...here. * tree-ssa-copy.c: Moved to... * tree-ssa-copy.cc: ...here. * tree-ssa-dce.c: Moved to... * tree-ssa-dce.cc: ...here. * tree-ssa-dom.c: Moved to... * tree-ssa-dom.cc: ...here. * tree-ssa-dse.c: Moved to... * tree-ssa-dse.cc: ...here. * tree-ssa-forwprop.c: Moved to... * tree-ssa-forwprop.cc: ...here. * tree-ssa-ifcombine.c: Moved to... * tree-ssa-ifcombine.cc: ...here. * tree-ssa-live.c: Moved to... * tree-ssa-live.cc: ...here. * tree-ssa-loop-ch.c: Moved to... * tree-ssa-loop-ch.cc: ...here. * tree-ssa-loop-im.c: Moved to... * tree-ssa-loop-im.cc: ...here. * tree-ssa-loop-ivcanon.c: Moved to... * tree-ssa-loop-ivcanon.cc: ...here. * tree-ssa-loop-ivopts.c: Moved to... * tree-ssa-loop-ivopts.cc: ...here. * tree-ssa-loop-manip.c: Moved to... * tree-ssa-loop-manip.cc: ...here. * tree-ssa-loop-niter.c: Moved to... * tree-ssa-loop-niter.cc: ...here. * tree-ssa-loop-prefetch.c: Moved to... * tree-ssa-loop-prefetch.cc: ...here. * tree-ssa-loop-split.c: Moved to... * tree-ssa-loop-split.cc: ...here. * tree-ssa-loop-unswitch.c: Moved to... * tree-ssa-loop-unswitch.cc: ...here. * tree-ssa-loop.c: Moved to... * tree-ssa-loop.cc: ...here. * tree-ssa-math-opts.c: Moved to... * tree-ssa-math-opts.cc: ...here. * tree-ssa-operands.c: Moved to... * tree-ssa-operands.cc: ...here. * tree-ssa-phiopt.c: Moved to... * tree-ssa-phiopt.cc: ...here. * tree-ssa-phiprop.c: Moved to... * tree-ssa-phiprop.cc: ...here. * tree-ssa-pre.c: Moved to... * tree-ssa-pre.cc: ...here. * tree-ssa-propagate.c: Moved to... * tree-ssa-propagate.cc: ...here. * tree-ssa-reassoc.c: Moved to... * tree-ssa-reassoc.cc: ...here. * tree-ssa-sccvn.c: Moved to... * tree-ssa-sccvn.cc: ...here. * tree-ssa-scopedtables.c: Moved to... * tree-ssa-scopedtables.cc: ...here. * tree-ssa-sink.c: Moved to... * tree-ssa-sink.cc: ...here. * tree-ssa-strlen.c: Moved to... * tree-ssa-strlen.cc: ...here. * tree-ssa-structalias.c: Moved to... * tree-ssa-structalias.cc: ...here. * tree-ssa-tail-merge.c: Moved to... * tree-ssa-tail-merge.cc: ...here. * tree-ssa-ter.c: Moved to... * tree-ssa-ter.cc: ...here. * tree-ssa-threadbackward.c: Moved to... * tree-ssa-threadbackward.cc: ...here. * tree-ssa-threadedge.c: Moved to... * tree-ssa-threadedge.cc: ...here. * tree-ssa-threadupdate.c: Moved to... * tree-ssa-threadupdate.cc: ...here. * tree-ssa-uncprop.c: Moved to... * tree-ssa-uncprop.cc: ...here. * tree-ssa-uninit.c: Moved to... * tree-ssa-uninit.cc: ...here. * tree-ssa.c: Moved to... * tree-ssa.cc: ...here. * tree-ssanames.c: Moved to... * tree-ssanames.cc: ...here. * tree-stdarg.c: Moved to... * tree-stdarg.cc: ...here. * tree-streamer-in.c: Moved to... * tree-streamer-in.cc: ...here. * tree-streamer-out.c: Moved to... * tree-streamer-out.cc: ...here. * tree-streamer.c: Moved to... * tree-streamer.cc: ...here. * tree-switch-conversion.c: Moved to... * tree-switch-conversion.cc: ...here. * tree-tailcall.c: Moved to... * tree-tailcall.cc: ...here. * tree-vect-data-refs.c: Moved to... * tree-vect-data-refs.cc: ...here. * tree-vect-generic.c: Moved to... * tree-vect-generic.cc: ...here. * tree-vect-loop-manip.c: Moved to... * tree-vect-loop-manip.cc: ...here. * tree-vect-loop.c: Moved to... * tree-vect-loop.cc: ...here. * tree-vect-patterns.c: Moved to... * tree-vect-patterns.cc: ...here. * tree-vect-slp-patterns.c: Moved to... * tree-vect-slp-patterns.cc: ...here. * tree-vect-slp.c: Moved to... * tree-vect-slp.cc: ...here. * tree-vect-stmts.c: Moved to... * tree-vect-stmts.cc: ...here. * tree-vector-builder.c: Moved to... * tree-vector-builder.cc: ...here. * tree-vectorizer.c: Moved to... * tree-vectorizer.cc: ...here. * tree-vrp.c: Moved to... * tree-vrp.cc: ...here. * tree.c: Moved to... * tree.cc: ...here. * tsan.c: Moved to... * tsan.cc: ...here. * typed-splay-tree.c: Moved to... * typed-splay-tree.cc: ...here. * ubsan.c: Moved to... * ubsan.cc: ...here. * valtrack.c: Moved to... * valtrack.cc: ...here. * value-prof.c: Moved to... * value-prof.cc: ...here. * var-tracking.c: Moved to... * var-tracking.cc: ...here. * varasm.c: Moved to... * varasm.cc: ...here. * varpool.c: Moved to... * varpool.cc: ...here. * vec-perm-indices.c: Moved to... * vec-perm-indices.cc: ...here. * vec.c: Moved to... * vec.cc: ...here. * vmsdbgout.c: Moved to... * vmsdbgout.cc: ...here. * vr-values.c: Moved to... * vr-values.cc: ...here. * vtable-verify.c: Moved to... * vtable-verify.cc: ...here. * web.c: Moved to... * web.cc: ...here. * xcoffout.c: Moved to... * xcoffout.cc: ...here. gcc/c-family/ChangeLog: * c-ada-spec.c: Moved to... * c-ada-spec.cc: ...here. * c-attribs.c: Moved to... * c-attribs.cc: ...here. * c-common.c: Moved to... * c-common.cc: ...here. * c-cppbuiltin.c: Moved to... * c-cppbuiltin.cc: ...here. * c-dump.c: Moved to... * c-dump.cc: ...here. * c-format.c: Moved to... * c-format.cc: ...here. * c-gimplify.c: Moved to... * c-gimplify.cc: ...here. * c-indentation.c: Moved to... * c-indentation.cc: ...here. * c-lex.c: Moved to... * c-lex.cc: ...here. * c-omp.c: Moved to... * c-omp.cc: ...here. * c-opts.c: Moved to... * c-opts.cc: ...here. * c-pch.c: Moved to... * c-pch.cc: ...here. * c-ppoutput.c: Moved to... * c-ppoutput.cc: ...here. * c-pragma.c: Moved to... * c-pragma.cc: ...here. * c-pretty-print.c: Moved to... * c-pretty-print.cc: ...here. * c-semantics.c: Moved to... * c-semantics.cc: ...here. * c-ubsan.c: Moved to... * c-ubsan.cc: ...here. * c-warn.c: Moved to... * c-warn.cc: ...here. * cppspec.c: Moved to... * cppspec.cc: ...here. * stub-objc.c: Moved to... * stub-objc.cc: ...here. gcc/c/ChangeLog: * c-aux-info.c: Moved to... * c-aux-info.cc: ...here. * c-convert.c: Moved to... * c-convert.cc: ...here. * c-decl.c: Moved to... * c-decl.cc: ...here. * c-errors.c: Moved to... * c-errors.cc: ...here. * c-fold.c: Moved to... * c-fold.cc: ...here. * c-lang.c: Moved to... * c-lang.cc: ...here. * c-objc-common.c: Moved to... * c-objc-common.cc: ...here. * c-parser.c: Moved to... * c-parser.cc: ...here. * c-typeck.c: Moved to... * c-typeck.cc: ...here. * gccspec.c: Moved to... * gccspec.cc: ...here. * gimple-parser.c: Moved to... * gimple-parser.cc: ...here. gcc/cp/ChangeLog: * call.c: Moved to... * call.cc: ...here. * class.c: Moved to... * class.cc: ...here. * constexpr.c: Moved to... * constexpr.cc: ...here. * cp-gimplify.c: Moved to... * cp-gimplify.cc: ...here. * cp-lang.c: Moved to... * cp-lang.cc: ...here. * cp-objcp-common.c: Moved to... * cp-objcp-common.cc: ...here. * cp-ubsan.c: Moved to... * cp-ubsan.cc: ...here. * cvt.c: Moved to... * cvt.cc: ...here. * cxx-pretty-print.c: Moved to... * cxx-pretty-print.cc: ...here. * decl.c: Moved to... * decl.cc: ...here. * decl2.c: Moved to... * decl2.cc: ...here. * dump.c: Moved to... * dump.cc: ...here. * error.c: Moved to... * error.cc: ...here. * except.c: Moved to... * except.cc: ...here. * expr.c: Moved to... * expr.cc: ...here. * friend.c: Moved to... * friend.cc: ...here. * g++spec.c: Moved to... * g++spec.cc: ...here. * init.c: Moved to... * init.cc: ...here. * lambda.c: Moved to... * lambda.cc: ...here. * lex.c: Moved to... * lex.cc: ...here. * mangle.c: Moved to... * mangle.cc: ...here. * method.c: Moved to... * method.cc: ...here. * name-lookup.c: Moved to... * name-lookup.cc: ...here. * optimize.c: Moved to... * optimize.cc: ...here. * parser.c: Moved to... * parser.cc: ...here. * pt.c: Moved to... * pt.cc: ...here. * ptree.c: Moved to... * ptree.cc: ...here. * rtti.c: Moved to... * rtti.cc: ...here. * search.c: Moved to... * search.cc: ...here. * semantics.c: Moved to... * semantics.cc: ...here. * tree.c: Moved to... * tree.cc: ...here. * typeck.c: Moved to... * typeck.cc: ...here. * typeck2.c: Moved to... * typeck2.cc: ...here. * vtable-class-hierarchy.c: Moved to... * vtable-class-hierarchy.cc: ...here. gcc/fortran/ChangeLog: * arith.c: Moved to... * arith.cc: ...here. * array.c: Moved to... * array.cc: ...here. * bbt.c: Moved to... * bbt.cc: ...here. * check.c: Moved to... * check.cc: ...here. * class.c: Moved to... * class.cc: ...here. * constructor.c: Moved to... * constructor.cc: ...here. * convert.c: Moved to... * convert.cc: ...here. * cpp.c: Moved to... * cpp.cc: ...here. * data.c: Moved to... * data.cc: ...here. * decl.c: Moved to... * decl.cc: ...here. * dependency.c: Moved to... * dependency.cc: ...here. * dump-parse-tree.c: Moved to... * dump-parse-tree.cc: ...here. * error.c: Moved to... * error.cc: ...here. * expr.c: Moved to... * expr.cc: ...here. * f95-lang.c: Moved to... * f95-lang.cc: ...here. * frontend-passes.c: Moved to... * frontend-passes.cc: ...here. * gfortranspec.c: Moved to... * gfortranspec.cc: ...here. * interface.c: Moved to... * interface.cc: ...here. * intrinsic.c: Moved to... * intrinsic.cc: ...here. * io.c: Moved to... * io.cc: ...here. * iresolve.c: Moved to... * iresolve.cc: ...here. * match.c: Moved to... * match.cc: ...here. * matchexp.c: Moved to... * matchexp.cc: ...here. * misc.c: Moved to... * misc.cc: ...here. * module.c: Moved to... * module.cc: ...here. * openmp.c: Moved to... * openmp.cc: ...here. * options.c: Moved to... * options.cc: ...here. * parse.c: Moved to... * parse.cc: ...here. * primary.c: Moved to... * primary.cc: ...here. * resolve.c: Moved to... * resolve.cc: ...here. * scanner.c: Moved to... * scanner.cc: ...here. * simplify.c: Moved to... * simplify.cc: ...here. * st.c: Moved to... * st.cc: ...here. * symbol.c: Moved to... * symbol.cc: ...here. * target-memory.c: Moved to... * target-memory.cc: ...here. * trans-array.c: Moved to... * trans-array.cc: ...here. * trans-common.c: Moved to... * trans-common.cc: ...here. * trans-const.c: Moved to... * trans-const.cc: ...here. * trans-decl.c: Moved to... * trans-decl.cc: ...here. * trans-expr.c: Moved to... * trans-expr.cc: ...here. * trans-intrinsic.c: Moved to... * trans-intrinsic.cc: ...here. * trans-io.c: Moved to... * trans-io.cc: ...here. * trans-openmp.c: Moved to... * trans-openmp.cc: ...here. * trans-stmt.c: Moved to... * trans-stmt.cc: ...here. * trans-types.c: Moved to... * trans-types.cc: ...here. * trans.c: Moved to... * trans.cc: ...here. gcc/go/ChangeLog: * go-backend.c: Moved to... * go-backend.cc: ...here. * go-lang.c: Moved to... * go-lang.cc: ...here. * gospec.c: Moved to... * gospec.cc: ...here. gcc/jit/ChangeLog: * dummy-frontend.c: Moved to... * dummy-frontend.cc: ...here. * jit-builtins.c: Moved to... * jit-builtins.cc: ...here. * jit-logging.c: Moved to... * jit-logging.cc: ...here. * jit-playback.c: Moved to... * jit-playback.cc: ...here. * jit-recording.c: Moved to... * jit-recording.cc: ...here. * jit-result.c: Moved to... * jit-result.cc: ...here. * jit-spec.c: Moved to... * jit-spec.cc: ...here. * jit-tempdir.c: Moved to... * jit-tempdir.cc: ...here. * jit-w32.c: Moved to... * jit-w32.cc: ...here. * libgccjit.c: Moved to... * libgccjit.cc: ...here. gcc/lto/ChangeLog: * common.c: Moved to... * common.cc: ...here. * lto-common.c: Moved to... * lto-common.cc: ...here. * lto-dump.c: Moved to... * lto-dump.cc: ...here. * lto-lang.c: Moved to... * lto-lang.cc: ...here. * lto-object.c: Moved to... * lto-object.cc: ...here. * lto-partition.c: Moved to... * lto-partition.cc: ...here. * lto-symtab.c: Moved to... * lto-symtab.cc: ...here. * lto.c: Moved to... * lto.cc: ...here. gcc/objc/ChangeLog: * objc-act.c: Moved to... * objc-act.cc: ...here. * objc-encoding.c: Moved to... * objc-encoding.cc: ...here. * objc-gnu-runtime-abi-01.c: Moved to... * objc-gnu-runtime-abi-01.cc: ...here. * objc-lang.c: Moved to... * objc-lang.cc: ...here. * objc-map.c: Moved to... * objc-map.cc: ...here. * objc-next-runtime-abi-01.c: Moved to... * objc-next-runtime-abi-01.cc: ...here. * objc-next-runtime-abi-02.c: Moved to... * objc-next-runtime-abi-02.cc: ...here. * objc-runtime-shared-support.c: Moved to... * objc-runtime-shared-support.cc: ...here. gcc/objcp/ChangeLog: * objcp-decl.c: Moved to... * objcp-decl.cc: ...here. * objcp-lang.c: Moved to... * objcp-lang.cc: ...here. libcpp/ChangeLog: * charset.c: Moved to... * charset.cc: ...here. * directives.c: Moved to... * directives.cc: ...here. * errors.c: Moved to... * errors.cc: ...here. * expr.c: Moved to... * expr.cc: ...here. * files.c: Moved to... * files.cc: ...here. * identifiers.c: Moved to... * identifiers.cc: ...here. * init.c: Moved to... * init.cc: ...here. * lex.c: Moved to... * lex.cc: ...here. * line-map.c: Moved to... * line-map.cc: ...here. * macro.c: Moved to... * macro.cc: ...here. * makeucnid.c: Moved to... * makeucnid.cc: ...here. * mkdeps.c: Moved to... * mkdeps.cc: ...here. * pch.c: Moved to... * pch.cc: ...here. * symtab.c: Moved to... * symtab.cc: ...here. * traditional.c: Moved to... * traditional.cc: ...here.
Diffstat (limited to 'gcc/tree-ssa-loop-manip.c')
-rw-r--r--gcc/tree-ssa-loop-manip.c1677
1 files changed, 0 insertions, 1677 deletions
diff --git a/gcc/tree-ssa-loop-manip.c b/gcc/tree-ssa-loop-manip.c
deleted file mode 100644
index c7600f9..0000000
--- a/gcc/tree-ssa-loop-manip.c
+++ /dev/null
@@ -1,1677 +0,0 @@
-/* High-level loop manipulation functions.
- Copyright (C) 2004-2022 Free Software Foundation, Inc.
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 3, or (at your option) any
-later version.
-
-GCC is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING3. If not see
-<http://www.gnu.org/licenses/>. */
-
-#include "config.h"
-#include "system.h"
-#include "coretypes.h"
-#include "backend.h"
-#include "tree.h"
-#include "gimple.h"
-#include "cfghooks.h"
-#include "tree-pass.h" /* ??? for TODO_update_ssa but this isn't a pass. */
-#include "ssa.h"
-#include "gimple-pretty-print.h"
-#include "fold-const.h"
-#include "cfganal.h"
-#include "gimplify.h"
-#include "gimple-iterator.h"
-#include "gimplify-me.h"
-#include "tree-cfg.h"
-#include "tree-ssa-loop-ivopts.h"
-#include "tree-ssa-loop-manip.h"
-#include "tree-ssa-loop-niter.h"
-#include "tree-ssa-loop.h"
-#include "tree-into-ssa.h"
-#include "tree-ssa.h"
-#include "cfgloop.h"
-#include "tree-scalar-evolution.h"
-#include "tree-inline.h"
-
-/* All bitmaps for rewriting into loop-closed SSA go on this obstack,
- so that we can free them all at once. */
-static bitmap_obstack loop_renamer_obstack;
-
-/* Creates an induction variable with value BASE + STEP * iteration in LOOP.
- It is expected that neither BASE nor STEP are shared with other expressions
- (unless the sharing rules allow this). Use VAR as a base var_decl for it
- (if NULL, a new temporary will be created). The increment will occur at
- INCR_POS (after it if AFTER is true, before it otherwise). INCR_POS and
- AFTER can be computed using standard_iv_increment_position. The ssa versions
- of the variable before and after increment will be stored in VAR_BEFORE and
- VAR_AFTER (unless they are NULL). */
-
-void
-create_iv (tree base, tree step, tree var, class loop *loop,
- gimple_stmt_iterator *incr_pos, bool after,
- tree *var_before, tree *var_after)
-{
- gassign *stmt;
- gphi *phi;
- tree initial, step1;
- gimple_seq stmts;
- tree vb, va;
- enum tree_code incr_op = PLUS_EXPR;
- edge pe = loop_preheader_edge (loop);
-
- if (var != NULL_TREE)
- {
- vb = make_ssa_name (var);
- va = make_ssa_name (var);
- }
- else
- {
- vb = make_temp_ssa_name (TREE_TYPE (base), NULL, "ivtmp");
- va = make_temp_ssa_name (TREE_TYPE (base), NULL, "ivtmp");
- }
- if (var_before)
- *var_before = vb;
- if (var_after)
- *var_after = va;
-
- /* For easier readability of the created code, produce MINUS_EXPRs
- when suitable. */
- if (TREE_CODE (step) == INTEGER_CST)
- {
- if (TYPE_UNSIGNED (TREE_TYPE (step)))
- {
- step1 = fold_build1 (NEGATE_EXPR, TREE_TYPE (step), step);
- if (tree_int_cst_lt (step1, step))
- {
- incr_op = MINUS_EXPR;
- step = step1;
- }
- }
- else
- {
- bool ovf;
-
- if (!tree_expr_nonnegative_warnv_p (step, &ovf)
- && may_negate_without_overflow_p (step))
- {
- incr_op = MINUS_EXPR;
- step = fold_build1 (NEGATE_EXPR, TREE_TYPE (step), step);
- }
- }
- }
- if (POINTER_TYPE_P (TREE_TYPE (base)))
- {
- if (TREE_CODE (base) == ADDR_EXPR)
- mark_addressable (TREE_OPERAND (base, 0));
- step = convert_to_ptrofftype (step);
- if (incr_op == MINUS_EXPR)
- step = fold_build1 (NEGATE_EXPR, TREE_TYPE (step), step);
- incr_op = POINTER_PLUS_EXPR;
- }
- /* Gimplify the step if necessary. We put the computations in front of the
- loop (i.e. the step should be loop invariant). */
- step = force_gimple_operand (step, &stmts, true, NULL_TREE);
- if (stmts)
- gsi_insert_seq_on_edge_immediate (pe, stmts);
-
- stmt = gimple_build_assign (va, incr_op, vb, step);
- /* Prevent the increment from inheriting a bogus location if it is not put
- immediately after a statement whose location is known. */
- if (after)
- {
- if (gsi_end_p (*incr_pos)
- || (is_gimple_debug (gsi_stmt (*incr_pos))
- && gsi_bb (*incr_pos)
- && gsi_end_p (gsi_last_nondebug_bb (gsi_bb (*incr_pos)))))
- {
- edge e = single_succ_edge (gsi_bb (*incr_pos));
- gimple_set_location (stmt, e->goto_locus);
- }
- gsi_insert_after (incr_pos, stmt, GSI_NEW_STMT);
- }
- else
- {
- gimple_stmt_iterator gsi = *incr_pos;
- if (!gsi_end_p (gsi) && is_gimple_debug (gsi_stmt (gsi)))
- gsi_next_nondebug (&gsi);
- if (!gsi_end_p (gsi))
- gimple_set_location (stmt, gimple_location (gsi_stmt (gsi)));
- gsi_insert_before (incr_pos, stmt, GSI_NEW_STMT);
- }
-
- initial = force_gimple_operand (base, &stmts, true, var);
- if (stmts)
- gsi_insert_seq_on_edge_immediate (pe, stmts);
-
- phi = create_phi_node (vb, loop->header);
- add_phi_arg (phi, initial, loop_preheader_edge (loop), UNKNOWN_LOCATION);
- add_phi_arg (phi, va, loop_latch_edge (loop), UNKNOWN_LOCATION);
-}
-
-/* Return the innermost superloop LOOP of USE_LOOP that is a superloop of
- both DEF_LOOP and USE_LOOP. */
-
-static inline class loop *
-find_sibling_superloop (class loop *use_loop, class loop *def_loop)
-{
- unsigned ud = loop_depth (use_loop);
- unsigned dd = loop_depth (def_loop);
- gcc_assert (ud > 0 && dd > 0);
- if (ud > dd)
- use_loop = superloop_at_depth (use_loop, dd);
- if (ud < dd)
- def_loop = superloop_at_depth (def_loop, ud);
- while (loop_outer (use_loop) != loop_outer (def_loop))
- {
- use_loop = loop_outer (use_loop);
- def_loop = loop_outer (def_loop);
- gcc_assert (use_loop && def_loop);
- }
- return use_loop;
-}
-
-/* DEF_BB is a basic block containing a DEF that needs rewriting into
- loop-closed SSA form. USE_BLOCKS is the set of basic blocks containing
- uses of DEF that "escape" from the loop containing DEF_BB (i.e. blocks in
- USE_BLOCKS are dominated by DEF_BB but not in the loop father of DEF_B).
- ALL_EXITS[I] is the set of all basic blocks that exit loop I.
-
- Compute the subset of LOOP_EXITS that exit the loop containing DEF_BB
- or one of its loop fathers, in which DEF is live. This set is returned
- in the bitmap LIVE_EXITS.
-
- Instead of computing the complete livein set of the def, we use the loop
- nesting tree as a form of poor man's structure analysis. This greatly
- speeds up the analysis, which is important because this function may be
- called on all SSA names that need rewriting, one at a time. */
-
-static void
-compute_live_loop_exits (bitmap live_exits, bitmap use_blocks,
- bitmap *loop_exits, basic_block def_bb)
-{
- unsigned i;
- bitmap_iterator bi;
- class loop *def_loop = def_bb->loop_father;
- unsigned def_loop_depth = loop_depth (def_loop);
- bitmap def_loop_exits;
-
- /* Normally the work list size is bounded by the number of basic
- blocks in the largest loop. We don't know this number, but we
- can be fairly sure that it will be relatively small. */
- auto_vec<basic_block> worklist (MAX (8, n_basic_blocks_for_fn (cfun) / 128));
-
- EXECUTE_IF_SET_IN_BITMAP (use_blocks, 0, i, bi)
- {
- basic_block use_bb = BASIC_BLOCK_FOR_FN (cfun, i);
- class loop *use_loop = use_bb->loop_father;
- gcc_checking_assert (def_loop != use_loop
- && ! flow_loop_nested_p (def_loop, use_loop));
- if (! flow_loop_nested_p (use_loop, def_loop))
- use_bb = find_sibling_superloop (use_loop, def_loop)->header;
- if (bitmap_set_bit (live_exits, use_bb->index))
- worklist.safe_push (use_bb);
- }
-
- /* Iterate until the worklist is empty. */
- while (! worklist.is_empty ())
- {
- edge e;
- edge_iterator ei;
-
- /* Pull a block off the worklist. */
- basic_block bb = worklist.pop ();
-
- /* Make sure we have at least enough room in the work list
- for all predecessors of this block. */
- worklist.reserve (EDGE_COUNT (bb->preds));
-
- /* For each predecessor block. */
- FOR_EACH_EDGE (e, ei, bb->preds)
- {
- basic_block pred = e->src;
- class loop *pred_loop = pred->loop_father;
- unsigned pred_loop_depth = loop_depth (pred_loop);
- bool pred_visited;
-
- /* We should have met DEF_BB along the way. */
- gcc_assert (pred != ENTRY_BLOCK_PTR_FOR_FN (cfun));
-
- if (pred_loop_depth >= def_loop_depth)
- {
- if (pred_loop_depth > def_loop_depth)
- pred_loop = superloop_at_depth (pred_loop, def_loop_depth);
- /* If we've reached DEF_LOOP, our train ends here. */
- if (pred_loop == def_loop)
- continue;
- }
- else if (! flow_loop_nested_p (pred_loop, def_loop))
- pred = find_sibling_superloop (pred_loop, def_loop)->header;
-
- /* Add PRED to the LIVEIN set. PRED_VISITED is true if
- we had already added PRED to LIVEIN before. */
- pred_visited = !bitmap_set_bit (live_exits, pred->index);
-
- /* If we have visited PRED before, don't add it to the worklist.
- If BB dominates PRED, then we're probably looking at a loop.
- We're only interested in looking up in the dominance tree
- because DEF_BB dominates all the uses. */
- if (pred_visited || dominated_by_p (CDI_DOMINATORS, pred, bb))
- continue;
-
- worklist.quick_push (pred);
- }
- }
-
- def_loop_exits = BITMAP_ALLOC (&loop_renamer_obstack);
- for (class loop *loop = def_loop;
- loop != current_loops->tree_root;
- loop = loop_outer (loop))
- bitmap_ior_into (def_loop_exits, loop_exits[loop->num]);
- bitmap_and_into (live_exits, def_loop_exits);
- BITMAP_FREE (def_loop_exits);
-}
-
-/* Add a loop-closing PHI for VAR in basic block EXIT. */
-
-static void
-add_exit_phi (basic_block exit, tree var)
-{
- gphi *phi;
- edge e;
- edge_iterator ei;
-
- /* Check that at least one of the edges entering the EXIT block exits
- the loop, or a superloop of that loop, that VAR is defined in. */
- if (flag_checking)
- {
- gimple *def_stmt = SSA_NAME_DEF_STMT (var);
- basic_block def_bb = gimple_bb (def_stmt);
- FOR_EACH_EDGE (e, ei, exit->preds)
- {
- class loop *aloop = find_common_loop (def_bb->loop_father,
- e->src->loop_father);
- if (!flow_bb_inside_loop_p (aloop, e->dest))
- break;
- }
- gcc_assert (e);
- }
-
- phi = create_phi_node (NULL_TREE, exit);
- create_new_def_for (var, phi, gimple_phi_result_ptr (phi));
- FOR_EACH_EDGE (e, ei, exit->preds)
- add_phi_arg (phi, var, e, UNKNOWN_LOCATION);
-
- if (dump_file && (dump_flags & TDF_DETAILS))
- {
- fprintf (dump_file, ";; Created LCSSA PHI: ");
- print_gimple_stmt (dump_file, phi, 0, dump_flags);
- }
-}
-
-/* Add exit phis for VAR that is used in LIVEIN.
- Exits of the loops are stored in LOOP_EXITS. */
-
-static void
-add_exit_phis_var (tree var, bitmap use_blocks, bitmap *loop_exits)
-{
- unsigned index;
- bitmap_iterator bi;
- basic_block def_bb = gimple_bb (SSA_NAME_DEF_STMT (var));
- bitmap live_exits = BITMAP_ALLOC (&loop_renamer_obstack);
-
- gcc_checking_assert (! bitmap_bit_p (use_blocks, def_bb->index));
-
- compute_live_loop_exits (live_exits, use_blocks, loop_exits, def_bb);
-
- EXECUTE_IF_SET_IN_BITMAP (live_exits, 0, index, bi)
- {
- add_exit_phi (BASIC_BLOCK_FOR_FN (cfun, index), var);
- }
-
- BITMAP_FREE (live_exits);
-}
-
-/* Add exit phis for the names marked in NAMES_TO_RENAME.
- Exits of the loops are stored in EXITS. Sets of blocks where the ssa
- names are used are stored in USE_BLOCKS. */
-
-static void
-add_exit_phis (bitmap names_to_rename, bitmap *use_blocks, bitmap *loop_exits)
-{
- unsigned i;
- bitmap_iterator bi;
-
- EXECUTE_IF_SET_IN_BITMAP (names_to_rename, 0, i, bi)
- {
- add_exit_phis_var (ssa_name (i), use_blocks[i], loop_exits);
- }
-}
-
-/* Fill the array of bitmaps LOOP_EXITS with all loop exit edge targets. */
-
-static void
-get_loops_exits (bitmap *loop_exits)
-{
- unsigned j;
- edge e;
-
- for (auto loop : loops_list (cfun, 0))
- {
- auto_vec<edge> exit_edges = get_loop_exit_edges (loop);
- loop_exits[loop->num] = BITMAP_ALLOC (&loop_renamer_obstack);
- FOR_EACH_VEC_ELT (exit_edges, j, e)
- bitmap_set_bit (loop_exits[loop->num], e->dest->index);
- }
-}
-
-/* For USE in BB, if it is used outside of the loop it is defined in,
- mark it for rewrite. Record basic block BB where it is used
- to USE_BLOCKS. Record the ssa name index to NEED_PHIS bitmap.
- Note that for USEs in phis, BB should be the src of the edge corresponding to
- the use, rather than the bb containing the phi. */
-
-static void
-find_uses_to_rename_use (basic_block bb, tree use, bitmap *use_blocks,
- bitmap need_phis)
-{
- unsigned ver;
- basic_block def_bb;
- class loop *def_loop;
-
- if (TREE_CODE (use) != SSA_NAME)
- return;
-
- ver = SSA_NAME_VERSION (use);
- def_bb = gimple_bb (SSA_NAME_DEF_STMT (use));
- if (!def_bb)
- return;
- def_loop = def_bb->loop_father;
-
- /* If the definition is not inside a loop, it is not interesting. */
- if (!loop_outer (def_loop))
- return;
-
- /* If the use is not outside of the loop it is defined in, it is not
- interesting. */
- if (flow_bb_inside_loop_p (def_loop, bb))
- return;
-
- /* If we're seeing VER for the first time, we still have to allocate
- a bitmap for its uses. */
- if (bitmap_set_bit (need_phis, ver))
- use_blocks[ver] = BITMAP_ALLOC (&loop_renamer_obstack);
- bitmap_set_bit (use_blocks[ver], bb->index);
-}
-
-/* For uses matching USE_FLAGS in STMT, mark names that are used outside of the
- loop they are defined to rewrite. Record the set of blocks in which the ssa
- names are used to USE_BLOCKS, and the ssa names themselves to NEED_PHIS. */
-
-static void
-find_uses_to_rename_stmt (gimple *stmt, bitmap *use_blocks, bitmap need_phis,
- int use_flags)
-{
- ssa_op_iter iter;
- tree var;
- basic_block bb = gimple_bb (stmt);
-
- if (is_gimple_debug (stmt))
- return;
-
- /* FOR_EACH_SSA_TREE_OPERAND iterator does not allows SSA_OP_VIRTUAL_USES
- only. */
- if (use_flags == SSA_OP_VIRTUAL_USES)
- {
- tree vuse = gimple_vuse (stmt);
- if (vuse != NULL_TREE)
- find_uses_to_rename_use (bb, gimple_vuse (stmt), use_blocks, need_phis);
- }
- else
- FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, use_flags)
- find_uses_to_rename_use (bb, var, use_blocks, need_phis);
-}
-
-/* Marks names matching USE_FLAGS that are used in BB and outside of the loop
- they are defined in for rewrite. Records the set of blocks in which the ssa
- names are used to USE_BLOCKS. Record the SSA names that will
- need exit PHIs in NEED_PHIS. */
-
-static void
-find_uses_to_rename_bb (basic_block bb, bitmap *use_blocks, bitmap need_phis,
- int use_flags)
-{
- edge e;
- edge_iterator ei;
- bool do_virtuals = (use_flags & SSA_OP_VIRTUAL_USES) != 0;
- bool do_nonvirtuals = (use_flags & SSA_OP_USE) != 0;
-
- FOR_EACH_EDGE (e, ei, bb->succs)
- for (gphi_iterator bsi = gsi_start_phis (e->dest); !gsi_end_p (bsi);
- gsi_next (&bsi))
- {
- gphi *phi = bsi.phi ();
- bool virtual_p = virtual_operand_p (gimple_phi_result (phi));
- if ((virtual_p && do_virtuals)
- || (!virtual_p && do_nonvirtuals))
- find_uses_to_rename_use (bb, PHI_ARG_DEF_FROM_EDGE (phi, e),
- use_blocks, need_phis);
- }
-
- for (gimple_stmt_iterator bsi = gsi_start_bb (bb); !gsi_end_p (bsi);
- gsi_next (&bsi))
- find_uses_to_rename_stmt (gsi_stmt (bsi), use_blocks, need_phis,
- use_flags);
-}
-
-/* Marks names matching USE_FLAGS that are used outside of the loop they are
- defined in for rewrite. Records the set of blocks in which the ssa names are
- used to USE_BLOCKS. Record the SSA names that will need exit PHIs in
- NEED_PHIS. If CHANGED_BBS is not NULL, scan only blocks in this set. */
-
-static void
-find_uses_to_rename (bitmap changed_bbs, bitmap *use_blocks, bitmap need_phis,
- int use_flags)
-{
- basic_block bb;
- unsigned index;
- bitmap_iterator bi;
-
- if (changed_bbs)
- EXECUTE_IF_SET_IN_BITMAP (changed_bbs, 0, index, bi)
- {
- bb = BASIC_BLOCK_FOR_FN (cfun, index);
- if (bb)
- find_uses_to_rename_bb (bb, use_blocks, need_phis, use_flags);
- }
- else
- FOR_EACH_BB_FN (bb, cfun)
- find_uses_to_rename_bb (bb, use_blocks, need_phis, use_flags);
-}
-
-/* Mark uses of DEF that are used outside of the loop they are defined in for
- rewrite. Record the set of blocks in which the ssa names are used to
- USE_BLOCKS. Record the SSA names that will need exit PHIs in NEED_PHIS. */
-
-static void
-find_uses_to_rename_def (tree def, bitmap *use_blocks, bitmap need_phis)
-{
- gimple *use_stmt;
- imm_use_iterator imm_iter;
-
- FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, def)
- {
- if (is_gimple_debug (use_stmt))
- continue;
-
- basic_block use_bb = gimple_bb (use_stmt);
-
- use_operand_p use_p;
- FOR_EACH_IMM_USE_ON_STMT (use_p, imm_iter)
- {
- if (gimple_code (use_stmt) == GIMPLE_PHI)
- {
- edge e = gimple_phi_arg_edge (as_a <gphi *> (use_stmt),
- PHI_ARG_INDEX_FROM_USE (use_p));
- use_bb = e->src;
- }
- find_uses_to_rename_use (use_bb, USE_FROM_PTR (use_p), use_blocks,
- need_phis);
- }
- }
-}
-
-/* Marks names matching USE_FLAGS that are defined in LOOP and used outside of
- it for rewrite. Records the set of blocks in which the ssa names are used to
- USE_BLOCKS. Record the SSA names that will need exit PHIs in NEED_PHIS. */
-
-static void
-find_uses_to_rename_in_loop (class loop *loop, bitmap *use_blocks,
- bitmap need_phis, int use_flags)
-{
- bool do_virtuals = (use_flags & SSA_OP_VIRTUAL_USES) != 0;
- bool do_nonvirtuals = (use_flags & SSA_OP_USE) != 0;
- int def_flags = ((do_virtuals ? SSA_OP_VIRTUAL_DEFS : 0)
- | (do_nonvirtuals ? SSA_OP_DEF : 0));
-
-
- basic_block *bbs = get_loop_body (loop);
-
- for (unsigned int i = 0; i < loop->num_nodes; i++)
- {
- basic_block bb = bbs[i];
-
- for (gphi_iterator bsi = gsi_start_phis (bb); !gsi_end_p (bsi);
- gsi_next (&bsi))
- {
- gphi *phi = bsi.phi ();
- tree res = gimple_phi_result (phi);
- bool virtual_p = virtual_operand_p (res);
- if ((virtual_p && do_virtuals)
- || (!virtual_p && do_nonvirtuals))
- find_uses_to_rename_def (res, use_blocks, need_phis);
- }
-
- for (gimple_stmt_iterator bsi = gsi_start_bb (bb); !gsi_end_p (bsi);
- gsi_next (&bsi))
- {
- gimple *stmt = gsi_stmt (bsi);
- /* FOR_EACH_SSA_TREE_OPERAND iterator does not allows
- SSA_OP_VIRTUAL_DEFS only. */
- if (def_flags == SSA_OP_VIRTUAL_DEFS)
- {
- tree vdef = gimple_vdef (stmt);
- if (vdef != NULL)
- find_uses_to_rename_def (vdef, use_blocks, need_phis);
- }
- else
- {
- tree var;
- ssa_op_iter iter;
- FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, def_flags)
- find_uses_to_rename_def (var, use_blocks, need_phis);
- }
- }
- }
-
- XDELETEVEC (bbs);
-}
-
-/* Rewrites the program into a loop closed ssa form -- i.e. inserts extra
- phi nodes to ensure that no variable is used outside the loop it is
- defined in.
-
- This strengthening of the basic ssa form has several advantages:
-
- 1) Updating it during unrolling/peeling/versioning is trivial, since
- we do not need to care about the uses outside of the loop.
- The same applies to virtual operands which are also rewritten into
- loop closed SSA form. Note that virtual operands are always live
- until function exit.
- 2) The behavior of all uses of an induction variable is the same.
- Without this, you need to distinguish the case when the variable
- is used outside of the loop it is defined in, for example
-
- for (i = 0; i < 100; i++)
- {
- for (j = 0; j < 100; j++)
- {
- k = i + j;
- use1 (k);
- }
- use2 (k);
- }
-
- Looking from the outer loop with the normal SSA form, the first use of k
- is not well-behaved, while the second one is an induction variable with
- base 99 and step 1.
-
- If LOOP is non-null, only rewrite uses that have defs in LOOP. Otherwise,
- if CHANGED_BBS is not NULL, we look for uses outside loops only in the
- basic blocks in this set.
-
- USE_FLAGS allows us to specify whether we want virtual, non-virtual or
- both variables rewritten.
-
- UPDATE_FLAG is used in the call to update_ssa. See
- TODO_update_ssa* for documentation. */
-
-void
-rewrite_into_loop_closed_ssa_1 (bitmap changed_bbs, unsigned update_flag,
- int use_flags, class loop *loop)
-{
- bitmap *use_blocks;
- bitmap names_to_rename;
-
- loops_state_set (LOOP_CLOSED_SSA);
- if (number_of_loops (cfun) <= 1)
- return;
-
- /* If the pass has caused the SSA form to be out-of-date, update it
- now. */
- if (update_flag != 0)
- update_ssa (update_flag);
- else if (flag_checking)
- verify_ssa (true, true);
-
- bitmap_obstack_initialize (&loop_renamer_obstack);
-
- names_to_rename = BITMAP_ALLOC (&loop_renamer_obstack);
-
- /* Uses of names to rename. We don't have to initialize this array,
- because we know that we will only have entries for the SSA names
- in NAMES_TO_RENAME. */
- use_blocks = XNEWVEC (bitmap, num_ssa_names);
-
- if (loop != NULL)
- {
- gcc_assert (changed_bbs == NULL);
- find_uses_to_rename_in_loop (loop, use_blocks, names_to_rename,
- use_flags);
- }
- else
- {
- gcc_assert (loop == NULL);
- find_uses_to_rename (changed_bbs, use_blocks, names_to_rename, use_flags);
- }
-
- if (!bitmap_empty_p (names_to_rename))
- {
- /* An array of bitmaps where LOOP_EXITS[I] is the set of basic blocks
- that are the destination of an edge exiting loop number I. */
- bitmap *loop_exits = XNEWVEC (bitmap, number_of_loops (cfun));
- get_loops_exits (loop_exits);
-
- /* Add the PHI nodes on exits of the loops for the names we need to
- rewrite. */
- add_exit_phis (names_to_rename, use_blocks, loop_exits);
-
- free (loop_exits);
-
- /* Fix up all the names found to be used outside their original
- loops. */
- update_ssa (TODO_update_ssa);
- }
-
- bitmap_obstack_release (&loop_renamer_obstack);
- free (use_blocks);
-}
-
-/* Rewrites the non-virtual defs and uses into a loop closed ssa form. If
- CHANGED_BBS is not NULL, we look for uses outside loops only in the basic
- blocks in this set. UPDATE_FLAG is used in the call to update_ssa. See
- TODO_update_ssa* for documentation. */
-
-void
-rewrite_into_loop_closed_ssa (bitmap changed_bbs, unsigned update_flag)
-{
- rewrite_into_loop_closed_ssa_1 (changed_bbs, update_flag, SSA_OP_USE, NULL);
-}
-
-/* Rewrites virtual defs and uses with def in LOOP into loop closed ssa
- form. */
-
-void
-rewrite_virtuals_into_loop_closed_ssa (class loop *loop)
-{
- rewrite_into_loop_closed_ssa_1 (NULL, 0, SSA_OP_VIRTUAL_USES, loop);
-}
-
-/* Check invariants of the loop closed ssa form for the def in DEF_BB. */
-
-static void
-check_loop_closed_ssa_def (basic_block def_bb, tree def)
-{
- use_operand_p use_p;
- imm_use_iterator iterator;
- FOR_EACH_IMM_USE_FAST (use_p, iterator, def)
- {
- if (is_gimple_debug (USE_STMT (use_p)))
- continue;
-
- basic_block use_bb = gimple_bb (USE_STMT (use_p));
- if (is_a <gphi *> (USE_STMT (use_p)))
- use_bb = EDGE_PRED (use_bb, PHI_ARG_INDEX_FROM_USE (use_p))->src;
-
- gcc_assert (flow_bb_inside_loop_p (def_bb->loop_father, use_bb));
- }
-}
-
-/* Checks invariants of loop closed ssa form in BB. */
-
-static void
-check_loop_closed_ssa_bb (basic_block bb)
-{
- for (gphi_iterator bsi = gsi_start_phis (bb); !gsi_end_p (bsi);
- gsi_next (&bsi))
- {
- gphi *phi = bsi.phi ();
-
- if (!virtual_operand_p (PHI_RESULT (phi)))
- check_loop_closed_ssa_def (bb, PHI_RESULT (phi));
- }
-
- for (gimple_stmt_iterator bsi = gsi_start_nondebug_bb (bb); !gsi_end_p (bsi);
- gsi_next_nondebug (&bsi))
- {
- ssa_op_iter iter;
- tree var;
- gimple *stmt = gsi_stmt (bsi);
-
- FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, SSA_OP_DEF)
- check_loop_closed_ssa_def (bb, var);
- }
-}
-
-/* Checks that invariants of the loop closed ssa form are preserved.
- Call verify_ssa when VERIFY_SSA_P is true. Note all loops are checked
- if LOOP is NULL, otherwise, only LOOP is checked. */
-
-DEBUG_FUNCTION void
-verify_loop_closed_ssa (bool verify_ssa_p, class loop *loop)
-{
- if (number_of_loops (cfun) <= 1)
- return;
-
- if (verify_ssa_p)
- verify_ssa (false, true);
-
- timevar_push (TV_VERIFY_LOOP_CLOSED);
-
- if (loop == NULL)
- {
- basic_block bb;
-
- FOR_EACH_BB_FN (bb, cfun)
- if (bb->loop_father && bb->loop_father->num > 0)
- check_loop_closed_ssa_bb (bb);
- }
- else
- {
- basic_block *bbs = get_loop_body (loop);
-
- for (unsigned i = 0; i < loop->num_nodes; ++i)
- check_loop_closed_ssa_bb (bbs[i]);
-
- free (bbs);
- }
-
- timevar_pop (TV_VERIFY_LOOP_CLOSED);
-}
-
-/* Split loop exit edge EXIT. The things are a bit complicated by a need to
- preserve the loop closed ssa form. If COPY_CONSTANTS_P is true then
- forwarder PHIs are also created for constant arguments.
- The newly created block is returned. */
-
-basic_block
-split_loop_exit_edge (edge exit, bool copy_constants_p)
-{
- basic_block dest = exit->dest;
- basic_block bb = split_edge (exit);
- gphi *phi, *new_phi;
- tree new_name, name;
- use_operand_p op_p;
- gphi_iterator psi;
- location_t locus;
-
- for (psi = gsi_start_phis (dest); !gsi_end_p (psi); gsi_next (&psi))
- {
- phi = psi.phi ();
- op_p = PHI_ARG_DEF_PTR_FROM_EDGE (phi, single_succ_edge (bb));
- locus = gimple_phi_arg_location_from_edge (phi, single_succ_edge (bb));
-
- name = USE_FROM_PTR (op_p);
-
- /* If the argument of the PHI node is a constant, we do not need
- to keep it inside loop. */
- if (TREE_CODE (name) != SSA_NAME
- && !copy_constants_p)
- continue;
-
- /* Otherwise create an auxiliary phi node that will copy the value
- of the SSA name out of the loop. */
- new_name = duplicate_ssa_name (PHI_RESULT (phi), NULL);
- new_phi = create_phi_node (new_name, bb);
- add_phi_arg (new_phi, name, exit, locus);
- SET_USE (op_p, new_name);
- }
-
- return bb;
-}
-
-/* Returns the basic block in that statements should be emitted for induction
- variables incremented at the end of the LOOP. */
-
-basic_block
-ip_end_pos (class loop *loop)
-{
- return loop->latch;
-}
-
-/* Returns the basic block in that statements should be emitted for induction
- variables incremented just before exit condition of a LOOP. */
-
-basic_block
-ip_normal_pos (class loop *loop)
-{
- gimple *last;
- basic_block bb;
- edge exit;
-
- if (!single_pred_p (loop->latch))
- return NULL;
-
- bb = single_pred (loop->latch);
- last = last_stmt (bb);
- if (!last
- || gimple_code (last) != GIMPLE_COND)
- return NULL;
-
- exit = EDGE_SUCC (bb, 0);
- if (exit->dest == loop->latch)
- exit = EDGE_SUCC (bb, 1);
-
- if (flow_bb_inside_loop_p (loop, exit->dest))
- return NULL;
-
- return bb;
-}
-
-/* Stores the standard position for induction variable increment in LOOP
- (just before the exit condition if it is available and latch block is empty,
- end of the latch block otherwise) to BSI. INSERT_AFTER is set to true if
- the increment should be inserted after *BSI. */
-
-void
-standard_iv_increment_position (class loop *loop, gimple_stmt_iterator *bsi,
- bool *insert_after)
-{
- basic_block bb = ip_normal_pos (loop), latch = ip_end_pos (loop);
- gimple *last = last_stmt (latch);
-
- if (!bb
- || (last && gimple_code (last) != GIMPLE_LABEL))
- {
- *bsi = gsi_last_bb (latch);
- *insert_after = true;
- }
- else
- {
- *bsi = gsi_last_bb (bb);
- *insert_after = false;
- }
-}
-
-/* Copies phi node arguments for duplicated blocks. The index of the first
- duplicated block is FIRST_NEW_BLOCK. */
-
-static void
-copy_phi_node_args (unsigned first_new_block)
-{
- unsigned i;
-
- for (i = first_new_block; i < (unsigned) last_basic_block_for_fn (cfun); i++)
- BASIC_BLOCK_FOR_FN (cfun, i)->flags |= BB_DUPLICATED;
-
- for (i = first_new_block; i < (unsigned) last_basic_block_for_fn (cfun); i++)
- add_phi_args_after_copy_bb (BASIC_BLOCK_FOR_FN (cfun, i));
-
- for (i = first_new_block; i < (unsigned) last_basic_block_for_fn (cfun); i++)
- BASIC_BLOCK_FOR_FN (cfun, i)->flags &= ~BB_DUPLICATED;
-}
-
-
-/* The same as cfgloopmanip.c:duplicate_loop_body_to_header_edge, but also
- updates the PHI nodes at start of the copied region. In order to
- achieve this, only loops whose exits all lead to the same location
- are handled.
-
- Notice that we do not completely update the SSA web after
- duplication. The caller is responsible for calling update_ssa
- after the loop has been duplicated. */
-
-bool
-gimple_duplicate_loop_body_to_header_edge (class loop *loop, edge e,
- unsigned int ndupl,
- sbitmap wont_exit, edge orig,
- vec<edge> *to_remove, int flags)
-{
- unsigned first_new_block;
-
- if (!loops_state_satisfies_p (LOOPS_HAVE_SIMPLE_LATCHES))
- return false;
- if (!loops_state_satisfies_p (LOOPS_HAVE_PREHEADERS))
- return false;
-
- first_new_block = last_basic_block_for_fn (cfun);
- if (!duplicate_loop_body_to_header_edge (loop, e, ndupl, wont_exit, orig,
- to_remove, flags))
- return false;
-
- /* Readd the removed phi args for e. */
- flush_pending_stmts (e);
-
- /* Copy the phi node arguments. */
- copy_phi_node_args (first_new_block);
-
- scev_reset ();
-
- return true;
-}
-
-/* Returns true if we can unroll LOOP FACTOR times. Number
- of iterations of the loop is returned in NITER. */
-
-bool
-can_unroll_loop_p (class loop *loop, unsigned factor,
- class tree_niter_desc *niter)
-{
- edge exit;
-
- /* Check whether unrolling is possible. We only want to unroll loops
- for that we are able to determine number of iterations. We also
- want to split the extra iterations of the loop from its end,
- therefore we require that the loop has precisely one
- exit. */
-
- exit = single_dom_exit (loop);
- if (!exit)
- return false;
-
- if (!number_of_iterations_exit (loop, exit, niter, false)
- || niter->cmp == ERROR_MARK
- /* Scalar evolutions analysis might have copy propagated
- the abnormal ssa names into these expressions, hence
- emitting the computations based on them during loop
- unrolling might create overlapping life ranges for
- them, and failures in out-of-ssa. */
- || contains_abnormal_ssa_name_p (niter->may_be_zero)
- || contains_abnormal_ssa_name_p (niter->control.base)
- || contains_abnormal_ssa_name_p (niter->control.step)
- || contains_abnormal_ssa_name_p (niter->bound))
- return false;
-
- /* And of course, we must be able to duplicate the loop. */
- if (!can_duplicate_loop_p (loop))
- return false;
-
- /* The final loop should be small enough. */
- if (tree_num_loop_insns (loop, &eni_size_weights) * factor
- > (unsigned) param_max_unrolled_insns)
- return false;
-
- return true;
-}
-
-/* Determines the conditions that control execution of LOOP unrolled FACTOR
- times. DESC is number of iterations of LOOP. ENTER_COND is set to
- condition that must be true if the main loop can be entered.
- If the loop does not always iterate an exact multiple of FACTOR times,
- EXIT_BASE, EXIT_STEP, EXIT_CMP and EXIT_BOUND are set to values describing
- how the exit from the unrolled loop should be controlled. Otherwise,
- the trees are set to null and EXIT_CMP is set to ERROR_MARK. */
-
-static void
-determine_exit_conditions (class loop *loop, class tree_niter_desc *desc,
- unsigned factor, tree *enter_cond,
- tree *exit_base, tree *exit_step,
- enum tree_code *exit_cmp, tree *exit_bound)
-{
- gimple_seq stmts;
- tree base = desc->control.base;
- tree step = desc->control.step;
- tree bound = desc->bound;
- tree type = TREE_TYPE (step);
- tree bigstep, delta;
- tree min = lower_bound_in_type (type, type);
- tree max = upper_bound_in_type (type, type);
- enum tree_code cmp = desc->cmp;
- tree cond = boolean_true_node, assum;
-
- /* For pointers, do the arithmetics in the type of step. */
- base = fold_convert (type, base);
- bound = fold_convert (type, bound);
-
- *enter_cond = boolean_false_node;
- *exit_base = NULL_TREE;
- *exit_step = NULL_TREE;
- *exit_cmp = ERROR_MARK;
- *exit_bound = NULL_TREE;
- gcc_assert (cmp != ERROR_MARK);
-
- /* We only need to be correct when we answer question
- "Do at least FACTOR more iterations remain?" in the unrolled loop.
- Thus, transforming BASE + STEP * i <> BOUND to
- BASE + STEP * i < BOUND is ok. */
- if (cmp == NE_EXPR)
- {
- if (tree_int_cst_sign_bit (step))
- cmp = GT_EXPR;
- else
- cmp = LT_EXPR;
- }
- else if (cmp == LT_EXPR)
- {
- gcc_assert (!tree_int_cst_sign_bit (step));
- }
- else if (cmp == GT_EXPR)
- {
- gcc_assert (tree_int_cst_sign_bit (step));
- }
- else
- gcc_unreachable ();
-
- /* The main body of the loop may be entered iff:
-
- 1) desc->may_be_zero is false.
- 2) it is possible to check that there are at least FACTOR iterations
- of the loop, i.e., BOUND - step * FACTOR does not overflow.
- 3) # of iterations is at least FACTOR */
-
- if (!integer_zerop (desc->may_be_zero))
- cond = fold_build2 (TRUTH_AND_EXPR, boolean_type_node,
- invert_truthvalue (desc->may_be_zero),
- cond);
-
- bigstep = fold_build2 (MULT_EXPR, type, step,
- build_int_cst_type (type, factor));
- delta = fold_build2 (MINUS_EXPR, type, bigstep, step);
- if (cmp == LT_EXPR)
- assum = fold_build2 (GE_EXPR, boolean_type_node,
- bound,
- fold_build2 (PLUS_EXPR, type, min, delta));
- else
- assum = fold_build2 (LE_EXPR, boolean_type_node,
- bound,
- fold_build2 (PLUS_EXPR, type, max, delta));
- cond = fold_build2 (TRUTH_AND_EXPR, boolean_type_node, assum, cond);
-
- bound = fold_build2 (MINUS_EXPR, type, bound, delta);
- assum = fold_build2 (cmp, boolean_type_node, base, bound);
- cond = fold_build2 (TRUTH_AND_EXPR, boolean_type_node, assum, cond);
-
- if (integer_nonzerop (cond)
- && integer_zerop (desc->may_be_zero))
- {
- /* Convert the latch count to an iteration count. */
- tree niter = fold_build2 (PLUS_EXPR, type, desc->niter,
- build_one_cst (type));
- if (multiple_of_p (type, niter, bigstep))
- return;
- }
-
- cond = force_gimple_operand (unshare_expr (cond), &stmts, false, NULL_TREE);
- if (stmts)
- gsi_insert_seq_on_edge_immediate (loop_preheader_edge (loop), stmts);
- /* cond now may be a gimple comparison, which would be OK, but also any
- other gimple rhs (say a && b). In this case we need to force it to
- operand. */
- if (!is_gimple_condexpr (cond))
- {
- cond = force_gimple_operand (cond, &stmts, true, NULL_TREE);
- if (stmts)
- gsi_insert_seq_on_edge_immediate (loop_preheader_edge (loop), stmts);
- }
- *enter_cond = cond;
-
- base = force_gimple_operand (unshare_expr (base), &stmts, true, NULL_TREE);
- if (stmts)
- gsi_insert_seq_on_edge_immediate (loop_preheader_edge (loop), stmts);
- bound = force_gimple_operand (unshare_expr (bound), &stmts, true, NULL_TREE);
- if (stmts)
- gsi_insert_seq_on_edge_immediate (loop_preheader_edge (loop), stmts);
-
- *exit_base = base;
- *exit_step = bigstep;
- *exit_cmp = cmp;
- *exit_bound = bound;
-}
-
-/* Scales the frequencies of all basic blocks in LOOP that are strictly
- dominated by BB by NUM/DEN. */
-
-static void
-scale_dominated_blocks_in_loop (class loop *loop, basic_block bb,
- profile_count num, profile_count den)
-{
- basic_block son;
-
- if (!den.nonzero_p () && !(num == profile_count::zero ()))
- return;
-
- for (son = first_dom_son (CDI_DOMINATORS, bb);
- son;
- son = next_dom_son (CDI_DOMINATORS, son))
- {
- if (!flow_bb_inside_loop_p (loop, son))
- continue;
- scale_bbs_frequencies_profile_count (&son, 1, num, den);
- scale_dominated_blocks_in_loop (loop, son, num, den);
- }
-}
-
-/* Return estimated niter for LOOP after unrolling by FACTOR times. */
-
-gcov_type
-niter_for_unrolled_loop (class loop *loop, unsigned factor)
-{
- gcc_assert (factor != 0);
- bool profile_p = false;
- gcov_type est_niter = expected_loop_iterations_unbounded (loop, &profile_p);
- /* Note that this is really CEIL (est_niter + 1, factor) - 1, where the
- "+ 1" converts latch iterations to loop iterations and the "- 1"
- converts back. */
- gcov_type new_est_niter = est_niter / factor;
-
- if (est_niter == -1)
- return -1;
-
- /* Without profile feedback, loops for which we do not know a better estimate
- are assumed to roll 10 times. When we unroll such loop, it appears to
- roll too little, and it may even seem to be cold. To avoid this, we
- ensure that the created loop appears to roll at least 5 times (but at
- most as many times as before unrolling). Don't do adjustment if profile
- feedback is present. */
- if (new_est_niter < 5 && !profile_p)
- {
- if (est_niter < 5)
- new_est_niter = est_niter;
- else
- new_est_niter = 5;
- }
-
- if (loop->any_upper_bound)
- {
- /* As above, this is really CEIL (upper_bound + 1, factor) - 1. */
- widest_int bound = wi::udiv_floor (loop->nb_iterations_upper_bound,
- factor);
- if (wi::ltu_p (bound, new_est_niter))
- new_est_niter = bound.to_uhwi ();
- }
-
- return new_est_niter;
-}
-
-/* Unroll LOOP FACTOR times. LOOP is known to have a single exit edge
- whose source block dominates the latch. DESC describes the number of
- iterations of LOOP.
-
- If N is number of iterations of the loop and MAY_BE_ZERO is the condition
- under that loop exits in the first iteration even if N != 0,
-
- while (1)
- {
- x = phi (init, next);
-
- pre;
- if (st)
- break;
- post;
- }
-
- becomes (with possibly the exit conditions formulated a bit differently,
- avoiding the need to create a new iv):
-
- if (MAY_BE_ZERO || N < FACTOR)
- goto rest;
-
- do
- {
- x = phi (init, next);
-
- pre;
- post;
- pre;
- post;
- ...
- pre;
- post;
- N -= FACTOR;
-
- } while (N >= FACTOR);
-
- rest:
- init' = phi (init, x);
-
- while (1)
- {
- x = phi (init', next);
-
- pre;
- if (st)
- break;
- post;
- }
-
- Before the loop is unrolled, TRANSFORM is called for it (only for the
- unrolled loop, but not for its versioned copy). DATA is passed to
- TRANSFORM. */
-
-/* Probability in % that the unrolled loop is entered. Just a guess. */
-#define PROB_UNROLLED_LOOP_ENTERED 90
-
-void
-tree_transform_and_unroll_loop (class loop *loop, unsigned factor,
- class tree_niter_desc *desc,
- transform_callback transform,
- void *data)
-{
- gcov_type new_est_niter = niter_for_unrolled_loop (loop, factor);
- unsigned irr = loop_preheader_edge (loop)->flags & EDGE_IRREDUCIBLE_LOOP;
-
- enum tree_code exit_cmp;
- tree enter_main_cond, exit_base, exit_step, exit_bound;
- determine_exit_conditions (loop, desc, factor,
- &enter_main_cond, &exit_base, &exit_step,
- &exit_cmp, &exit_bound);
- bool single_loop_p = !exit_base;
-
- /* Let us assume that the unrolled loop is quite likely to be entered. */
- profile_probability prob_entry;
- if (integer_nonzerop (enter_main_cond))
- prob_entry = profile_probability::always ();
- else
- prob_entry = profile_probability::guessed_always ()
- .apply_scale (PROB_UNROLLED_LOOP_ENTERED, 100);
-
- gcond *exit_if = nullptr;
- class loop *new_loop = nullptr;
- edge new_exit;
- if (!single_loop_p)
- {
- edge exit = single_dom_exit (loop);
-
- /* The values for scales should keep profile consistent, and somewhat
- close to correct.
-
- TODO: The current value of SCALE_REST makes it appear that the loop
- that is created by splitting the remaining iterations of the unrolled
- loop is executed the same number of times as the original loop, and
- with the same frequencies, which is obviously wrong. This does not
- appear to cause problems, so we do not bother with fixing it for now.
- To make the profile correct, we would need to change the probability
- of the exit edge of the loop, and recompute the distribution of
- frequencies in its body because of this change (scale the frequencies
- of blocks before and after the exit by appropriate factors). */
- profile_probability scale_unrolled = prob_entry;
- new_loop = loop_version (loop, enter_main_cond, NULL, prob_entry,
- prob_entry.invert (), scale_unrolled,
- profile_probability::guessed_always (),
- true);
- gcc_assert (new_loop != NULL);
- update_ssa (TODO_update_ssa);
-
- /* Prepare the cfg and update the phi nodes. Move the loop exit to the
- loop latch (and make its condition dummy, for the moment). */
- basic_block rest = loop_preheader_edge (new_loop)->src;
- edge precond_edge = single_pred_edge (rest);
- split_edge (loop_latch_edge (loop));
- basic_block exit_bb = single_pred (loop->latch);
-
- /* Since the exit edge will be removed, the frequency of all the blocks
- in the loop that are dominated by it must be scaled by
- 1 / (1 - exit->probability). */
- if (exit->probability.initialized_p ())
- scale_dominated_blocks_in_loop (loop, exit->src,
- /* We are scaling up here so
- probability does not fit. */
- loop->header->count,
- loop->header->count
- - loop->header->count.apply_probability
- (exit->probability));
-
- gimple_stmt_iterator bsi = gsi_last_bb (exit_bb);
- exit_if = gimple_build_cond (EQ_EXPR, integer_zero_node,
- integer_zero_node,
- NULL_TREE, NULL_TREE);
-
- gsi_insert_after (&bsi, exit_if, GSI_NEW_STMT);
- new_exit = make_edge (exit_bb, rest, EDGE_FALSE_VALUE | irr);
- rescan_loop_exit (new_exit, true, false);
-
- /* Set the probability of new exit to the same of the old one. Fix
- the frequency of the latch block, by scaling it back by
- 1 - exit->probability. */
- new_exit->probability = exit->probability;
- edge new_nonexit = single_pred_edge (loop->latch);
- new_nonexit->probability = exit->probability.invert ();
- new_nonexit->flags = EDGE_TRUE_VALUE;
- if (new_nonexit->probability.initialized_p ())
- scale_bbs_frequencies (&loop->latch, 1, new_nonexit->probability);
-
- edge old_entry = loop_preheader_edge (loop);
- edge new_entry = loop_preheader_edge (new_loop);
- edge old_latch = loop_latch_edge (loop);
- for (gphi_iterator psi_old_loop = gsi_start_phis (loop->header),
- psi_new_loop = gsi_start_phis (new_loop->header);
- !gsi_end_p (psi_old_loop);
- gsi_next (&psi_old_loop), gsi_next (&psi_new_loop))
- {
- gphi *phi_old_loop = psi_old_loop.phi ();
- gphi *phi_new_loop = psi_new_loop.phi ();
-
- tree init = PHI_ARG_DEF_FROM_EDGE (phi_old_loop, old_entry);
- use_operand_p op
- = PHI_ARG_DEF_PTR_FROM_EDGE (phi_new_loop, new_entry);
- gcc_assert (operand_equal_for_phi_arg_p (init, USE_FROM_PTR (op)));
- tree next = PHI_ARG_DEF_FROM_EDGE (phi_old_loop, old_latch);
-
- /* Prefer using original variable as a base for the new ssa name.
- This is necessary for virtual ops, and useful in order to avoid
- losing debug info for real ops. */
- tree new_init;
- if (TREE_CODE (next) == SSA_NAME
- && useless_type_conversion_p (TREE_TYPE (next),
- TREE_TYPE (init)))
- new_init = copy_ssa_name (next);
- else if (TREE_CODE (init) == SSA_NAME
- && useless_type_conversion_p (TREE_TYPE (init),
- TREE_TYPE (next)))
- new_init = copy_ssa_name (init);
- else if (useless_type_conversion_p (TREE_TYPE (next),
- TREE_TYPE (init)))
- new_init = make_temp_ssa_name (TREE_TYPE (next), NULL,
- "unrinittmp");
- else
- new_init = make_temp_ssa_name (TREE_TYPE (init), NULL,
- "unrinittmp");
-
- gphi *phi_rest = create_phi_node (new_init, rest);
- add_phi_arg (phi_rest, init, precond_edge, UNKNOWN_LOCATION);
- add_phi_arg (phi_rest, next, new_exit, UNKNOWN_LOCATION);
- SET_USE (op, new_init);
- }
-
- remove_path (exit);
- }
- else
- new_exit = single_dom_exit (loop);
-
- /* Transform the loop. */
- if (transform)
- (*transform) (loop, data);
-
- /* Unroll the loop and remove the exits in all iterations except for the
- last one. */
- auto_sbitmap wont_exit (factor);
- bitmap_ones (wont_exit);
- bitmap_clear_bit (wont_exit, factor - 1);
-
- auto_vec<edge> to_remove;
- bool ok
- = gimple_duplicate_loop_body_to_header_edge (loop, loop_latch_edge (loop),
- factor - 1, wont_exit,
- new_exit, &to_remove,
- DLTHE_FLAG_UPDATE_FREQ);
- gcc_assert (ok);
-
- for (edge e : to_remove)
- {
- ok = remove_path (e);
- gcc_assert (ok);
- }
- update_ssa (TODO_update_ssa);
-
- new_exit = single_dom_exit (loop);
- if (!single_loop_p)
- {
- /* Ensure that the frequencies in the loop match the new estimated
- number of iterations, and change the probability of the new
- exit edge. */
-
- profile_count freq_h = loop->header->count;
- profile_count freq_e = (loop_preheader_edge (loop))->count ();
- if (freq_h.nonzero_p ())
- {
- /* Avoid dropping loop body profile counter to 0 because of zero
- count in loop's preheader. */
- if (freq_h.nonzero_p () && !(freq_e == profile_count::zero ()))
- freq_e = freq_e.force_nonzero ();
- scale_loop_frequencies (loop, freq_e.probability_in (freq_h));
- }
-
- basic_block rest = new_exit->dest;
- new_exit->probability = profile_probability::always ()
- .apply_scale (1, new_est_niter + 1);
-
- rest->count += new_exit->count ();
-
- edge new_nonexit = single_pred_edge (loop->latch);
- profile_probability prob = new_nonexit->probability;
- new_nonexit->probability = new_exit->probability.invert ();
- prob = new_nonexit->probability / prob;
- if (prob.initialized_p ())
- scale_bbs_frequencies (&loop->latch, 1, prob);
-
- /* Finally create the new counter for number of iterations and add
- the new exit instruction. */
- tree ctr_before, ctr_after;
- gimple_stmt_iterator bsi = gsi_last_nondebug_bb (new_exit->src);
- exit_if = as_a <gcond *> (gsi_stmt (bsi));
- create_iv (exit_base, exit_step, NULL_TREE, loop,
- &bsi, false, &ctr_before, &ctr_after);
- gimple_cond_set_code (exit_if, exit_cmp);
- gimple_cond_set_lhs (exit_if, ctr_after);
- gimple_cond_set_rhs (exit_if, exit_bound);
- update_stmt (exit_if);
- }
- else
- {
- /* gimple_duplicate_loop_to_header_edge has adjusted the loop body's
- original profile counts in line with the unroll factor. However,
- the old counts might not have been consistent with the old
- iteration count.
-
- Therefore, if the iteration count is known exactly, make sure that the
- profile counts of the loop header (and any other blocks that might be
- executed in the final iteration) are consistent with the combination
- of (a) the incoming profile count and (b) the new iteration count. */
- profile_count in_count = loop_preheader_edge (loop)->count ();
- profile_count old_header_count = loop->header->count;
- if (in_count.nonzero_p ()
- && old_header_count.nonzero_p ()
- && TREE_CODE (desc->niter) == INTEGER_CST)
- {
- /* The + 1 converts latch counts to iteration counts. */
- profile_count new_header_count
- = (in_count.apply_scale (new_est_niter + 1, 1));
- basic_block *body = get_loop_body (loop);
- scale_bbs_frequencies_profile_count (body, loop->num_nodes,
- new_header_count,
- old_header_count);
- free (body);
- }
-
- /* gimple_duplicate_loop_to_header_edge discarded FACTOR - 1
- exit edges and adjusted the loop body's profile counts for the
- new probabilities of the remaining non-exit edges. However,
- the remaining exit edge still has the same probability as it
- did before, even though it is now more likely.
-
- Therefore, all blocks executed after a failed exit test now have
- a profile count that is too high, and the sum of the profile counts
- for the header's incoming edges is greater than the profile count
- of the header itself.
-
- Adjust the profile counts of all code in the loop body after
- the exit test so that the sum of the counts on entry to the
- header agree. */
- profile_count old_latch_count = loop_latch_edge (loop)->count ();
- profile_count new_latch_count = loop->header->count - in_count;
- if (old_latch_count.nonzero_p () && new_latch_count.nonzero_p ())
- scale_dominated_blocks_in_loop (loop, new_exit->src, new_latch_count,
- old_latch_count);
-
- /* Set the probability of the exit edge based on NEW_EST_NITER
- (which estimates latch counts rather than iteration counts).
- Update the probabilities of other edges to match.
-
- If the profile counts are large enough to give the required
- precision, the updates above will have made
-
- e->dest->count / e->src->count ~= new e->probability
-
- for every outgoing edge e of NEW_EXIT->src. */
- profile_probability new_exit_prob = profile_probability::always ()
- .apply_scale (1, new_est_niter + 1);
- change_edge_frequency (new_exit, new_exit_prob);
- }
-
- checking_verify_flow_info ();
- checking_verify_loop_structure ();
- checking_verify_loop_closed_ssa (true, loop);
- checking_verify_loop_closed_ssa (true, new_loop);
-}
-
-/* Wrapper over tree_transform_and_unroll_loop for case we do not
- want to transform the loop before unrolling. The meaning
- of the arguments is the same as for tree_transform_and_unroll_loop. */
-
-void
-tree_unroll_loop (class loop *loop, unsigned factor,
- class tree_niter_desc *desc)
-{
- tree_transform_and_unroll_loop (loop, factor, desc, NULL, NULL);
-}
-
-/* Rewrite the phi node at position PSI in function of the main
- induction variable MAIN_IV and insert the generated code at GSI. */
-
-static void
-rewrite_phi_with_iv (loop_p loop,
- gphi_iterator *psi,
- gimple_stmt_iterator *gsi,
- tree main_iv)
-{
- affine_iv iv;
- gassign *stmt;
- gphi *phi = psi->phi ();
- tree atype, mtype, val, res = PHI_RESULT (phi);
-
- if (virtual_operand_p (res) || res == main_iv)
- {
- gsi_next (psi);
- return;
- }
-
- if (!simple_iv (loop, loop, res, &iv, true))
- {
- gsi_next (psi);
- return;
- }
-
- remove_phi_node (psi, false);
-
- atype = TREE_TYPE (res);
- mtype = POINTER_TYPE_P (atype) ? sizetype : atype;
- val = fold_build2 (MULT_EXPR, mtype, unshare_expr (iv.step),
- fold_convert (mtype, main_iv));
- val = fold_build2 (POINTER_TYPE_P (atype)
- ? POINTER_PLUS_EXPR : PLUS_EXPR,
- atype, unshare_expr (iv.base), val);
- val = force_gimple_operand_gsi (gsi, val, false, NULL_TREE, true,
- GSI_SAME_STMT);
- stmt = gimple_build_assign (res, val);
- gsi_insert_before (gsi, stmt, GSI_SAME_STMT);
-}
-
-/* Rewrite all the phi nodes of LOOP in function of the main induction
- variable MAIN_IV. */
-
-static void
-rewrite_all_phi_nodes_with_iv (loop_p loop, tree main_iv)
-{
- unsigned i;
- basic_block *bbs = get_loop_body_in_dom_order (loop);
- gphi_iterator psi;
-
- for (i = 0; i < loop->num_nodes; i++)
- {
- basic_block bb = bbs[i];
- gimple_stmt_iterator gsi = gsi_after_labels (bb);
-
- if (bb->loop_father != loop)
- continue;
-
- for (psi = gsi_start_phis (bb); !gsi_end_p (psi); )
- rewrite_phi_with_iv (loop, &psi, &gsi, main_iv);
- }
-
- free (bbs);
-}
-
-/* Bases all the induction variables in LOOP on a single induction variable
- (with base 0 and step 1), whose final value is compared with *NIT. When the
- IV type precision has to be larger than *NIT type precision, *NIT is
- converted to the larger type, the conversion code is inserted before the
- loop, and *NIT is updated to the new definition. When BUMP_IN_LATCH is true,
- the induction variable is incremented in the loop latch, otherwise it is
- incremented in the loop header. Return the induction variable that was
- created. */
-
-tree
-canonicalize_loop_ivs (class loop *loop, tree *nit, bool bump_in_latch)
-{
- unsigned precision = TYPE_PRECISION (TREE_TYPE (*nit));
- unsigned original_precision = precision;
- tree type, var_before;
- gimple_stmt_iterator gsi;
- gphi_iterator psi;
- gcond *stmt;
- edge exit = single_dom_exit (loop);
- gimple_seq stmts;
- bool unsigned_p = false;
-
- for (psi = gsi_start_phis (loop->header);
- !gsi_end_p (psi); gsi_next (&psi))
- {
- gphi *phi = psi.phi ();
- tree res = PHI_RESULT (phi);
- bool uns;
-
- type = TREE_TYPE (res);
- if (virtual_operand_p (res)
- || (!INTEGRAL_TYPE_P (type)
- && !POINTER_TYPE_P (type))
- || TYPE_PRECISION (type) < precision)
- continue;
-
- uns = POINTER_TYPE_P (type) | TYPE_UNSIGNED (type);
-
- if (TYPE_PRECISION (type) > precision)
- unsigned_p = uns;
- else
- unsigned_p |= uns;
-
- precision = TYPE_PRECISION (type);
- }
-
- scalar_int_mode mode = smallest_int_mode_for_size (precision);
- precision = GET_MODE_PRECISION (mode);
- type = build_nonstandard_integer_type (precision, unsigned_p);
-
- if (original_precision != precision
- || TYPE_UNSIGNED (TREE_TYPE (*nit)) != unsigned_p)
- {
- *nit = fold_convert (type, *nit);
- *nit = force_gimple_operand (*nit, &stmts, true, NULL_TREE);
- if (stmts)
- gsi_insert_seq_on_edge_immediate (loop_preheader_edge (loop), stmts);
- }
-
- if (bump_in_latch)
- gsi = gsi_last_bb (loop->latch);
- else
- gsi = gsi_last_nondebug_bb (loop->header);
- create_iv (build_int_cst_type (type, 0), build_int_cst (type, 1), NULL_TREE,
- loop, &gsi, bump_in_latch, &var_before, NULL);
-
- rewrite_all_phi_nodes_with_iv (loop, var_before);
-
- stmt = as_a <gcond *> (last_stmt (exit->src));
- /* Make the loop exit if the control condition is not satisfied. */
- if (exit->flags & EDGE_TRUE_VALUE)
- {
- edge te, fe;
-
- extract_true_false_edges_from_block (exit->src, &te, &fe);
- te->flags = EDGE_FALSE_VALUE;
- fe->flags = EDGE_TRUE_VALUE;
- }
- gimple_cond_set_code (stmt, LT_EXPR);
- gimple_cond_set_lhs (stmt, var_before);
- gimple_cond_set_rhs (stmt, *nit);
- update_stmt (stmt);
-
- return var_before;
-}