LLVM API Documentation

CorrelatedExprs.cpp File Reference

#include "llvm/Transforms/Scalar.h"
#include "llvm/Constants.h"
#include "llvm/Pass.h"
#include "llvm/Function.h"
#include "llvm/Instructions.h"
#include "llvm/Type.h"
#include "llvm/Analysis/Dominators.h"
#include "llvm/Assembly/Writer.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Support/ConstantRange.h"
#include "llvm/Support/CFG.h"
#include "llvm/Support/Debug.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/ADT/Statistic.h"
#include <algorithm>
#include <iostream>

Include dependency graph for CorrelatedExprs.cpp:

Go to the source code of this file.

Typedefs

typedef std::map< Value *,
ValueInfo > 
ValueMapTy
typedef ValueMapTy::iterator iterator

Functions

FunctionPassllvm::createCorrelatedExpressionEliminationPass ()
static bool isBlockSimpleEnough (BasicBlock *BB)
static ValuegetReplacementOrValue (Value *V, RegionInfo &RI)
static void CalcRegionExitBlocks (BasicBlock *Header, BasicBlock *BB, std::set< BasicBlock * > &Visited, ETForest &EF, std::vector< BasicBlock * > &RegionExitBlocks)
static bool CheckCondition (Constant *Bound, Constant *C, Instruction::BinaryOps BO)

Variables

Statistic NumSetCCRemoved ("cee","Number of setcc instruction eliminated")
Statistic NumOperandsCann ("cee","Number of operands canonicalized")
Statistic BranchRevectors ("cee","Number of branches revectored")
ValueVal
Instruction::BinaryOps Rel
std::vector< Relation > Relationships
ConstantRange Bounds
ValueReplacement
BasicBlockBB
ValueMapTy ValueMap
std::map< Value *, unsigned > RankMap
std::map< BasicBlock *, RegionInfo > RegionInfoMap
ETForestEF
DominatorTreeDT
RegisterOpt< CEE > X ("cee","Correlated Expression Elimination")


Typedef Documentation

typedef ValueMapTy::iterator iterator

Definition at line 195 of file CorrelatedExprs.cpp.

typedef std::map<Value*, ValueInfo> ValueMapTy

Definition at line 173 of file CorrelatedExprs.cpp.


Function Documentation

static void CalcRegionExitBlocks ( BasicBlock Header,
BasicBlock BB,
std::set< BasicBlock * > &  Visited,
ETForest EF,
std::vector< BasicBlock * > &  RegionExitBlocks 
) [static]

Definition at line 686 of file CorrelatedExprs.cpp.

References BB, llvm::ETForestBase::dominates(), E, EF, llvm::succ_begin(), and llvm::succ_end().

static bool CheckCondition ( Constant Bound,
Constant C,
Instruction::BinaryOps  BO 
) [static]

Definition at line 1154 of file CorrelatedExprs.cpp.

References llvm::CallingConv::C, and Val.

static Value* getReplacementOrValue ( Value V,
RegionInfo &  RI 
) [static]

Definition at line 500 of file CorrelatedExprs.cpp.

References V.

static bool isBlockSimpleEnough ( BasicBlock BB  )  [static]

Definition at line 391 of file CorrelatedExprs.cpp.

References BB, llvm::BasicBlock::begin(), llvm::BasicBlock::front(), llvm::BranchInst::getCondition(), llvm::BasicBlock::getTerminator(), llvm::Value::hasOneUse(), llvm::BranchInst::isConditional(), and llvm::BasicBlock::size().


Variable Documentation

BasicBlock* BB

Definition at line 170 of file CorrelatedExprs.cpp.

