LLVM  8.0.1
Macros | Functions | Variables
ImplicitNullChecks.cpp File Reference
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/None.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/MemoryLocation.h"
#include "llvm/CodeGen/FaultMaps.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineMemOperand.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/PseudoSourceValue.h"
#include "llvm/CodeGen/TargetInstrInfo.h"
#include "llvm/CodeGen/TargetOpcodes.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/DebugLoc.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/MC/MCInstrDesc.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/Pass.h"
#include "llvm/Support/CommandLine.h"
#include <cassert>
#include <cstdint>
#include <iterator>
Include dependency graph for ImplicitNullChecks.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "implicit-null-checks"
 

Functions

 STATISTIC (NumImplicitNullChecks, "Number of explicit null checks made implicit")
 
static bool AnyAliasLiveIn (const TargetRegisterInfo *TRI, MachineBasicBlock *MBB, unsigned Reg)
 
 INITIALIZE_PASS_BEGIN (ImplicitNullChecks, DEBUG_TYPE, "Implicit null checks", false, false) INITIALIZE_PASS_END(ImplicitNullChecks
 

Variables

static cl::opt< int > PageSize ("imp-null-check-page-size", cl::desc("The page size of the target in bytes"), cl::init(4096), cl::Hidden)
 
static cl::opt< unsignedMaxInstsToConsider ("imp-null-max-insts-to-consider", cl::desc("The max number of instructions to consider hoisting loads over " "(the algorithm is quadratic over this number)"), cl::Hidden, cl::init(8))
 
 DEBUG_TYPE
 
Implicit null checks
 
Implicit null false
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "implicit-null-checks"

Definition at line 74 of file ImplicitNullChecks.cpp.

Function Documentation

◆ AnyAliasLiveIn()

static bool AnyAliasLiveIn ( const TargetRegisterInfo TRI,
MachineBasicBlock MBB,
unsigned  Reg 
)
static

Definition at line 312 of file ImplicitNullChecks.cpp.

References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addMBB(), llvm::AAResults::alias(), llvm::TargetInstrInfo::analyzeBranchPredicate(), llvm::any_of(), assert(), llvm::ArrayRef< T >::begin(), llvm::BuildMI(), llvm::SmallVectorImpl< T >::emplace_back(), llvm::FaultMaps::FaultingLoad, llvm::FaultMaps::FaultingLoadStore, llvm::FaultMaps::FaultingStore, llvm::MCInstrInfo::get(), llvm::MachineBasicBlock::getBasicBlock(), llvm::MachineInstr::getDesc(), llvm::TargetInstrInfo::getMemOperandWithOffset(), llvm::MCInstrDesc::getNumDefs(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), I, llvm::TargetInstrInfo::insertBranch(), llvm::MachineBasicBlock::isLiveIn(), llvm::MachineInstr::isPredicable(), llvm::MachineOperand::isReg(), llvm::MCRegAliasIterator::isValid(), MaxInstsToConsider, llvm::MachineInstr::mayLoad(), llvm::MachineInstr::mayStore(), llvm::LLVMContext::MD_make_implicit, llvm::MachineInstr::memoperands(), llvm::MachineInstr::memoperands_empty(), NC, llvm::NoAlias, llvm::None, llvm::MachineInstr::operands(), PageSize, llvm::PPC::PRED_EQ, llvm::PPC::PRED_NE, llvm::MachineBasicBlock::pred_size(), llvm::SmallVectorTemplateBase< T >::push_back(), llvm::MachineBasicBlock::rbegin(), Reg, llvm::TargetRegisterInfo::regsOverlap(), llvm::TargetInstrInfo::removeBranch(), llvm::MachineOperand::setIsDead(), llvm::MachineOperand::setIsKill(), llvm::SmallVectorBase::size(), llvm::LocationSize::unknown(), and llvm::MachineInstr::uses().

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( ImplicitNullChecks  ,
DEBUG_TYPE  ,
"Implicit null checks ,
false  ,
false   
)

◆ STATISTIC()

STATISTIC ( NumImplicitNullChecks  ,
"Number of explicit null checks made implicit"   
)

Variable Documentation

◆ checks

Implicit null checks

Definition at line 722 of file ImplicitNullChecks.cpp.

◆ DEBUG_TYPE

DEBUG_TYPE

Definition at line 722 of file ImplicitNullChecks.cpp.

◆ false

Implicit null false

Definition at line 722 of file ImplicitNullChecks.cpp.

◆ MaxInstsToConsider

cl::opt<unsigned> MaxInstsToConsider("imp-null-max-insts-to-consider", cl::desc("The max number of instructions to consider hoisting loads over " "(the algorithm is quadratic over this number)"), cl::Hidden, cl::init(8))
static

Referenced by AnyAliasLiveIn().

◆ PageSize

cl::opt<int> PageSize("imp-null-check-page-size", cl::desc("The page size of the target in bytes"), cl::init(4096), cl::Hidden)
static