LLVM 20.0.0git
Public Types | Public Member Functions | Public Attributes | List of all members
llvm::AttributorConfig Struct Reference

Configuration for the Attributor. More...

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

Public Types

using OptimizationRemarkGetter = function_ref< OptimizationRemarkEmitter &(Function *)>
 A callback function that returns an ORE object from a Function pointer.
 
using IPOAmendableCBTy = function_ref< bool(const Function &F)>
 

Public Member Functions

 AttributorConfig (CallGraphUpdater &CGUpdater)
 

Public Attributes

bool IsModulePass = true
 Is the user of the Attributor a module pass or not.
 
bool DeleteFns = true
 Flag to determine if we can delete functions or keep dead ones around.
 
bool RewriteSignatures = true
 Flag to determine if we rewrite function signatures.
 
bool DefaultInitializeLiveInternals = true
 Flag to determine if we want to initialize all default AAs for an internal function marked live.
 
bool UseLiveness = true
 Flag to determine if we should skip all liveness checks early on.
 
bool IsClosedWorldModule = false
 Flag to indicate if the entire world is contained in this module, that is, no outside functions exist.
 
std::function< void(Attributor &A, const Function &F)> InitializationCallback
 Callback function to be invoked on internal functions marked live.
 
std::function< bool(Attributor &A, const AbstractAttribute &AA, CallBase &CB, Function &AssumedCallee, unsigned NumAssumedCallees)> IndirectCalleeSpecializationCallback = nullptr
 Callback function to determine if an indirect call targets should be made direct call targets (with an if-cascade).
 
CallGraphUpdaterCGUpdater
 Helper to update an underlying call graph and to delete functions.
 
DenseSet< const char * > * Allowed = nullptr
 If not null, a set limiting the attribute opportunities.
 
std::optional< unsignedMaxFixpointIterations
 Maximum number of iterations to run until fixpoint.
 
OptimizationRemarkGetter OREGetter = nullptr
 
const charPassName = nullptr
 }
 
IPOAmendableCBTy IPOAmendableCB
 

Detailed Description

Configuration for the Attributor.

Definition at line 1422 of file Attributor.h.

Member Typedef Documentation

◆ IPOAmendableCBTy

Definition at line 1481 of file Attributor.h.

◆ OptimizationRemarkGetter

A callback function that returns an ORE object from a Function pointer.

{

Definition at line 1473 of file Attributor.h.

Constructor & Destructor Documentation

◆ AttributorConfig()

llvm::AttributorConfig::AttributorConfig ( CallGraphUpdater CGUpdater)
inline

Definition at line 1424 of file Attributor.h.

Member Data Documentation

◆ Allowed

DenseSet<const char *>* llvm::AttributorConfig::Allowed = nullptr

If not null, a set limiting the attribute opportunities.

Definition at line 1466 of file Attributor.h.

Referenced by llvm::Attributor::shouldInitialize().

◆ CGUpdater

CallGraphUpdater& llvm::AttributorConfig::CGUpdater

Helper to update an underlying call graph and to delete functions.

Definition at line 1463 of file Attributor.h.

◆ DefaultInitializeLiveInternals

bool llvm::AttributorConfig::DefaultInitializeLiveInternals = true

Flag to determine if we want to initialize all default AAs for an internal function marked live.

See also: InitializationCallback>

Definition at line 1443 of file Attributor.h.

Referenced by llvm::Attributor::markLiveInternalFunction(), llvm::OpenMPOptCGSCCPass::run(), and llvm::OpenMPOptPass::run().

◆ DeleteFns

bool llvm::AttributorConfig::DeleteFns = true

Flag to determine if we can delete functions or keep dead ones around.

Definition at line 1436 of file Attributor.h.

Referenced by llvm::Attributor::deleteAfterManifest().

◆ IndirectCalleeSpecializationCallback

std::function<bool(Attributor &A, const AbstractAttribute &AA, CallBase &CB, Function &AssumedCallee, unsigned NumAssumedCallees)> llvm::AttributorConfig::IndirectCalleeSpecializationCallback = nullptr

Callback function to determine if an indirect call targets should be made direct call targets (with an if-cascade).

Definition at line 1460 of file Attributor.h.

Referenced by llvm::Attributor::shouldSpecializeCallSiteForCallee().

◆ InitializationCallback

std::function<void(Attributor &A, const Function &F)> llvm::AttributorConfig::InitializationCallback
Initial value:
=
nullptr

Callback function to be invoked on internal functions marked live.

Definition at line 1453 of file Attributor.h.

Referenced by llvm::Attributor::markLiveInternalFunction(), llvm::OpenMPOptCGSCCPass::run(), and llvm::OpenMPOptPass::run().

◆ IPOAmendableCB

IPOAmendableCBTy llvm::AttributorConfig::IPOAmendableCB

◆ IsClosedWorldModule

bool llvm::AttributorConfig::IsClosedWorldModule = false

Flag to indicate if the entire world is contained in this module, that is, no outside functions exist.

Definition at line 1450 of file Attributor.h.

Referenced by llvm::Attributor::isClosedWorldModule().

◆ IsModulePass

bool llvm::AttributorConfig::IsModulePass = true

Is the user of the Attributor a module pass or not.

This determines what IR we can look at and modify. If it is a module pass we might deduce facts outside the initial function set and modify functions outside that set, but only as part of the optimization of the functions in the initial function set. For CGSCC passes we can look at the IR of the module slice but never run any deduction, or perform any modification, outside the initial function set (which we assume is the SCC).

Definition at line 1433 of file Attributor.h.

Referenced by llvm::Attributor::isModulePass(), llvm::OpenMPOptCGSCCPass::run(), and llvm::OpenMPOptPass::run().

◆ MaxFixpointIterations

std::optional<unsigned> llvm::AttributorConfig::MaxFixpointIterations

Maximum number of iterations to run until fixpoint.

Definition at line 1469 of file Attributor.h.

Referenced by llvm::OpenMPOptCGSCCPass::run(), and llvm::OpenMPOptPass::run().

◆ OREGetter

OptimizationRemarkGetter llvm::AttributorConfig::OREGetter = nullptr

◆ PassName

const char* llvm::AttributorConfig::PassName = nullptr

}

The name of the pass running the attributor, used to emit remarks.

Definition at line 1479 of file Attributor.h.

Referenced by llvm::Attributor::emitRemark(), llvm::OpenMPOptCGSCCPass::run(), and llvm::OpenMPOptPass::run().

◆ RewriteSignatures

bool llvm::AttributorConfig::RewriteSignatures = true

Flag to determine if we rewrite function signatures.

Definition at line 1439 of file Attributor.h.

Referenced by llvm::Attributor::isValidFunctionSignatureRewrite(), llvm::OpenMPOptCGSCCPass::run(), and llvm::OpenMPOptPass::run().

◆ UseLiveness

bool llvm::AttributorConfig::UseLiveness = true

Flag to determine if we should skip all liveness checks early on.

Definition at line 1446 of file Attributor.h.

Referenced by llvm::Attributor::isAssumedDead().


The documentation for this struct was generated from the following file: