LLVM  13.0.0git
Classes | Macros | Functions | Variables
ConstraintElimination.cpp File Reference
#include "llvm/Transforms/Scalar/ConstraintElimination.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/ScopeExit.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 <string>
Include dependency graph for ConstraintElimination.cpp:

Go to the source code of this file.

Classes

struct  ConstraintTy
 

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< ConstraintTy, 4 > getConstraint (CmpInst::Predicate Pred, Value *Op0, Value *Op1, const DenseMap< Value *, unsigned > &Value2Index, DenseMap< Value *, unsigned > &NewIndices)
 Turn a condition CmpI into a vector of constraints, using indices from Value2Index. More...
 
static SmallVector< ConstraintTy, 4 > getConstraint (CmpInst *Cmp, const DenseMap< Value *, unsigned > &Value2Index, DenseMap< Value *, unsigned > &NewIndices)
 
static void dumpWithNames (ConstraintTy &C, DenseMap< Value *, unsigned > &Value2Index)
 
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 37 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

◆ dumpWithNames()

static void dumpWithNames ( ConstraintTy C,
DenseMap< Value *, unsigned > &  Value2Index 
)
static

◆ eliminateConstraints()

static bool eliminateConstraints ( Function F,
DominatorTree DT 
)
static

◆ getConstraint() [1/2]

static SmallVector<ConstraintTy, 4> getConstraint ( CmpInst Cmp,
const DenseMap< Value *, unsigned > &  Value2Index,
DenseMap< Value *, unsigned > &  NewIndices 
)
static

Definition at line 206 of file ConstraintElimination.cpp.

References getConstraint().

◆ getConstraint() [2/2]

static SmallVector<ConstraintTy, 4> getConstraint ( CmpInst::Predicate  Pred,
Value Op0,
Value Op1,
const DenseMap< Value *, unsigned > &  Value2Index,
DenseMap< Value *, unsigned > &  NewIndices 
)
static

◆ 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 514 of file ConstraintElimination.cpp.

◆ Elimination

constraint Constraint Elimination

Definition at line 515 of file ConstraintElimination.cpp.

◆ false

constraint Constraint false

Definition at line 515 of file ConstraintElimination.cpp.

◆ MaxConstraintValue

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

Definition at line 43 of file ConstraintElimination.cpp.

Referenced by decompose().