LLVM API Documentation

BranchFolding.cpp File Reference

#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/ADT/STLExtras.h"

Include dependency graph for BranchFolding.cpp:

Go to the source code of this file.

Functions

FunctionPassllvm::createBranchFoldingPass ()
static void ReplaceUsesOfBlockWith (MachineBasicBlock *BB, MachineBasicBlock *Old, MachineBasicBlock *New, const TargetInstrInfo &TII)


Function Documentation

static void ReplaceUsesOfBlockWith ( MachineBasicBlock BB,
MachineBasicBlock Old,
MachineBasicBlock New,
const TargetInstrInfo TII 
) [static]

ReplaceUsesOfBlockWith - Given a machine basic block 'BB' that branched to 'Old', change the code and CFG so that it branches to 'New' instead.

Definition at line 78 of file BranchFolding.cpp.

References BB, llvm::BasicBlock::begin(), llvm::Function::end(), llvm::BasicBlock::end(), llvm::BasicBlock::getParent(), llvm::TargetInstrInfo::insertGoto(), llvm::TargetInstrInfo::isTerminatorInstr(), and TII.