Referenced by llvm::AliasSetTracker::add(), llvm::DominanceFrontierBase::addBasicBlock(), llvm::DominatorSetBase::addBasicBlock(), AddBlockAndPredsToSet(), llvm::Loop::addBlockEntry(), llvm::DominatorSetBase::addDominator(), llvm::PHINode::addIncoming(), llvm::ImmediateDominatorsBase::addNewBlock(), llvm::ETForestBase::addNewBlock(), llvm::addNodeToInterval(), ApproximateLoopSize(), AssociativeOpt(), BlockIsSimpleEnoughToThreadThrough(), llvm::BuildMI(), CalcRegionExitBlocks(), llvm::PostETForest::calculate(), llvm::AliasAnalysis::canBasicBlockModify(), CanPropagatePredecessorsForPHIs(), llvm::LoopInfo::changeLoopFor(), CheckForEscapingAllocas(), llvm::CloneBasicBlock(), llvm::CloneFunctionInto(), llvm::CloneTrace(), llvm::CloneTraceInto(), ComputeMaxOptionalArgsSize(), llvm::ConstantFoldTerminator(), llvm::Loop::contains(), llvm::Interval::contains(), llvm::ConvertExpressionToType(), ConvertOperandToType(), llvm::createBFS_DAGScheduler(), llvm::createBURRListDAGScheduler(), llvm::DominatorTreeBase::createNewNode(), llvm::createSimpleDAGScheduler(), createSlotMachine(), llvm::createTDListDAGScheduler(), llvm::DecomposeArrayRef(), llvm::ilist_traits< BasicBlock >::destroySentinel(), llvm::doDFS(), DominatesMergePoint(), EliminateBlockCases(), EmitSpecialCodeForMain(), llvm::ExtractBasicBlock(), FoldCondBranchOnPHI(), FoldTwoEntryPHINode(), FoldValueComparisonIntoPredecessors(), llvm::FunctionLoweringInfo::FunctionLoweringInfo(), llvm::ImmediateDominatorsBase::get(), llvm::PHINode::getBasicBlockIndex(), getBBVal(), llvm::ProfileInfoLoader::getBlockCounts(), llvm::IntervalPartition::getBlockInterval(), llvm::DominatorSetBase::getDominators(), llvm::ProfileInfoLoader::getEdgeCounts(), llvm::GraphTraits< const MachineBasicBlock * >::getEntryNode(), llvm::GraphTraits< MachineBasicBlock * >::getEntryNode(), llvm::GraphTraits< const BasicBlock * >::getEntryNode(), llvm::GraphTraits< BasicBlock * >::getEntryNode(), llvm::ProfileInfo::getExecutionCount(), getFnForValue(), GetIfCondition(), llvm::PHINode::getIncomingValueForBlock(), llvm::FunctionLiveVarInfo::getInSetOfBB(), llvm::FunctionLiveVarInfo::getLiveVarSetAfterMInst(), llvm::FunctionLiveVarInfo::getLiveVarSetBeforeMInst(), llvm::LoopInfo::getLoopDepth(), llvm::LoopInfo::getLoopFor(), getModuleFromVal(), llvm::ETForestBase::getNode(), llvm::DominatorTreeBase::getNode(), llvm::PostETForest::getNodeForBlock(), llvm::ETForest::getNodeForBlock(), llvm::getNodeHeader(), llvm::StableBasicBlockNumbering::getNumber(), llvm::FunctionLiveVarInfo::getOutSetOfBB(), llvm::getSourceGraphNode(), HandleInlinedInvoke(), llvm::SlotCalculator::incorporateFunction(), llvm::RSProfilers_std::IncrementCounterInBlock(), llvm::IncrementCounterInBlock(), llvm::InlineFunction(), llvm::X86TargetLowering::InsertAtEndOfBasicBlock(), llvm::PPCTargetLowering::InsertAtEndOfBasicBlock(), InsertCodeToShowFunctionEntry(), InsertCodeToShowFunctionExit(), InsertGEPComputeCode(), InsertInstrumentationCall(), InsertPrintInst(), InsertVerbosePrintInst(), llvm::InstrForest::InstrForest(), isBlockSimpleEnough(), llvm::Loop::isLoopExit(), llvm::LoopInfo::isLoopHeader(), llvm::DominatorSetBase::isReachable(), llvm::Interval::isSuccessor(), isTrivialLoopExitBlock(), isTrivialLoopExitBlockHelper(), isUsedOutsideOfDefiningBlock(), LinkFunctionBody(), LiveAtBBExit(), LoopValuesUsedOutsideLoop(), llvm::PPCTargetLowering::LowerArguments(), llvm::IA64TargetLowering::LowerArguments(), llvm::AlphaTargetLowering::LowerArguments(), MarkAliveBlocks(), SCCPSolver::MarkBlockExecutable(), MarkBlocksLiveIn(), llvm::Loop::moveToHeader(), llvm::MSchedGraphSB::MSchedGraphSB(), llvm::LoopInfo::operator[](), llvm::ETForestBase::operator[](), llvm::DominatorTreeBase::operator[](), llvm::ImmediateDominatorsBase::operator[](), llvm::BytecodeReader::ParseBasicBlock(), llvm::BytecodeReader::ParseFunctionBody(), llvm::BytecodeReader::ParseInstruction(), llvm::BytecodeReader::ParseInstructionList(), llvm::pred_begin(), llvm::pred_end(), llvm::MachineFunction::print(), llvm::PMDebug::PrintPassInformation(), ReleasePtrSeqNumbers(), llvm::LoopInfo::removeBlock(), llvm::Loop::removeBlockFromLoop(), llvm::PHINode::removeIncomingValue(), llvm::RemoveSuccessor(), ReplaceUsesOfBlockWith(), SCCPSolver::ResolveBranchesIn(), llvm::AlphaTargetLowering::restoreGP(), llvm::AlphaTargetLowering::restoreRA(), llvm::PeepholeOpts::runOnBasicBlock(), llvm::BasicBlockPassManager::runOnBasicBlock(), llvm::UnifyFunctionExitNodes::runOnFunction(), llvm::Inliner::runOnSCC(), llvm::BasicBlockPass::runPass(), llvm::ImmediateDominatorsBase::setImmediateDominator(), llvm::ETForestBase::setImmediateDominator(), llvm::PHINode::setIncomingBlock(), llvm::Value::setName(), llvm::SimplifyCFG(), SCCPSolver::Solve(), llvm::SplitCriticalEdge(), llvm::succ_begin(), llvm::succ_end(), TraceValuesAtBBExit(), TryToSimplifyUncondBranchFromEmptyBlock(), llvm::ETForestBase::updateDFSNumbers(), and llvm::AssemblyWriter::write().

