LLVM
12.0.0git
|
#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"
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 |
#define DEBUG_TYPE "constraint-elimination" |
Definition at line 34 of file ConstraintElimination.cpp.
DEBUG_COUNTER | ( | EliminatedCounter | , |
"conds-eliminated" | , | ||
"Controls which conditions are eliminated" | |||
) |
|
static |
Definition at line 46 of file ConstraintElimination.cpp.
References GEP, llvm::ConstantInt::getSExtValue(), llvm::PatternMatch::m_ConstantInt(), llvm::PatternMatch::m_NUWAdd(), llvm::PatternMatch::m_NUWShl(), llvm::PatternMatch::m_NUWSub(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::m_ZExt(), llvm::PatternMatch::match(), and MaxConstraintValue.
Referenced by getConstraint().
|
static |
Definition at line 200 of file ConstraintElimination.cpp.
References llvm::ConstraintSystem::addVariableRowFill(), assert(), B, llvm::dbgs(), E, llvm::SmallVectorImpl< T >::emplace_back(), F(), getConstraint(), llvm::ConstantInt::getFalse(), llvm::DominatorTreeBase< NodeT, IsPostDom >::getNode(), llvm::BasicBlock::getSinglePredecessor(), llvm::ConstantInt::getTrue(), I, llvm::ConstraintSystem::isConditionImplied(), LLVM_DEBUG, llvm::PatternMatch::m_Cmp(), llvm::PatternMatch::m_LogicalAnd(), llvm::PatternMatch::m_LogicalOr(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), llvm::ConstraintSystem::negate(), llvm::ConstraintSystem::popLastConstraint(), llvm::reverse(), llvm::DebugCounter::shouldExecute(), llvm::sort(), and llvm::DominatorTreeBase< NodeT, IsPostDom >::updateDFSNumbers().
Referenced by llvm::ConstraintEliminationPass::run().
|
static |
Turn a condition CmpI
into a constraint vector, using indices from Value2Index
.
If ShouldAdd
is true, new indices are added for values not yet in Value2Index
.
Definition at line 98 of file ConstraintElimination.cpp.
References llvm::concat(), decompose(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), llvm::CmpInst::getSwappedPredicate(), I, llvm::CmpInst::ICMP_UGE, llvm::CmpInst::ICMP_UGT, llvm::CmpInst::ICMP_ULE, llvm::CmpInst::ICMP_ULT, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::insert(), llvm::make_range(), llvm::None, and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::size().
Referenced by eliminateConstraints(), and getConstraint().
|
static |
Definition at line 162 of file ConstraintElimination.cpp.
References getConstraint().
INITIALIZE_PASS_BEGIN | ( | ConstraintElimination | , |
"constraint-elimination" | , | ||
"Constraint Elimination" | , | ||
false | , | ||
false | |||
) |
STATISTIC | ( | NumCondsRemoved | , |
"Number of instructions removed" | |||
) |
constraint elimination |
Definition at line 402 of file ConstraintElimination.cpp.
constraint Constraint Elimination |
Definition at line 402 of file ConstraintElimination.cpp.
constraint Constraint false |
Definition at line 402 of file ConstraintElimination.cpp.
|
static |
Definition at line 40 of file ConstraintElimination.cpp.
Referenced by decompose().