/* Bebbo's Optimizations.
Copyright (C) 2010-2017 Free Software Foundation, Inc.
Copyright (C) 2017 Stefan "Bebbo" Franke.
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
. */
/**
* SBF (Stefan "Bebbo" Franke):
*
* This pass performs multiple optimizations.
*
* #1 propagate_moves
* check if a->b->a can be moved out of a loop.
*
* #2 strcpy
* check if a temp reg can be eliminated.
*
* #3 const_comp_sub
* convert a compare with int constant into sub statement.
*
* #4 merge_add
* merge adds
*
* #5 elim_dead_assign
* eliminate some dead assignments.
*
* #6 shrink stack frame
* remove push/pop for unused variables
*
* #7 rename register
* rename registers without breaking register parameters, inline asm etc.
*
* Lessons learned:
*
* - do not trust existing code, better delete insns and inster a new one.
* - do not modify insns, create new insns from pattern
* - do not reuse registers, create new reg rtx instances
*
*/
#include "config.h"
#define INCLUDE_VECTOR
#define INCLUDE_SET
#define INCLUDE_MAP
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "target.h"
#include "rtl.h"
#include "tm_p.h"
#include "insn-config.h"
#include "recog.h"
#include "cfgrtl.h"
#include "emit-rtl.h"
#include "tree.h"
#include "tree-pass.h"
#include "conditions.h"
#include "langhooks.h"
#include "output.h"
#include
#include
#include