ConstantRange Bounds

Definition at line 106 of file CorrelatedExprs.cpp.

Referenced by llvm::ScalarEvolution::print().

Statistic BranchRevectors("cee","Number of branches revectored") [static]

DominatorTree* DT

Definition at line 224 of file CorrelatedExprs.cpp.

Referenced by llvm::GraphTraits< DominatorTree * >::getEntryNode(), llvm::PromoteMemToReg(), llvm::PostDominanceFrontier::runOnFunction(), llvm::DominanceFrontier::runOnFunction(), and llvm::SplitCriticalEdge().

ETForest* EF

Definition at line 223 of file CorrelatedExprs.cpp.

Referenced by CalcRegionExitBlocks(), IVUseShouldUsePostIncValue(), LinkFunctionProtos(), and llvm::SplitCriticalEdge().

Statistic NumOperandsCann("cee","Number of operands canonicalized") [static]

Statistic NumSetCCRemoved("cee","Number of setcc instruction eliminated") [static]

std::map<Value*, unsigned> RankMap

Definition at line 221 of file CorrelatedExprs.cpp.

std::map<BasicBlock*, RegionInfo> RegionInfoMap

Definition at line 222 of file CorrelatedExprs.cpp.

Instruction::BinaryOps Rel

Definition at line 56 of file CorrelatedExprs.cpp.

std::vector<Relation> Relationships

Definition at line 102 of file CorrelatedExprs.cpp.

Value* Replacement

Definition at line 111 of file CorrelatedExprs.cpp.

Referenced by llvm::ConstantExpr::replaceUsesOfWithOnConstant(), llvm::ConstantPacked::replaceUsesOfWithOnConstant(), llvm::ConstantStruct::replaceUsesOfWithOnConstant(), llvm::ConstantArray::replaceUsesOfWithOnConstant(), and ResolveFunctions().

Value* Val

Definition at line 55 of file CorrelatedExprs.cpp.

ValueMapTy ValueMap

Definition at line 174 of file CorrelatedExprs.cpp.

Referenced by llvm::CloneFunction(), llvm::CloneModule(), llvm::CloneTrace(), and llvm::InlineFunction().

RegisterOpt<CEE> X("cee","Correlated Expression Elimination") [static]