GCC Middle and Back End API Reference
hierarchical_discriminator.cc File Reference
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "tree.h"
#include "gimple.h"
#include "tree-pass.h"
#include "ssa.h"
#include "gimple-iterator.h"
#include "tree-cfg.h"
#include "cfgloop.h"
#include "hierarchical_discriminator.h"
#include "cfghooks.h"
#include "diagnostic-core.h"
#include "function.h"
#include "rtl.h"
#include "basic-block.h"
Include dependency graph for hierarchical_discriminator.cc:

Functions

static location_t update_location_discriminator (location_t loc, unsigned int multiplicity_factor, unsigned int copyid)
void assign_discriminators_to_stmt (gimple *stmt, unsigned int multiplicity_factor, unsigned int copyid)
void assign_discriminators_to_bb (basic_block bb, unsigned int multiplicity_factor, unsigned int copyid)
void assign_discriminators_to_loop (class loop *loop, unsigned int multiplicity_factor, unsigned int copyid)
static void record_existing_copyid (location_t loc, struct function *fn)
static void init_copyid_allocator (struct function *fn)
unsigned int allocate_copyid_base (location_t loc, unsigned int stride)
void free_copyid_allocator (struct function *fn)

Function Documentation

◆ allocate_copyid_base()

unsigned int allocate_copyid_base ( location_t loc,
unsigned int stride )
Allocate a unique copy_id base for the given location.
STRIDE indicates how many copy_ids to reserve (for unrolling N times,
use stride=N).  Returns the base copy_id.   

References cfun, DISCR_COPYID_MAX, get_pure_location(), init_copyid_allocator(), and UNKNOWN_LOCATION.

Referenced by duplicate_loop_body_to_header_edge(), vect_do_peeling(), vect_loop_versioning(), and vect_transform_loop().

◆ assign_discriminators_to_bb()

void assign_discriminators_to_bb ( basic_block bb,
unsigned int multiplicity_factor,
unsigned int copyid )
Assign discriminators to all statements in a basic block.  This
function updates the multiplicity and/or copyid discriminator components for
all statements in the given basic block, while preserving the base
discriminator.

If multiplicity_factor > 0, multiply existing multiplicity by this factor.
If copyid > 0, set it to this value.   

References FOR_EACH_EDGE, gimple_location(), gimple_set_location(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_start_phis(), gsi_stmt(), is_gimple_debug(), gphi_iterator::phi(), basic_block_def::succs, UNKNOWN_LOCATION, and update_location_discriminator().

Referenced by assign_discriminators_to_loop(), and duplicate_loop_body_to_header_edge().

◆ assign_discriminators_to_loop()

void assign_discriminators_to_loop ( class loop * loop,
unsigned int multiplicity_factor,
unsigned int copyid )
Assign discriminators to all basic blocks in a loop.  This function is
used by loop versioning passes to assign version IDs and vectorization
factors to all statements in a loop version.   

References assign_discriminators_to_bb(), free(), get_loop_body(), i, and loop::num_nodes.

Referenced by vect_do_peeling(), vect_loop_versioning(), and vect_transform_loop().

◆ assign_discriminators_to_stmt()

void assign_discriminators_to_stmt ( gimple * stmt,
unsigned int multiplicity_factor,
unsigned int copyid )
Assign discriminators to a statement
Updates the multiplicity and/or copyid discriminator components for
all statements in the given basic block, while preserving the base
discriminator.

If multiplicity_factor > 0, multiply existing multiplicity by this factor.
If copyid > 0, set it to this value.   

References gimple_location(), gimple_set_location(), UNKNOWN_LOCATION, and update_location_discriminator().

◆ free_copyid_allocator()

void free_copyid_allocator ( struct function * fn)
Free the copy_id allocator for a function.  Called when the function
is being destroyed.   

References function::copyid_alloc, copyid_allocator::location_map, and NULL.

◆ init_copyid_allocator()

◆ record_existing_copyid()

void record_existing_copyid ( location_t loc,
struct function * fn )
static
Helper to update the copyid allocator map with a location's existing copyid.
If the location has a non-zero copyid, record that we need to start
allocating from copyid+1 for this location.   

References function::copyid_alloc, DISCR_COPYID_MASK, DISCR_COPYID_MAX, DISCR_COPYID_SHIFT, hash_map< KeyId, Value, Traits >::get(), get_discriminator_from_loc(), get_pure_location(), copyid_allocator::location_map, hash_map< KeyId, Value, Traits >::put(), and UNKNOWN_LOCATION.

Referenced by init_copyid_allocator().

◆ update_location_discriminator()

location_t update_location_discriminator ( location_t loc,
unsigned int multiplicity_factor,
unsigned int copyid )
static
Copyright The GNU Toolchain Authors

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/>.   
Helper to update a location with new discriminator components.  If
multiplicity_factor is non-zero, multiply existing multiplicity.
If copyid is non-zero, set it (otherwise preserve existing).   

References comp, DISCR_MULTIPLICITY_MAX, get_discriminator_components_from_loc(), location_with_discriminator_components(), and UNKNOWN_LOCATION.

Referenced by assign_discriminators_to_bb(), and assign_discriminators_to_stmt().