LLVM  12.0.0git
Macros | Functions | Variables
ConstraintElimination.cpp File Reference
#include "llvm/Transforms/Scalar/ConstraintElimination.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/ConstraintSystem.h"
#include "llvm/Analysis/GlobalsModRef.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/PatternMatch.h"
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/DebugCounter.h"
#include "llvm/Transforms/Scalar.h"
Include dependency graph for ConstraintElimination.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "constraint-elimination"
 

Functions

 STATISTIC (NumCondsRemoved, "Number of instructions removed")
 
 DEBUG_COUNTER (EliminatedCounter, "conds-eliminated", "Controls which conditions are eliminated")
 
static SmallVector< std::pair< int64_t, Value * >, 4 > decompose (Value *V)
 
static SmallVector< int64_t, 8 > getConstraint (CmpInst::Predicate Pred, Value *Op0, Value *Op1, DenseMap< Value *, unsigned > &Value2Index, bool ShouldAdd)
 Turn a condition CmpI into a constraint vector, using indices from Value2Index. More...
 
static SmallVector< int64_t, 8 > getConstraint (CmpInst *Cmp, DenseMap< Value *, unsigned > &Value2Index, bool ShouldAdd)
 
static bool eliminateConstraints (Function &F, DominatorTree &DT)
 
 INITIALIZE_PASS_BEGIN (ConstraintElimination, "constraint-elimination", "Constraint Elimination", false, false) INITIALIZE_PASS_END(ConstraintElimination
 

Variables

static int64_t MaxConstraintValue = std::numeric_limits<int64_t>::max()
 
constraint elimination
 
constraint Constraint Elimination
 
constraint Constraint false
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "constraint-elimination"

Definition at line 34 of file ConstraintElimination.cpp.

Function Documentation

◆ DEBUG_COUNTER()

DEBUG_COUNTER ( EliminatedCounter  ,
"conds-eliminated"  ,
"Controls which conditions are eliminated"   
)

◆ decompose()

static SmallVector<std::pair<int64_t, Value *>, 4> decompose ( Value V)
static

◆ eliminateConstraints()

static bool eliminateConstraints ( Function F,
DominatorTree DT 
)
static

◆ getConstraint() [1/2]

static SmallVector<int64_t, 8> getConstraint ( CmpInst::Predicate  Pred,
Value Op0,
Value Op1,
DenseMap< Value *, unsigned > &  Value2Index,
bool  ShouldAdd 
)
static

◆ getConstraint() [2/2]

static SmallVector<int64_t, 8> getConstraint ( CmpInst Cmp,
DenseMap< Value *, unsigned > &  Value2Index,
bool  ShouldAdd 
)
static

Definition at line 162 of file ConstraintElimination.cpp.

References getConstraint().

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( ConstraintElimination  ,
"constraint-elimination ,
"Constraint Elimination ,
false  ,
false   
)

◆ STATISTIC()

STATISTIC ( NumCondsRemoved  ,
"Number of instructions removed"   
)

Variable Documentation

◆ elimination

constraint elimination

Definition at line 402 of file ConstraintElimination.cpp.

◆ Elimination

constraint Constraint Elimination

Definition at line 402 of file ConstraintElimination.cpp.

◆ false

constraint Constraint false

Definition at line 402 of file ConstraintElimination.cpp.

◆ MaxConstraintValue

int64_t MaxConstraintValue = std::numeric_limits<int64_t>::max()
static

Definition at line 40 of file ConstraintElimination.cpp.

Referenced by decompose().