LLVM API Documentation

PredicateSimplifier.cpp File Reference

#include "llvm/Transforms/Scalar.h"
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Instructions.h"
#include "llvm/Pass.h"
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/ADT/SetOperations.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Analysis/Dominators.h"
#include "llvm/Assembly/Writer.h"
#include "llvm/Support/CFG.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/ConstantRange.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/InstVisitor.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Transforms/Utils/Local.h"
#include <algorithm>
#include <deque>
#include <stack>

Include dependency graph for PredicateSimplifier.cpp:

Go to the source code of this file.

Defines

#define DEBUG_TYPE   "predsimplify"

Enumerations

enum  LatticeBits {
  EQ_BIT = 1, UGT_BIT = 2, ULT_BIT = 4, SGT_BIT = 8,
  SLT_BIT = 16
}
enum  LatticeVal {
  GT = SGT_BIT | UGT_BIT, GE = GT | EQ_BIT, LT = SLT_BIT | ULT_BIT, LE = LT | EQ_BIT,
  NE = SLT_BIT | SGT_BIT | ULT_BIT | UGT_BIT, SGTULT = SGT_BIT | ULT_BIT, SGEULE = SGTULT | EQ_BIT, SLTUGT = SLT_BIT | UGT_BIT,
  SLEUGE = SLTUGT | EQ_BIT, ULT = SLT_BIT | SGT_BIT | ULT_BIT, UGT = SLT_BIT | SGT_BIT | UGT_BIT, SLT = SLT_BIT | ULT_BIT | UGT_BIT,
  SGT = SGT_BIT | ULT_BIT | UGT_BIT, SLE = SLT | EQ_BIT, SGE = SGT | EQ_BIT, ULE = ULT | EQ_BIT,
  UGE = UGT | EQ_BIT
}

Functions

 STATISTIC (NumVarsReplaced,"Number of argument substitutions")
 STATISTIC (NumInstruction,"Number of instructions removed")
 STATISTIC (NumSimple,"Number of simple replacements")
 STATISTIC (NumBlocks,"Number of blocks marked unreachable")
 STATISTIC (NumSnuggle,"Number of comparisons snuggled")
static bool validPredicate (LatticeVal LV)
static LatticeVal reversePredicate (LatticeVal LV)
 reversePredicate - reverse the direction of the inequality
FunctionPass * llvm::createPredicateSimplifierPass ()

Variables

static const ConstantRange empty (1, false)
static RegisterPass
< PredicateSimplifier > 
X ("predsimplify","Predicate Simplifier")


Define Documentation

#define DEBUG_TYPE   "predsimplify"

Definition at line 82 of file PredicateSimplifier.cpp.


Enumeration Type Documentation

Enumerator:
EQ_BIT 
UGT_BIT 
ULT_BIT 
SGT_BIT 
SLT_BIT 

Definition at line 324 of file PredicateSimplifier.cpp.

enum LatticeVal

Enumerator:
GT 
GE 
LT 
LE 
NE 
SGTULT 
SGEULE 
SLTUGT 
SLEUGE 
ULT 
UGT 
SLT 
SGT 
SLE 
SGE 
ULE 
UGE 

Definition at line 327 of file PredicateSimplifier.cpp.


Function Documentation

static LatticeVal @1362::reversePredicate ( LatticeVal  LV  )  [static]

reversePredicate - reverse the direction of the inequality

Definition at line 365 of file PredicateSimplifier.cpp.

References SGT_BIT, SLT_BIT, UGT_BIT, ULT_BIT, and validPredicate().

STATISTIC ( NumSnuggle  ,
"Number of comparisons snuggled"   
)

STATISTIC ( NumBlocks  ,
"Number of blocks marked unreachable"   
)

STATISTIC ( NumSimple  ,
"Number of simple replacements"   
)

STATISTIC ( NumInstruction  ,
"Number of instructions removed"   
)

STATISTIC ( NumVarsReplaced  ,
"Number of argument substitutions"   
)

static bool @1362::validPredicate ( LatticeVal  LV  )  [static]

validPredicate - determines whether a given value is actually a lattice value. Only used in assertions or debugging.

Definition at line 350 of file PredicateSimplifier.cpp.

References GE, GT, LE, LT, NE, SGE, SGEULE, SGT, SGTULT, SLE, SLEUGE, SLT, SLTUGT, UGE, UGT, ULE, and ULT.

Referenced by reversePredicate().


Variable Documentation

Definition at line 159 of file PredicateSimplifier.cpp.

std::vector<Node *> Children

Definition at line 910 of file PredicateSimplifier.cpp.

Definition at line 1335 of file PredicateSimplifier.cpp.

Definition at line 1336 of file PredicateSimplifier.cpp.

std::vector<BasicBlock *> DeadBlocks

Definition at line 1275 of file PredicateSimplifier.cpp.

Definition at line 158 of file PredicateSimplifier.cpp.

Definition at line 158 of file PredicateSimplifier.cpp.

DomTreeDFS* DTDFS

Definition at line 422 of file PredicateSimplifier.cpp.

Definition at line 2299 of file PredicateSimplifier.cpp.

const ConstantRange empty(1, false) [static]

char ID [static]

Definition at line 2279 of file PredicateSimplifier.cpp.

InequalityGraph& IG

