GPUOcelot
Public Types | Public Member Functions

analysis::DivergenceAnalysis Class Reference

DivergenceAnalysis implements divergence analysis. The divergence analysis goes over the program dataflow graph and finds all the variables that will always hold the same values for every thread. More...

#include <DivergenceAnalysis.h>

Inheritance diagram for analysis::DivergenceAnalysis:
Inheritance graph
[legend]
Collaboration diagram for analysis::DivergenceAnalysis:
Collaboration graph
[legend]

List of all members.

Public Types

typedef std::set< BranchInfobranch_set
typedef
DataflowGraph::InstructionVector::const_iterator 
const_instruction_iterator

Public Member Functions

 DivergenceAnalysis ()
 Constructor, already making the analysis of a input kernel.
virtual void analyze (ir::IRKernel &k)
 Analyze the control and data flow graphs searching for divergent variables and blocks.
bool isDivBlock (DataflowGraph::const_iterator &block) const
 Tests if a block ends with a divergent branch instruction.
bool isDivBlock (DataflowGraph::iterator &block) const
 Tests if a block ends with a divergent branch instruction.
bool isDivBranch (const const_instruction_iterator &instruction) const
 Tests if a block ends with a divergent branch instruction.
bool isDivInstruction (const DataflowGraph::Instruction &instruction) const
 Tests if a instruction uses divergent variables.
bool isPossibleDivBranch (const const_instruction_iterator &instruction) const
 Tests if a instruction is a possibly divergent branch.
branch_setgetDivergentBranches ()
 Returns set of all divergent branches of the kernel.
branch_setgetNonDivergentBranches ()
 Returns a set of all not divergent branches of the kernel.
const DivergenceGraphgetDivergenceGraph () const
 Get the data-flow/divergence graph built by the analysis.
const DataflowGraphgetDFG () const
 Returns the kernel dataflow graph.
void setControlFlowAnalysis (bool doControlFlowAnalysis)

Detailed Description

DivergenceAnalysis implements divergence analysis. The divergence analysis goes over the program dataflow graph and finds all the variables that will always hold the same values for every thread.


Member Typedef Documentation

typedef DataflowGraph::InstructionVector::const_iterator analysis::DivergenceAnalysis::const_instruction_iterator

Constructor & Destructor Documentation

analysis::DivergenceAnalysis::DivergenceAnalysis ( )

Constructor, already making the analysis of a input kernel.


Member Function Documentation

void analysis::DivergenceAnalysis::analyze ( ir::IRKernel k) [virtual]

Analyze the control and data flow graphs searching for divergent variables and blocks.

1) Makes data flow analysis that detects divergent variables and blocks based on divergent sources, such as t.id, laneId 2) Makes control flow analysis that detects new divergent variables based on the dependency of variables of variables created on divergent paths

Implements analysis::KernelAnalysis.

const DataflowGraph * analysis::DivergenceAnalysis::getDFG ( ) const

Returns the kernel dataflow graph.

const DivergenceGraph & analysis::DivergenceAnalysis::getDivergenceGraph ( ) const

Get the data-flow/divergence graph built by the analysis.

DivergenceAnalysis::branch_set & analysis::DivergenceAnalysis::getDivergentBranches ( )

Returns set of all divergent branches of the kernel.

DivergenceAnalysis::branch_set & analysis::DivergenceAnalysis::getNonDivergentBranches ( )

Returns a set of all not divergent branches of the kernel.

bool analysis::DivergenceAnalysis::isDivBlock ( DataflowGraph::const_iterator block) const

Tests if a block ends with a divergent branch instruction.

Tests if a block ends with a divergent branch instruction (isDivBranchInstr)

bool analysis::DivergenceAnalysis::isDivBlock ( DataflowGraph::iterator block) const

Tests if a block ends with a divergent branch instruction.

Tests if a block ends with a divergent branch instruction (isDivBranchInstr)

bool analysis::DivergenceAnalysis::isDivBranch ( const const_instruction_iterator instruction) const

Tests if a block ends with a divergent branch instruction.

Tests if the a instruction is a branch instruction instruction and is possible a divergent instruction (isDivInstruction)

Tests if a branch instruction is divergent

bool analysis::DivergenceAnalysis::isDivInstruction ( const DataflowGraph::Instruction instruction) const

Tests if a instruction uses divergent variables.

Tests if any of the registers of a instruction is possible divergent.

bool analysis::DivergenceAnalysis::isPossibleDivBranch ( const const_instruction_iterator instruction) const

Tests if a instruction is a possibly divergent branch.

Tests if a instruction is a branch instruction with possibility of divergence.

void analysis::DivergenceAnalysis::setControlFlowAnalysis ( bool  doControlFlowAnalysis)

If doControlFlowAnalysis is set to false, then we have the variance analysis of Straton et al.. Use it only for experiments.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines