LLVM  13.0.0git
Public Member Functions | Static Public Member Functions | List of all members
llvm::ArgumentPromotionPass Class Reference

Argument promotion pass. More...

#include "llvm/Transforms/IPO/ArgumentPromotion.h"

Inheritance diagram for llvm::ArgumentPromotionPass:
Inheritance graph
Collaboration diagram for llvm::ArgumentPromotionPass:
Collaboration graph

Public Member Functions

 ArgumentPromotionPass (unsigned MaxElements=3u)
PreservedAnalyses run (LazyCallGraph::SCC &C, CGSCCAnalysisManager &AM, LazyCallGraph &CG, CGSCCUpdateResult &UR)

Static Public Member Functions

static bool areFunctionArgsABICompatible (const Function &F, const TargetTransformInfo &TTI, SmallPtrSetImpl< Argument * > &ArgsToPromote, SmallPtrSetImpl< Argument * > &ByValArgsToTransform)
 Check if callers and the callee F agree how promoted arguments would be passed. More...
static bool isDenselyPacked (Type *type, const DataLayout &DL)
 Checks if a type could have padding bytes. More...
- Static Public Member Functions inherited from llvm::PassInfoMixin< ArgumentPromotionPass >
static StringRef name ()
 Gets the name of the pass we are mixed into. More...

Detailed Description

Argument promotion pass.

This pass walks the functions in each SCC and for each one tries to transform it and all of its callers to replace indirect arguments with direct (by-value) arguments.

Definition at line 24 of file ArgumentPromotion.h.

Constructor & Destructor Documentation

◆ ArgumentPromotionPass()

llvm::ArgumentPromotionPass::ArgumentPromotionPass ( unsigned  MaxElements = 3u)

Definition at line 28 of file ArgumentPromotion.h.

Member Function Documentation

◆ areFunctionArgsABICompatible()

bool ArgumentPromotionPass::areFunctionArgsABICompatible ( const Function F,
const TargetTransformInfo TTI,
SmallPtrSetImpl< Argument * > &  ArgsToPromote,
SmallPtrSetImpl< Argument * > &  ByValArgsToTransform 

Check if callers and the callee F agree how promoted arguments would be passed.

The ones that they do not agree on are eliminated from the sets but the return value has to be observed as well.

Definition at line 843 of file ArgumentPromotion.cpp.

References llvm::TargetTransformInfo::areFunctionArgsABICompatible(), Callee, F, llvm::CallBase::getCalledFunction(), and llvm::CallBase::getCaller().

Referenced by promoteArguments().

◆ isDenselyPacked()

bool ArgumentPromotionPass::isDenselyPacked ( Type type,
const DataLayout DL 

Checks if a type could have padding bytes.

Definition at line 771 of file ArgumentPromotion.cpp.

References DL, E, llvm::StructLayout::getElementOffsetInBits(), llvm::StructType::getElementType(), llvm::StructType::getNumElements(), and i.

Referenced by promoteArguments().

◆ run()

PreservedAnalyses ArgumentPromotionPass::run ( LazyCallGraph::SCC C,
CGSCCAnalysisManager AM,
LazyCallGraph CG,
CGSCCUpdateResult UR 

The documentation for this class was generated from the following files: