GCC Middle and Back End API Reference
loop_data Class Reference
Collaboration diagram for loop_data:

Data Fields

class loopoutermost_exit
 
bool has_call
 
int max_reg_pressure [N_REG_CLASSES]
 
bitmap_head regs_ref
 
bitmap_head regs_live
 

Detailed Description

RTL-level loop invariant motion.
   Copyright (C) 2004-2024 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/>.   
This implements the loop invariant motion pass.  It is very simple
(no calls, no loads/stores, etc.).  This should be sufficient to cleanup
things like address arithmetics -- other more complicated invariants should
be eliminated on GIMPLE either in tree-ssa-loop-im.cc or in tree-ssa-pre.cc.

We proceed loop by loop -- it is simpler than trying to handle things
globally and should not lose much.  First we inspect all sets inside loop
and create a dependency graph on insns (saying "to move this insn, you must
also move the following insns").

We then need to determine what to move.  We estimate the number of registers
used and move as many invariants as possible while we still have enough free
registers.  We prefer the expensive invariants.

Then we move the selected invariants out of the loop, creating a new
temporaries for them if necessary.   
The data stored for the loop.   

Field Documentation

◆ has_call

bool loop_data::has_call

◆ max_reg_pressure

int loop_data::max_reg_pressure[N_REG_CLASSES]

Referenced by change_pressure().

◆ outermost_exit

class loop* loop_data::outermost_exit

◆ regs_live

bitmap_head loop_data::regs_live

Referenced by free_loop_data().

◆ regs_ref

bitmap_head loop_data::regs_ref

Referenced by free_loop_data().


The documentation for this class was generated from the following file: