LLVM  11.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
[legend]
Collaboration diagram for llvm::ArgumentPromotionPass:
Collaboration graph
[legend]

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)
inline

Definition at line 28 of file ArgumentPromotion.h.

References areFunctionArgsABICompatible(), C, DL, F(), isDenselyPacked(), and run().

Member Function Documentation

◆ areFunctionArgsABICompatible()

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

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 842 of file ArgumentPromotion.cpp.

References llvm::TargetTransformInfo::areFunctionArgsABICompatible(), Callee, llvm::dyn_cast(), llvm::CallBase::getCalledFunction(), llvm::CallBase::getCaller(), and llvm::Value::uses().

Referenced by ArgumentPromotionPass(), and promoteArguments().

◆ isDenselyPacked()

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

◆ run()

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

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