Definition at line 1341 of file PredicateSimplifier.cpp.

Definition at line 1332 of file PredicateSimplifier.cpp.

Definition at line 617 of file PredicateSimplifier.cpp.

Definition at line 1348 of file PredicateSimplifier.cpp.

std::map<BasicBlock *, Node *> NodeMap

Definition at line 303 of file PredicateSimplifier.cpp.

std::vector<Node> Nodes

Definition at line 748 of file PredicateSimplifier.cpp.

Referenced by WriteMDNodes().

Definition at line 1333 of file PredicateSimplifier.cpp.

Referenced by llvm::MachineInstr::addOperand(), llvm::SDNode::use_iterator::atEnd(), llvm::MachineRegisterInfo::defusechain_iterator< ReturnUses, ReturnDefs >::atEnd(), llvm::CloneLoop(), llvm::CloneTrace(), ComputeReloadLoc(), llvm::ConstantFoldCall(), llvm::ConstantFoldInsertElementInstruction(), llvm::ConstantFoldInsertValueInstruction(), llvm::ConstantFoldInstruction(), llvm::MachineOperand::CreateCPI(), llvm::MachineOperand::CreateES(), llvm::MachineOperand::CreateFI(), llvm::MachineOperand::CreateFPImm(), llvm::MachineOperand::CreateGA(), llvm::MCOperand::CreateImm(), llvm::MachineOperand::CreateImm(), llvm::MachineOperand::CreateJTI(), llvm::MachineOperand::CreateMBB(), llvm::MCOperand::CreateMBBLabel(), llvm::MCOperand::CreateMCValue(), llvm::MachineOperand::CreateMDNode(), llvm::MCOperand::CreateReg(), llvm::MachineOperand::CreateReg(), llvm::AsmPrinter::EmitConstantValueOnly(), llvm::BranchInst::getCondition(), getConstantEvolvingPHI(), llvm::DOTGraphTraits< SelectionDAG * >::getEdgeAttributes(), getNextStopPoint(), llvm::MachineRegisterInfo::defusechain_iterator< ReturnUses, ReturnDefs >::getOperand(), llvm::SDNode::use_iterator::getOperandNo(), llvm::MachineRegisterInfo::defusechain_iterator< ReturnUses, ReturnDefs >::getOperandNo(), llvm::ScalarEvolution::getSCEVAtScope(), llvm::ISD::getSetCCOrOperation(), llvm::BranchInst::getSuccessor(), llvm::ScalarEvolution::getUDivExpr(), llvm::SDNode::use_iterator::getUse(), llvm::HandleSDNode::getValue(), llvm::SelectionDAGLowering::getValue(), llvm::HandleSDNode::HandleSDNode(), llvm::AtomicSDNode::isCompareAndSwap(), llvm::SDNode::use_iterator::operator*(), llvm::MachineRegisterInfo::defusechain_iterator< ReturnUses, ReturnDefs >::operator*(), llvm::SDNode::use_iterator::operator++(), llvm::MachineRegisterInfo::defusechain_iterator< ReturnUses, ReturnDefs >::operator++(), llvm::MachineRegisterInfo::defusechain_iterator< ReturnUses, ReturnDefs >::operator->(), llvm::SDNode::use_iterator::operator==(), llvm::MachineRegisterInfo::defusechain_iterator< ReturnUses, ReturnDefs >::operator==(), llvm::X86ATTAsmPrinter::print_pcrel_imm(), llvm::X86ATTAsmPrinter::printOperand(), RemapInstruction(), removeOperands(), llvm::BranchInst::setCondition(), llvm::BranchInst::setSuccessor(), llvm::BranchInst::setUnconditionalDest(), llvm::UnarySDNode::UnarySDNode(), and llvm::X86InstrInfo::unfoldMemoryOperand().

PredicateSimplifier* PS

Definition at line 2298 of file PredicateSimplifier.cpp.

RangeListType RangeList

Definition at line 915 of file PredicateSimplifier.cpp.

std::vector<ScopedRange> Ranges

Definition at line 982 of file PredicateSimplifier.cpp.

RelationsType Relations

Definition at line 646 of file PredicateSimplifier.cpp.

Definition at line 1332 of file PredicateSimplifier.cpp.

Definition at line 389 of file PredicateSimplifier.cpp.

Definition at line 909 of file PredicateSimplifier.cpp.

Definition at line 1345 of file PredicateSimplifier.cpp.

Referenced by llvm::FindFunctionBackedges(), and llvm::PMStack::pop().

Definition at line 1346 of file PredicateSimplifier.cpp.

Definition at line 1347 of file PredicateSimplifier.cpp.

Definition at line 597 of file PredicateSimplifier.cpp.

UnreachableBlocks& UB

Definition at line 1342 of file PredicateSimplifier.cpp.

Value* V

Definition at line 387 of file PredicateSimplifier.cpp.

std::vector<Value *> Values

ValueNumbering& VN

Definition at line 596 of file PredicateSimplifier.cpp.

VNMapType VNMap

Definition at line 417 of file PredicateSimplifier.cpp.

ValueRanges& VR

std::vector<DomTreeDFS::Node *> WorkList

Definition at line 1338 of file PredicateSimplifier.cpp.

RegisterPass<PredicateSimplifier> X("predsimplify","Predicate Simplifier") [static]