class TargetIRAnalysis
Declaration
class TargetIRAnalysis : public AnalysisInfoMixin { /* full declaration omitted */ };
Description
Analysis pass providing the \c TargetTransformInfo. The core idea of the TargetIRAnalysis is to expose an interface through which LLVM targets can analyze and provide information about the middle end's target-independent IR. This supports use cases such as target-aware cost modeling of IR constructs. This is a function analysis because much of the cost modeling for targets is done in a subtarget specific way and LLVM supports compiling different functions targeting different subtargets in order to support runtime dispatch according to the observed subtarget.
Declared at: llvm/include/llvm/Analysis/TargetTransformInfo.h:2503
Inherits from: AnalysisInfoMixin
Member Variables
- private std::function<Result(const Function&)> TTICallback
- FIXME: Should we really use std::function? It's relatively inefficient. It might be possible to arrange for even stateful callbacks to outlive the analysis and thus use a function_ref which would be lighter weight. This may also be less error prone as the callback is likely to reference the external TargetMachine, and that reference needs to never dangle.
- private static llvm::AnalysisKey Key
Method Overview
- public TargetIRAnalysis()
- public TargetIRAnalysis(std::function<Result (const Function &)> TTICallback)
- public TargetIRAnalysis(const llvm::TargetIRAnalysis & Arg)
- public TargetIRAnalysis(llvm::TargetIRAnalysis && Arg)
- private static llvm::TargetIRAnalysis::Result getDefaultTTI(const llvm::Function & F)
- public llvm::TargetIRAnalysis::Result run(const llvm::Function & F, llvm::FunctionAnalysisManager &)
Methods
¶TargetIRAnalysis()
TargetIRAnalysis()
Description
Default construct a target IR analysis. This will use the module's datalayout to construct a baseline conservative TTI result.
Declared at: llvm/include/llvm/Analysis/TargetTransformInfo.h:2511
¶TargetIRAnalysis(
std::function<Result(const Function&)>
TTICallback)
TargetIRAnalysis(
std::function<Result(const Function&)>
TTICallback)
Description
Construct an IR analysis pass around a target-provide callback. The callback will be called with a particular function for which the TTI is needed and must return a TTI object for that function.
Declared at: llvm/include/llvm/Analysis/TargetTransformInfo.h:2517
Parameters
- std::function<Result(const Function&)> TTICallback
¶TargetIRAnalysis(
const llvm::TargetIRAnalysis& Arg)
TargetIRAnalysis(
const llvm::TargetIRAnalysis& Arg)
Declared at: llvm/include/llvm/Analysis/TargetTransformInfo.h:2520
Parameters
- const llvm::TargetIRAnalysis& Arg
¶TargetIRAnalysis(llvm::TargetIRAnalysis&& Arg)
TargetIRAnalysis(llvm::TargetIRAnalysis&& Arg)
Declared at: llvm/include/llvm/Analysis/TargetTransformInfo.h:2522
Parameters
- llvm::TargetIRAnalysis&& Arg
¶static llvm::TargetIRAnalysis::Result
getDefaultTTI(const llvm::Function& F)
static llvm::TargetIRAnalysis::Result
getDefaultTTI(const llvm::Function& F)
Description
Helper function used as the callback in the default constructor.
Declared at: llvm/include/llvm/Analysis/TargetTransformInfo.h:2552
Parameters
- const llvm::Function& F
¶llvm::TargetIRAnalysis::Result run(
const llvm::Function& F,
llvm::FunctionAnalysisManager&)
llvm::TargetIRAnalysis::Result run(
const llvm::Function& F,
llvm::FunctionAnalysisManager&)
Declared at: llvm/include/llvm/Analysis/TargetTransformInfo.h:2533