LLVM API Documentation
#include "llvm/CodeGen/Passes.h"
#include "BranchFolding.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/MachineBranchProbabilityInfo.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/TargetSchedule.h"
#include "llvm/CodeGen/LiveRegUnits.h"
#include "llvm/MC/MCInstrItineraries.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetLowering.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/Target/TargetSubtargetInfo.h"
Go to the source code of this file.
Macros | |
#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") | |
STATISTIC (NumUnpred,"Number of true blocks of diamonds unpredicated") | |
static MachineBasicBlock * | findFalseBlock (MachineBasicBlock *BB, MachineBasicBlock *TrueBB) |
static MachineBasicBlock * | getNextBlock (MachineBasicBlock *BB) |
static bool | canFallThroughTo (MachineBasicBlock *BB, MachineBasicBlock *ToBB) |
static void | InsertUncondBranch (MachineBasicBlock *BB, MachineBasicBlock *ToBB, const TargetInstrInfo *TII) |
static void | UpdatePredRedefs (MachineInstr *MI, LiveRegUnits &Redefs, const TargetRegisterInfo *TRI) |
static void | RemoveKills (MachineInstr &MI, const LiveRegUnits &DontKill, const MCRegisterInfo &MCRI) |
static void | RemoveKills (MachineBasicBlock::iterator I, MachineBasicBlock::iterator E, const LiveRegUnits &DontKill, const MCRegisterInfo &MCRI) |
static bool | MaySpeculate (const MachineInstr *MI, SmallSet< unsigned, 4 > &LaterRedefs, 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 cl::opt< bool > | IfCvtBranchFold ("ifcvt-branch-fold", cl::init(true), cl::Hidden) |
#define DEBUG_TYPE "ifcvt" |
Definition at line 14 of file IfConversion.cpp.
|
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 922 of file IfConversion.cpp.
References llvm::MachineFunction::end(), llvm::MachineBasicBlock::getParent(), and llvm::next().
|
static |
findFalseBlock - BB has a fallthrough. Find its 'false' successor given its 'true' successor.
Definition at line 433 of file IfConversion.cpp.
References llvm::MachineBasicBlock::succ_begin(), and llvm::MachineBasicBlock::succ_end().
|
inlinestatic |
getNextBlock - Returns the next block in the function blocks ordering. If it is the end, returns NULL.
Definition at line 459 of file IfConversion.cpp.
References llvm::MachineFunction::end(), llvm::MachineBasicBlock::getParent(), and I.
|
static |
InsertUncondBranch - Inserts an unconditional branch from BB to ToBB.
Definition at line 953 of file IfConversion.cpp.
References llvm::TargetInstrInfo::InsertBranch().
|
static |
Definition at line 1458 of file IfConversion.cpp.
References llvm::SmallSet< T, N, C >::count(), llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isDef(), llvm::MachineOperand::isReg(), llvm::MachineInstr::isSafeToMove(), and SawStore.
|
static |
Remove kill flags from operands with a registers in the DontKill
set.
Definition at line 999 of file IfConversion.cpp.
References llvm::LiveRegUnits::contains(), and llvm::MachineOperandIteratorBase::isValid().
Referenced by RemoveKills().
|
static |
Walks a range of machine instructions and removes kill flags for registers in the DontKill
set.
Definition at line 1013 of file IfConversion.cpp.
References I, and RemoveKills().
STATISTIC | ( | NumSimple | , |
"Number of simple if-conversions performed" | |||
) |
STATISTIC | ( | NumTriangle | , |
"Number of triangle if-conversions performed" | |||
) |
STATISTIC | ( | NumTriangleRev | , |
"Number of triangle (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" | |||
) |
STATISTIC | ( | NumUnpred | , |
"Number of true blocks of diamonds unpredicated" | |||
) |
|
static |
Behaves like LiveRegUnits::StepForward() but also adds implicit uses to all values defined in MI which are not live/used by MI.
Definition at line 971 of file IfConversion.cpp.
References llvm::LiveRegUnits::addReg(), llvm::MachineInstrBuilder::addReg(), llvm::LiveRegUnits::contains(), llvm::MachineInstr::getParent(), llvm::MachineBasicBlock::getParent(), llvm::MachineOperand::getParent(), llvm::RegState::Implicit, llvm::MachineOperandIteratorBase::isValid(), llvm::A64CC::MI, llvm::LiveRegUnits::removeReg(), and llvm::RegState::Undef.
|
static |
|
static |
|
static |
|
static |