30 #define DEBUG_TYPE "expandmemcmp" 32 STATISTIC(NumMemCmpCalls,
"Number of memcmp calls");
33 STATISTIC(NumMemCmpNotConstant,
"Number of memcmp calls without constant size");
35 "Number of memcmp calls with size greater than max size");
36 STATISTIC(NumMemCmpInlined,
"Number of inlined memcmp calls");
40 cl::desc(
"The number of loads per basic block for inline expansion of " 41 "memcmp that is only being compared against zero."));
45 cl::desc(
"Set maximum number of loads used in expanded memcmp"));
49 cl::desc(
"Set maximum number of loads used in expanded memcmp for -Os/Oz"));
56 class MemCmpExpansion {
62 ResultBlock() =
default;
69 uint64_t NumLoadsNonOneByte;
70 const uint64_t NumLoadsPerBlockForZeroCmp;
71 std::vector<BasicBlock *> LoadCmpBlocks;
74 const bool IsUsedForZeroCmp;
81 LoadEntry(
unsigned LoadSize, uint64_t
Offset)
82 : LoadSize(LoadSize), Offset(Offset) {
91 LoadEntryVector LoadSequence;
93 void createLoadCmpBlocks();
94 void createResultBlock();
95 void setupResultBlockPHINodes();
96 void setupEndBlockPHINodes();
97 Value *getCompareLoadPairs(
unsigned BlockIndex,
unsigned &LoadIndex);
98 void emitLoadCompareBlock(
unsigned BlockIndex);
99 void emitLoadCompareBlockMultipleLoads(
unsigned BlockIndex,
100 unsigned &LoadIndex);
101 void emitLoadCompareByteBlock(
unsigned BlockIndex,
unsigned OffsetBytes);
102 void emitMemCmpResultBlock();
103 Value *getMemCmpExpansionZeroCase();
104 Value *getMemCmpEqZeroOneBlock();
105 Value *getMemCmpOneBlock();
107 uint64_t OffsetBytes);
109 static LoadEntryVector
111 unsigned MaxNumLoads,
unsigned &NumLoadsNonOneByte);
112 static LoadEntryVector
113 computeOverlappingLoadSequence(uint64_t Size,
unsigned MaxLoadSize,
114 unsigned MaxNumLoads,
115 unsigned &NumLoadsNonOneByte);
118 MemCmpExpansion(
CallInst *CI, uint64_t Size,
120 const bool IsUsedForZeroCmp,
const DataLayout &TheDataLayout);
122 unsigned getNumBlocks();
123 uint64_t getNumLoads()
const {
return LoadSequence.size(); }
125 Value *getMemCmpExpansion();
130 const unsigned MaxNumLoads,
unsigned &NumLoadsNonOneByte) {
131 NumLoadsNonOneByte = 0;
132 LoadEntryVector LoadSequence;
134 while (Size && !LoadSizes.
empty()) {
135 const unsigned LoadSize = LoadSizes.
front();
136 const uint64_t NumLoadsForThisSize = Size / LoadSize;
137 if (LoadSequence.size() + NumLoadsForThisSize > MaxNumLoads) {
144 if (NumLoadsForThisSize > 0) {
145 for (uint64_t
I = 0;
I < NumLoadsForThisSize; ++
I) {
146 LoadSequence.push_back({LoadSize, Offset});
150 ++NumLoadsNonOneByte;
151 Size = Size % LoadSize;
159 MemCmpExpansion::computeOverlappingLoadSequence(uint64_t Size,
160 const unsigned MaxLoadSize,
161 const unsigned MaxNumLoads,
162 unsigned &NumLoadsNonOneByte) {
164 if (Size < 2 || MaxLoadSize < 2)
169 const uint64_t NumNonOverlappingLoads = Size / MaxLoadSize;
170 assert(NumNonOverlappingLoads &&
"there must be at least one load");
173 Size = Size - NumNonOverlappingLoads * MaxLoadSize;
180 if ((NumNonOverlappingLoads + 1) > MaxNumLoads)
184 LoadEntryVector LoadSequence;
186 for (uint64_t
I = 0;
I < NumNonOverlappingLoads; ++
I) {
187 LoadSequence.push_back({MaxLoadSize, Offset});
188 Offset += MaxLoadSize;
192 assert(Size > 0 && Size < MaxLoadSize &&
"broken invariant");
193 LoadSequence.push_back({MaxLoadSize, Offset - (MaxLoadSize -
Size)});
194 NumLoadsNonOneByte = 1;
206 MemCmpExpansion::MemCmpExpansion(
209 const bool IsUsedForZeroCmp,
const DataLayout &TheDataLayout)
210 : CI(CI), Size(Size), MaxLoadSize(0), NumLoadsNonOneByte(0),
211 NumLoadsPerBlockForZeroCmp(Options.NumLoadsPerBlock),
212 IsUsedForZeroCmp(IsUsedForZeroCmp), DL(TheDataLayout), Builder(CI) {
213 assert(Size > 0 &&
"zero blocks");
219 assert(!LoadSizes.
empty() &&
"cannot load Size bytes");
220 MaxLoadSize = LoadSizes.
front();
222 unsigned GreedyNumLoadsNonOneByte = 0;
223 LoadSequence = computeGreedyLoadSequence(Size, LoadSizes, Options.
MaxNumLoads,
224 GreedyNumLoadsNonOneByte);
225 NumLoadsNonOneByte = GreedyNumLoadsNonOneByte;
230 (LoadSequence.empty() || LoadSequence.size() > 2)) {
231 unsigned OverlappingNumLoadsNonOneByte = 0;
232 auto OverlappingLoads = computeOverlappingLoadSequence(
233 Size, MaxLoadSize, Options.
MaxNumLoads, OverlappingNumLoadsNonOneByte);
234 if (!OverlappingLoads.empty() &&
235 (LoadSequence.empty() ||
236 OverlappingLoads.size() < LoadSequence.size())) {
237 LoadSequence = OverlappingLoads;
238 NumLoadsNonOneByte = OverlappingNumLoadsNonOneByte;
244 unsigned MemCmpExpansion::getNumBlocks() {
245 if (IsUsedForZeroCmp)
246 return getNumLoads() / NumLoadsPerBlockForZeroCmp +
247 (getNumLoads() % NumLoadsPerBlockForZeroCmp != 0 ? 1 : 0);
248 return getNumLoads();
251 void MemCmpExpansion::createLoadCmpBlocks() {
252 for (
unsigned i = 0; i < getNumBlocks(); i++) {
255 LoadCmpBlocks.push_back(BB);
259 void MemCmpExpansion::createResultBlock() {
260 ResBlock.BB = BasicBlock::Create(CI->
getContext(),
"res_block",
268 uint64_t OffsetBytes) {
269 if (OffsetBytes > 0) {
270 auto *ByteType = Type::getInt8Ty(CI->
getContext());
272 ByteType, Builder.
CreateBitCast(Source, ByteType->getPointerTo()),
282 void MemCmpExpansion::emitLoadCompareByteBlock(
unsigned BlockIndex,
283 unsigned OffsetBytes) {
287 getPtrToElementAtOffset(CI->
getArgOperand(0), LoadSizeType, OffsetBytes);
289 getPtrToElementAtOffset(CI->
getArgOperand(1), LoadSizeType, OffsetBytes);
298 PhiRes->
addIncoming(Diff, LoadCmpBlocks[BlockIndex]);
300 if (BlockIndex < (LoadCmpBlocks.size() - 1)) {
304 ConstantInt::get(Diff->
getType(), 0));
306 BranchInst::Create(EndBlock, LoadCmpBlocks[BlockIndex + 1], Cmp);
310 BranchInst *CmpBr = BranchInst::Create(EndBlock);
318 Value *MemCmpExpansion::getCompareLoadPairs(
unsigned BlockIndex,
319 unsigned &LoadIndex) {
320 assert(LoadIndex < getNumLoads() &&
321 "getCompareLoadPairs() called with no remaining loads");
322 std::vector<Value *> XorList, OrList;
323 Value *Diff =
nullptr;
325 const unsigned NumLoads =
326 std::min(getNumLoads() - LoadIndex, NumLoadsPerBlockForZeroCmp);
329 if (LoadCmpBlocks.empty())
334 Value *Cmp =
nullptr;
339 NumLoads == 1 ? nullptr
340 : IntegerType::get(CI->
getContext(), MaxLoadSize * 8);
341 for (
unsigned i = 0; i < NumLoads; ++i, ++LoadIndex) {
342 const LoadEntry &CurLoadEntry = LoadSequence[LoadIndex];
345 IntegerType::get(CI->
getContext(), CurLoadEntry.LoadSize * 8);
348 CurLoadEntry.Offset);
350 CurLoadEntry.Offset);
353 Value *LoadSrc1 =
nullptr;
354 if (
auto *Source1C = dyn_cast<Constant>(Source1))
357 LoadSrc1 = Builder.
CreateLoad(LoadSizeType, Source1);
359 Value *LoadSrc2 =
nullptr;
360 if (
auto *Source2C = dyn_cast<Constant>(Source2))
363 LoadSrc2 = Builder.
CreateLoad(LoadSizeType, Source2);
366 if (LoadSizeType != MaxLoadType) {
367 LoadSrc1 = Builder.
CreateZExt(LoadSrc1, MaxLoadType);
368 LoadSrc2 = Builder.
CreateZExt(LoadSrc2, MaxLoadType);
372 Diff = Builder.
CreateXor(LoadSrc1, LoadSrc2);
374 XorList.push_back(Diff);
381 auto pairWiseOr = [&](std::vector<Value *> &InList) -> std::vector<Value *> {
382 std::vector<Value *> OutList;
383 for (
unsigned i = 0; i < InList.size() - 1; i = i + 2) {
385 OutList.push_back(Or);
387 if (InList.size() % 2 != 0)
388 OutList.push_back(InList.back());
394 OrList = pairWiseOr(XorList);
397 while (OrList.size() != 1) {
398 OrList = pairWiseOr(OrList);
401 assert(Diff &&
"Failed to find comparison diff");
408 void MemCmpExpansion::emitLoadCompareBlockMultipleLoads(
unsigned BlockIndex,
409 unsigned &LoadIndex) {
410 Value *Cmp = getCompareLoadPairs(BlockIndex, LoadIndex);
412 BasicBlock *NextBB = (BlockIndex == (LoadCmpBlocks.size() - 1))
414 : LoadCmpBlocks[BlockIndex + 1];
417 BranchInst *CmpBr = BranchInst::Create(ResBlock.BB, NextBB, Cmp);
423 if (BlockIndex == LoadCmpBlocks.size() - 1) {
425 PhiRes->
addIncoming(Zero, LoadCmpBlocks[BlockIndex]);
438 void MemCmpExpansion::emitLoadCompareBlock(
unsigned BlockIndex) {
440 const LoadEntry &CurLoadEntry = LoadSequence[BlockIndex];
442 if (CurLoadEntry.LoadSize == 1) {
443 MemCmpExpansion::emitLoadCompareByteBlock(BlockIndex, CurLoadEntry.Offset);
448 IntegerType::get(CI->
getContext(), CurLoadEntry.LoadSize * 8);
449 Type *MaxLoadType = IntegerType::get(CI->
getContext(), MaxLoadSize * 8);
450 assert(CurLoadEntry.LoadSize <= MaxLoadSize &&
"Unexpected load type");
455 CurLoadEntry.Offset);
457 CurLoadEntry.Offset);
465 Intrinsic::bswap, LoadSizeType);
466 LoadSrc1 = Builder.
CreateCall(Bswap, LoadSrc1);
467 LoadSrc2 = Builder.
CreateCall(Bswap, LoadSrc2);
470 if (LoadSizeType != MaxLoadType) {
471 LoadSrc1 = Builder.
CreateZExt(LoadSrc1, MaxLoadType);
472 LoadSrc2 = Builder.
CreateZExt(LoadSrc2, MaxLoadType);
477 if (!IsUsedForZeroCmp) {
478 ResBlock.PhiSrc1->addIncoming(LoadSrc1, LoadCmpBlocks[BlockIndex]);
479 ResBlock.PhiSrc2->addIncoming(LoadSrc2, LoadCmpBlocks[BlockIndex]);
482 Value *Cmp = Builder.
CreateICmp(ICmpInst::ICMP_EQ, LoadSrc1, LoadSrc2);
483 BasicBlock *NextBB = (BlockIndex == (LoadCmpBlocks.size() - 1))
485 : LoadCmpBlocks[BlockIndex + 1];
488 BranchInst *CmpBr = BranchInst::Create(NextBB, ResBlock.BB, Cmp);
494 if (BlockIndex == LoadCmpBlocks.size() - 1) {
496 PhiRes->
addIncoming(Zero, LoadCmpBlocks[BlockIndex]);
503 void MemCmpExpansion::emitMemCmpResultBlock() {
506 if (IsUsedForZeroCmp) {
511 BranchInst *NewBr = BranchInst::Create(EndBlock);
525 BranchInst *NewBr = BranchInst::Create(EndBlock);
530 void MemCmpExpansion::setupResultBlockPHINodes() {
531 Type *MaxLoadType = IntegerType::get(CI->
getContext(), MaxLoadSize * 8);
535 Builder.
CreatePHI(MaxLoadType, NumLoadsNonOneByte,
"phi.src1");
537 Builder.
CreatePHI(MaxLoadType, NumLoadsNonOneByte,
"phi.src2");
540 void MemCmpExpansion::setupEndBlockPHINodes() {
545 Value *MemCmpExpansion::getMemCmpExpansionZeroCase() {
546 unsigned LoadIndex = 0;
549 for (
unsigned I = 0;
I < getNumBlocks(); ++
I) {
550 emitLoadCompareBlockMultipleLoads(
I, LoadIndex);
553 emitMemCmpResultBlock();
560 Value *MemCmpExpansion::getMemCmpEqZeroOneBlock() {
561 unsigned LoadIndex = 0;
562 Value *Cmp = getCompareLoadPairs(0, LoadIndex);
563 assert(LoadIndex == getNumLoads() &&
"some entries were not consumed");
569 Value *MemCmpExpansion::getMemCmpOneBlock() {
570 Type *LoadSizeType = IntegerType::get(CI->
getContext(), Size * 8);
575 if (Source1->getType() != LoadSizeType)
577 if (Source2->
getType() != LoadSizeType)
586 Intrinsic::bswap, LoadSizeType);
587 LoadSrc1 = Builder.
CreateCall(Bswap, LoadSrc1);
588 LoadSrc2 = Builder.
CreateCall(Bswap, LoadSrc2);
596 return Builder.
CreateSub(LoadSrc1, LoadSrc2);
609 return Builder.
CreateSub(ZextUGT, ZextULT);
614 Value *MemCmpExpansion::getMemCmpExpansion() {
616 if (getNumBlocks() != 1) {
619 setupEndBlockPHINodes();
626 if (!IsUsedForZeroCmp) setupResultBlockPHINodes();
629 createLoadCmpBlocks();
638 if (IsUsedForZeroCmp)
639 return getNumBlocks() == 1 ? getMemCmpEqZeroOneBlock()
640 : getMemCmpExpansionZeroCase();
642 if (getNumBlocks() == 1)
643 return getMemCmpOneBlock();
645 for (
unsigned I = 0;
I < getNumBlocks(); ++
I) {
646 emitLoadCompareBlock(
I);
649 emitMemCmpResultBlock();
738 NumMemCmpNotConstant++;
753 if (!Options)
return false;
765 MemCmpExpansion Expansion(CI, SizeVal, Options, IsUsedForZeroCmp, *DL);
768 if (Expansion.getNumLoads() == 0) {
769 NumMemCmpGreaterThanMax++;
775 Value *Res = Expansion.getMemCmpExpansion();
797 auto *TPC = getAnalysisIfAvailable<TargetPassConfig>();
802 TPC->getTM<
TargetMachine>().getSubtargetImpl(F)->getTargetLowering();
805 &getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(F);
807 &getAnalysis<TargetTransformInfoWrapperPass>().getTTI(F);
808 auto *PSI = &getAnalysis<ProfileSummaryInfoWrapperPass>().getPSI();
810 &getAnalysis<LazyBlockFrequencyInfoPass>().getBFI() :
812 auto PA =
runImpl(F, TLI, TTI, TL, PSI, BFI);
813 return !PA.areAllPreserved();
836 bool ExpandMemCmpPass::runOnBlock(
847 (Func == LibFunc_memcmp || Func == LibFunc_bcmp) &&
848 expandMemCmp(CI, TTI, TL, &DL, PSI, BFI)) {
861 bool MadeChanges =
false;
862 for (
auto BBIt = F.
begin(); BBIt != F.
end();) {
863 if (runOnBlock(*BBIt, TLI, TTI, TL, DL, PSI, BFI)) {
879 "Expand memcmp() to load/stores",
false,
false)
888 return new ExpandMemCmpPass();
const T & front() const
front - Get the first element.
SymbolTableList< Instruction >::iterator eraseFromParent()
This method unlinks 'this' from the containing basic block and deletes it.
A parsed version of the target data layout string in and methods for querying it. ...
Value * CreateConstGEP1_64(Type *Ty, Value *Ptr, uint64_t Idx0, const Twine &Name="")
Value * CreateICmp(CmpInst::Predicate P, Value *LHS, Value *RHS, const Twine &Name="")
static bool runImpl(Function &F, TargetLibraryInfo &TLI, DominatorTree &DT)
This is the entry point for all transforms.
void addIncoming(Value *V, BasicBlock *BB)
Add an incoming value to the end of the PHI list.
bool isOnlyUsedInZeroEqualityComparison(const Instruction *CxtI)
Value * CreateICmpNE(Value *LHS, Value *RHS, const Twine &Name="")
This is an alternative analysis pass to BlockFrequencyInfoWrapperPass.
This class represents lattice values for constants.
Value * CreateICmpULT(Value *LHS, Value *RHS, const Twine &Name="")
LoadInst * CreateLoad(Type *Ty, Value *Ptr, const char *Name)
Provided to resolve 'CreateLoad(Ty, Ptr, "...")' correctly, instead of converting the string to 'bool...
Value * CreateXor(Value *LHS, Value *RHS, const Twine &Name="")
bool hasOptSize() const
Optimize this function for size (-Os) or minimum size (-Oz).
Analysis providing profile information.
INITIALIZE_PASS_BEGIN(ExpandMemCmpPass, "expandmemcmp", "Expand memcmp() to load/stores", false, false) INITIALIZE_PASS_END(ExpandMemCmpPass
This class represents a function call, abstracting a target machine's calling convention.
FunctionPass * createExpandMemCmpPass()
LLVMContext & getContext() const
All values hold a context through their type.
STATISTIC(NumFunctions, "Total number of functions")
const Instruction * getTerminator() const LLVM_READONLY
Returns the terminator instruction if the block is well formed or null if the block is not well forme...
void setSuccessor(unsigned Idx, BasicBlock *BB)
Update the specified successor to point at the provided block.
IntegerType * getInt32Ty()
Fetch the type representing a 32-bit integer.
Value * getArgOperand(unsigned i) const
AnalysisUsage & addRequired()
#define INITIALIZE_PASS_DEPENDENCY(depName)
const DataLayout & getDataLayout() const
Get the data layout for the module's target platform.
An analysis pass based on legacy pass manager to deliver ProfileSummaryInfo.
PointerType * getPointerTo(unsigned AddrSpace=0) const
Return a pointer to the current type.
void initializeExpandMemCmpPassPass(PassRegistry &)
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
Value * CreateBitCast(Value *V, Type *DestTy, const Twine &Name="")
virtual void getAnalysisUsage(AnalysisUsage &) const
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
Type * getType() const
All values are typed, get the type of this value.
static cl::opt< unsigned > MaxLoadsPerMemcmpOptSize("max-loads-per-memcmp-opt-size", cl::Hidden, cl::desc("Set maximum number of loads used in expanded memcmp for -Os/Oz"))
Value * CreateICmpUGT(Value *LHS, Value *RHS, const Twine &Name="")
Predicate all(Predicate P0, Predicate P1)
True iff P0 and P1 are true.
bool isLittleEndian() const
Layout endianness...
Value * CreateSub(Value *LHS, Value *RHS, const Twine &Name="", bool HasNUW=false, bool HasNSW=false)
void SetCurrentDebugLocation(DebugLoc L)
Set location information used by debugging information.
void replaceAllUsesWith(Value *V)
Change all uses of this to point to a new Value.
Value * CreateZExt(Value *V, Type *DestTy, const Twine &Name="")
Function * getDeclaration(Module *M, ID id, ArrayRef< Type *> Tys=None)
Create or insert an LLVM Function declaration for an intrinsic, and return it.
void SetInsertPoint(BasicBlock *TheBB)
This specifies that created instructions should be appended to the end of the specified block...
static PreservedAnalyses none()
Convenience factory function for the empty preserved set.
static cl::opt< unsigned > MaxLoadsPerMemcmp("max-loads-per-memcmp", cl::Hidden, cl::desc("Set maximum number of loads used in expanded memcmp"))
Value * CreateOr(Value *LHS, Value *RHS, const Twine &Name="")
bool hasProfileSummary()
Returns true if profile summary is available.
BlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate IR basic block frequen...
initializer< Ty > init(const Ty &Val)
uint64_t getZExtValue() const
Return the constant as a 64-bit unsigned integer value after it has been zero extended as appropriate...
A set of analyses that are preserved following a run of a transformation pass.
* if(!EatIfPresent(lltok::kw_thread_local)) return false
ParseOptionalThreadLocal := /*empty.
LLVM Basic Block Representation.
The instances of the Type class are immutable: once they are created, they are never changed...
Conditional or Unconditional Branch instruction.
Value * CreateSelect(Value *C, Value *True, Value *False, const Twine &Name="", Instruction *MDFrom=nullptr)
const Instruction & front() const
Represent the analysis usage information of a pass.
FunctionPass class - This class is used to implement most global optimizations.
Class to represent integer types.
Expand memcmp() to load/stores"
const Function * getFunction() const
Return the function this instruction belongs to.
Constant * ConstantFoldLoadFromConstPtr(Constant *C, Type *Ty, const DataLayout &DL)
ConstantFoldLoadFromConstPtr - Return the value that a load from C would produce if it is constant an...
INITIALIZE_PASS_END(RegBankSelect, DEBUG_TYPE, "Assign register bank of generic virtual registers", false, false) RegBankSelect
PHINode * CreatePHI(Type *Ty, unsigned NumReservedValues, const Twine &Name="")
Iterator for intrusive lists based on ilist_node.
This is the shared class of boolean and integer constants.
static cl::opt< unsigned > MemCmpEqZeroNumLoadsPerBlock("memcmp-num-loads-per-block", cl::Hidden, cl::init(1), cl::desc("The number of loads per basic block for inline expansion of " "memcmp that is only being compared against zero."))
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Provides information about what library functions are available for the current target.
const Module * getModule() const
Return the module owning the function this instruction belongs to or nullptr it the function does not...
bool shouldOptimizeForSize(const MachineFunction *MF, ProfileSummaryInfo *PSI, const MachineBlockFrequencyInfo *BFI, PGSOQueryType QueryType=PGSOQueryType::Other)
Returns true if machine function MF is suggested to be size-optimized based on the profile...
bool getLibFunc(StringRef funcName, LibFunc &F) const
Searches for a particular function name.
static void getLazyBFIAnalysisUsage(AnalysisUsage &AU)
Helper for client passes to set up the analysis usage on behalf of this pass.
const DebugLoc & getDebugLoc() const
Return the debug location for this node as a DebugLoc.
ArrayRef< T > drop_front(size_t N=1) const
Drop the first N elements of the array.
Establish a view to a call site for examination.
const Function * getParent() const
Return the enclosing method, or null if none.
bool hasMinSize() const
Optimize this function for minimum size (-Oz).
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
CallInst * CreateCall(FunctionType *FTy, Value *Callee, ArrayRef< Value *> Args=None, const Twine &Name="", MDNode *FPMathTag=nullptr)
BasicBlock * splitBasicBlock(iterator I, const Twine &BBName="")
Split the basic block into two basic blocks at the specified instruction.
InstTy * Insert(InstTy *I, const Twine &Name="") const
Insert and return the specified instruction.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Module * getParent()
Get the module that this global value is contained inside of...
LLVM Value Representation.
virtual bool runOnFunction(Function &F)=0
runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass...
Primary interface to the complete machine description for the target machine.
bool skipFunction(const Function &F) const
Optional passes call this function to check whether the pass should be skipped.
bool empty() const
empty - Check if the array is empty.
This file describes how to lower LLVM code to machine code.
const BasicBlock * getParent() const