LLVM API Documentation
#include "llvm/Function.h"#include "llvm/CodeGen/Passes.h"#include "llvm/CodeGen/MachineModuleInfo.h"#include "llvm/CodeGen/MachineFunctionPass.h"#include "llvm/Target/TargetInstrInfo.h"#include "llvm/Target/TargetLowering.h"#include "llvm/Target/TargetMachine.h"#include "llvm/Support/CommandLine.h"#include "llvm/Support/Debug.h"#include "llvm/ADT/DepthFirstIterator.h"#include "llvm/ADT/Statistic.h"#include "llvm/ADT/STLExtras.h"
Go to the source code of this file.
Defines | |
| #define | DEBUG_TYPE "ifcvt" |
Functions | |
| STATISTIC (NumSimple,"Number of simple if-conversions performed") | |
| STATISTIC (NumSimpleFalse,"Number of simple (F) if-conversions performed") | |
| STATISTIC (NumTriangle,"Number of triangle if-conversions performed") | |
| STATISTIC (NumTriangleRev,"Number of triangle (R) if-conversions performed") | |
| STATISTIC (NumTriangleFalse,"Number of triangle (F) if-conversions performed") | |
| STATISTIC (NumTriangleFRev,"Number of triangle (F/R) if-conversions performed") | |
| STATISTIC (NumDiamonds,"Number of diamond if-conversions performed") | |
| STATISTIC (NumIfConvBBs,"Number of if-converted blocks") | |
| STATISTIC (NumDupBBs,"Number of duplicated blocks") | |
| FunctionPass * | llvm::createIfConverterPass () |
| IfConverter Pass - This pass performs machine code if conversion. | |
| static MachineBasicBlock * | findFalseBlock (MachineBasicBlock *BB, MachineBasicBlock *TrueBB) |
| static MachineBasicBlock * | getNextBlock (MachineBasicBlock *BB) |
| static MachineBasicBlock::iterator | firstNonBranchInst (MachineBasicBlock *BB, const TargetInstrInfo *TII) |
| static bool | canFallThroughTo (MachineBasicBlock *BB, MachineBasicBlock *ToBB) |
| static void | InsertUncondBranch (MachineBasicBlock *BB, MachineBasicBlock *ToBB, const TargetInstrInfo *TII) |
Variables | |
| static cl::opt< int > | IfCvtFnStart ("ifcvt-fn-start", cl::init(-1), cl::Hidden) |
| static cl::opt< int > | IfCvtFnStop ("ifcvt-fn-stop", cl::init(-1), cl::Hidden) |
| static cl::opt< int > | IfCvtLimit ("ifcvt-limit", cl::init(-1), cl::Hidden) |
| static cl::opt< bool > | DisableSimple ("disable-ifcvt-simple", cl::init(false), cl::Hidden) |
| static cl::opt< bool > | DisableSimpleF ("disable-ifcvt-simple-false", cl::init(false), cl::Hidden) |
| static cl::opt< bool > | DisableTriangle ("disable-ifcvt-triangle", cl::init(false), cl::Hidden) |
| static cl::opt< bool > | DisableTriangleR ("disable-ifcvt-triangle-rev", cl::init(false), cl::Hidden) |
| static cl::opt< bool > | DisableTriangleF ("disable-ifcvt-triangle-false", cl::init(false), cl::Hidden) |
| static cl::opt< bool > | DisableTriangleFR ("disable-ifcvt-triangle-false-rev", cl::init(false), cl::Hidden) |
| static cl::opt< bool > | DisableDiamond ("disable-ifcvt-diamond", cl::init(false), cl::Hidden) |
| static RegisterPass< IfConverter > | X ("if-converter","If Converter") |
| #define DEBUG_TYPE "ifcvt" |
Definition at line 14 of file IfConversion.cpp.
| static bool canFallThroughTo | ( | MachineBasicBlock * | BB, | |
| MachineBasicBlock * | ToBB | |||
| ) | [static] |
canFallThroughTo - Returns true either if ToBB is the next block after BB or that all the intervening blocks are empty (given BB can fall through to its next block).
Definition at line 794 of file IfConversion.cpp.
References E, llvm::MachineFunction::end(), and llvm::MachineBasicBlock::getParent().
| static MachineBasicBlock* findFalseBlock | ( | MachineBasicBlock * | BB, | |
| MachineBasicBlock * | TrueBB | |||
| ) | [static] |
findFalseBlock - BB has a fallthrough. Find its 'false' successor given its 'true' successor.
Definition at line 366 of file IfConversion.cpp.
References E, llvm::MachineBasicBlock::succ_begin(), and llvm::MachineBasicBlock::succ_end().
| static MachineBasicBlock::iterator firstNonBranchInst | ( | MachineBasicBlock * | BB, | |
| const TargetInstrInfo * | TII | |||
| ) | [static] |
Definition at line 466 of file IfConversion.cpp.
References llvm::MachineBasicBlock::begin(), and llvm::MachineBasicBlock::end().
| static MachineBasicBlock* getNextBlock | ( | MachineBasicBlock * | BB | ) | [inline, static] |
getNextBlock - Returns the next block in the function blocks ordering. If it is the end, returns NULL.
Definition at line 391 of file IfConversion.cpp.
References E, llvm::MachineFunction::end(), and llvm::MachineBasicBlock::getParent().
| static void InsertUncondBranch | ( | MachineBasicBlock * | BB, | |
| MachineBasicBlock * | ToBB, | |||
| const TargetInstrInfo * | TII | |||
| ) | [static] |
InsertUncondBranch - Inserts an unconditional branch from BB to ToBB.
Definition at line 820 of file IfConversion.cpp.
References llvm::TargetInstrInfo::InsertBranch().
| STATISTIC | ( | NumDupBBs | , | |
| "Number of duplicated blocks" | ||||
| ) |
| STATISTIC | ( | NumIfConvBBs | , | |
| "Number of if-converted blocks" | ||||
| ) |
| STATISTIC | ( | NumDiamonds | , | |
| "Number of diamond if-conversions performed" | ||||
| ) |
| STATISTIC | ( | NumTriangleFRev | , | |
| "Number of triangle (F/R) if-conversions performed" | ||||
| ) |
| STATISTIC | ( | NumTriangleFalse | , | |
| "Number of triangle (F) if-conversions performed" | ||||
| ) |
| STATISTIC | ( | NumTriangleRev | , | |
| "Number of triangle (R) if-conversions performed" | ||||
| ) |
| STATISTIC | ( | NumTriangle | , | |
| "Number of triangle if-conversions performed" | ||||
| ) |
| STATISTIC | ( | NumSimpleFalse | , | |
| "Number of simple (F) if-conversions performed" | ||||
| ) |
| STATISTIC | ( | NumSimple | , | |
| "Number of simple if-conversions performed" | ||||
| ) |
Definition at line 103 of file IfConversion.cpp.
Referenced by AddBlockAndPredsToSet(), ApproximateLoopSize(), llvm::DominanceFrontier::calculate(), ChangeToCall(), ChangeToUnreachable(), llvm::CloneFunctionInto(), llvm::CloneLoop(), llvm::CloneTrace(), llvm::CloneTraceInto(), llvm::DominatorTreeBase< llvm::MachineBasicBlock >::compare(), createSlotTracker(), llvm::DFSPass(), llvm::SelectionDAGLowering::EmitBranchForMergedCondition(), llvm::findStopPoint(), FoldBranchToCommonDest(), FoldCondBranchOnPHI(), FoldTwoEntryPHINode(), FoldValueComparisonIntoPredecessors(), llvm::MachineBasicBlock::getBasicBlock(), llvm::ProfileInfoLoader::getBlockCounts(), llvm::ProfileInfoLoader::getEdgeCounts(), getModuleFromVal(), getSymTab(), HandleInlinedInvoke(), llvm::ValueEnumerator::incorporateFunction(), llvm::InlineFunction(), llvm::BasicInlinerImpl::inlineFunctions(), llvm::LoopBase< BlockT >::isLCSSAForm(), isUsedOutsideOfDefiningBlock(), LinkFunctionBody(), LLVMPositionBuilder(), LLVMPositionBuilderAtEnd(), llvm::IA64TargetLowering::LowerArguments(), llvm::MachineFunction::print(), llvm::ARMRegisterInfo::processFunctionBeforeCalleeSavedScan(), llvm::RemoveSuccessor(), RemoveUnreachableBlocksFromFn(), llvm::UnifyFunctionExitNodes::runOnFunction(), llvm::DebugLabelFolder::runOnMachineFunction(), llvm::Inliner::runOnSCC(), llvm::FunctionLoweringInfo::set(), SimplifyCondBranchToCondBranch(), llvm::UnrollLoop(), llvm::ValueEnumerator::ValueEnumerator(), and WriteFunction().
| std::vector<BBInfo> BBAnalysis |
BBAnalysis - Results of if-conversion feasibility analysis indexed by basic block number.
Definition at line 142 of file IfConversion.cpp.
| BBInfo& BBI |
Definition at line 127 of file IfConversion.cpp.
Referenced by BlockIsSimpleEnoughToThreadThrough(), CanPropagatePredecessorsForPHIs(), ChangeToUnreachable(), llvm::SelectionDAGLowering::FindMergedConditions(), FoldCondBranchOnPHI(), getCommonReturnValue(), HandleInlinedInvoke(), HoistThenElseCodeToIf(), MarkAliveBlocks(), llvm::MachineBasicBlock::moveAfter(), SafeToMergeTerminators(), llvm::SimplifyCFG(), SimplifyCondBranchToTwoReturns(), and SpeculativelyExecuteBB().
Definition at line 106 of file IfConversion.cpp.
Referenced by SimplifyCondBranchToTwoReturns(), SpeculativelyExecuteBB(), llvm::SelectionDAGLowering::visitJumpTableHeader(), and llvm::SelectionDAGLowering::visitSwitchCase().
| bool CannotBeCopied |
Definition at line 100 of file IfConversion.cpp.
| bool ClobbersPred |
Definition at line 101 of file IfConversion.cpp.
cl::opt<bool> DisableDiamond("disable-ifcvt-diamond", cl::init(false), cl::Hidden) [static] |
cl::opt<bool> DisableSimple("disable-ifcvt-simple", cl::init(false), cl::Hidden) [static] |
cl::opt<bool> DisableSimpleF("disable-ifcvt-simple-false", cl::init(false), cl::Hidden) [static] |
cl::opt<bool> DisableTriangle("disable-ifcvt-triangle", cl::init(false), cl::Hidden) [static] |
cl::opt<bool> DisableTriangleF("disable-ifcvt-triangle-false", cl::init(false), cl::Hidden) [static] |
cl::opt<bool> DisableTriangleFR("disable-ifcvt-triangle-false-rev", cl::init(false), cl::Hidden) [static] |
cl::opt<bool> DisableTriangleR("disable-ifcvt-triangle-rev", cl::init(false), cl::Hidden) [static] |
Definition at line 105 of file IfConversion.cpp.
| bool HasFallThrough |
Definition at line 98 of file IfConversion.cpp.
char ID [static] |
Definition at line 148 of file IfConversion.cpp.
cl::opt<int> IfCvtFnStart("ifcvt-fn-start", cl::init(-1), cl::Hidden) [static] |
cl::opt<int> IfCvtFnStop("ifcvt-fn-stop", cl::init(-1), cl::Hidden) [static] |
cl::opt<int> IfCvtLimit("ifcvt-limit", cl::init(-1), cl::Hidden) [static] |
| bool IsAnalyzed |
Definition at line 95 of file IfConversion.cpp.
| bool IsBeingAnalyzed |
Definition at line 94 of file IfConversion.cpp.
| bool IsBrAnalyzable |
Definition at line 97 of file IfConversion.cpp.
| bool IsDone |
Definition at line 93 of file IfConversion.cpp.
| bool IsEnqueued |
Definition at line 96 of file IfConversion.cpp.
| bool IsUnpredicable |
Definition at line 99 of file IfConversion.cpp.
| IfcvtKind Kind |
Definition at line 128 of file IfConversion.cpp.
Referenced by llvm::ScheduleDAGInstrs::BuildSchedGraph(), llvm::XCoreTargetAsmInfo::SectionFlagsForGlobal(), llvm::TargetAsmInfo::SectionFlagsForGlobal(), llvm::XCoreTargetAsmInfo::SelectSectionForGlobal(), llvm::TargetAsmInfo::SelectSectionForGlobal(), llvm::ELFTargetAsmInfo::SelectSectionForGlobal(), and llvm::DarwinTargetAsmInfo::SelectSectionForGlobal().
| bool MadeChange |
Definition at line 146 of file IfConversion.cpp.
| bool NeedSubsumsion |
Definition at line 129 of file IfConversion.cpp.
Definition at line 102 of file IfConversion.cpp.
Definition at line 130 of file IfConversion.cpp.
Definition at line 131 of file IfConversion.cpp.
Definition at line 107 of file IfConversion.cpp.
Referenced by llvm::VFCmpInst::getPredicate(), and llvm::VICmpInst::getPredicate().
| std::vector<MachineBasicBlock*> Roots |
Roots - Basic blocks that do not have successors. These are the starting points of Graph traversal.
Definition at line 138 of file IfConversion.cpp.
| const TargetInstrInfo* TII |
Definition at line 145 of file IfConversion.cpp.
| const TargetLowering* TLI |
Definition at line 144 of file IfConversion.cpp.
Referenced by llvm::RegsForValue::append(), llvm::SelectionDAG::ComputeMaskedBits(), llvm::SelectionDAG::ComputeNumSignBits(), llvm::createDefaultScheduler(), llvm::SelectionDAG::CreateStackTemporary(), llvm::SelectionDAG::getConstantPool(), llvm::SelectionDAG::getGlobalAddress(), llvm::SelectionDAG::getIntPtrConstant(), llvm::SelectionDAG::getMemcpy(), getMemcpyLoadsAndStores(), llvm::SelectionDAG::getMemmove(), getMemmoveLoadsAndStores(), llvm::SelectionDAG::getMemset(), getMemsetStores(), getMemsetValue(), llvm::SDNode::getOperationName(), llvm::SelectionDAG::getShiftAmountOperand(), PerformBTCombine(), and llvm::RegsForValue::RegsForValue().
Definition at line 104 of file IfConversion.cpp.
RegisterPass<IfConverter> X("if-converter","If Converter") [static] |