LLVM  9.0.0svn
Macros | Functions
X86CondBrFolding.cpp File Reference
#include "X86.h"
#include "X86InstrInfo.h"
#include "X86Subtarget.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/MachineBranchProbabilityInfo.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/Support/BranchProbability.h"
Include dependency graph for X86CondBrFolding.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "x86-condbr-folding"
 

Functions

 STATISTIC (NumFixedCondBrs, "Number of x86 condbr folded")
 
static void fixPHIsInSucc (MachineBasicBlock *MBB, MachineBasicBlock *OldMBB, MachineBasicBlock *NewMBB)
 
static bool setBranchProb (MachineBasicBlock *MBB, MachineBasicBlock *SuccMBB, BranchProbability Prob)
 
static MachineBasicBlock::iterator findUncondBrI (MachineBasicBlock *MBB)
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "x86-condbr-folding"

Definition at line 57 of file X86CondBrFolding.cpp.

Function Documentation

◆ findUncondBrI()

static MachineBasicBlock::iterator findUncondBrI ( MachineBasicBlock MBB)
inlinestatic

Definition at line 211 of file X86CondBrFolding.cpp.

References llvm::MachineInstrBuilder::addImm(), llvm::MachineBasicBlock::addSuccessor(), assert(), llvm::SmallVectorTemplateCommon< T >::back(), llvm::MachineBasicBlock::begin(), llvm::BuildMI(), llvm::X86::COND_E, llvm::X86::COND_G, llvm::X86::COND_GE, llvm::X86::COND_L, llvm::X86::COND_LE, llvm::X86::COND_NE, llvm::dbgs(), llvm::MachineBasicBlock::end(), llvm::MachineBasicBlock::erase(), llvm::MachineInstr::eraseFromParent(), llvm::find_if(), llvm::MachineBasicBlock::findDebugLoc(), fixPHIsInSucc(), llvm::SmallVectorTemplateCommon< T >::front(), llvm::X86::getCondFromBranch(), llvm::MachineOperand::getImm(), llvm::MachineInstrBuilder::getInstr(), llvm::X86Subtarget::getInstrInfo(), llvm::MachineBasicBlock::getNumber(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getSubtarget(), llvm::MachineBasicBlock::hasSuccessorProbabilities(), I, llvm::MachineBasicBlock::insert(), llvm::MachineOperand::isImm(), llvm::MachineBasicBlock::isSuccessor(), llvm::BranchProbability::isUnknown(), LLVM_DEBUG, llvm_unreachable, MI, Modified, llvm::MachineBasicBlock::normalizeSuccProbs(), llvm::MachineBasicBlock::pred_size(), llvm::MachineBasicBlock::push_back(), llvm::MachineInstr::removeFromParent(), llvm::MachineBasicBlock::removeSuccessor(), setBranchProb(), llvm::SmallVectorBase::size(), llvm::ARM_MB::ST, llvm::MachineBasicBlock::succ_size(), std::swap(), llvm::X86Subtarget::threewayBranchProfitable(), and TII.

◆ fixPHIsInSucc()

static void fixPHIsInSucc ( MachineBasicBlock MBB,
MachineBasicBlock OldMBB,
MachineBasicBlock NewMBB 
)
static

◆ setBranchProb()

static bool setBranchProb ( MachineBasicBlock MBB,
MachineBasicBlock SuccMBB,
BranchProbability  Prob 
)
inlinestatic

◆ STATISTIC()

STATISTIC ( NumFixedCondBrs  ,
"Number of x86 condbr folded"   
)