GCC Middle and Back End API Reference
hierarchical_discriminator.h File Reference
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "gimple.h"
#include "tree.h"
#include "basic-block.h"
#include "input.h"
Include dependency graph for hierarchical_discriminator.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  copyid_allocator

Functions

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)
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 )
extern
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 )
extern
Helper function to assign discriminators to all statements in a basic
block.  This preserves the base discriminator and updates multiplicity
and/or copyid.  PHI statements, PHI arguments, and edge locations are
also updated.   
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 )
extern
Helper function to assign discriminators to all basic blocks in a loop.
This is used by loop versioning passes to distinguish different versions
of the same loop and to indicate vectorization factors.   
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 )
extern
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/>.   
Hierarchical discriminator layout (32 bits total):
 Discriminator format: [Base:8][Multiplicity:7][CopyID:11][Unused:6]
 - Base: bits 0-7 (8 bits, 0-255)
 - Multiplicity: bits 8-14 (7 bits, 0-127)
 - CopyID: bits 15-25 (11 bits, 0-2047)
 - Unused: bits 26-31 (6 bits, reserved)

 Base discriminator: Used by front-end and early passes to distinguish
               different statements on the same source line.

 Multiplicity: Represents when a single IR statement corresponds to
         multiple scalar iterations or executions

 CopyID: Unique identifier for distinct code copies to distinguish
Helper function to assign discriminators to a statement.
This preserves the base discriminator and updates multiplicity
and/or 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)
extern
Free the copy_id allocator for a function.   
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.