1 //===- llvm/Analysis/FunctionTargetTransformInfo.h --------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This pass wraps a TargetTransformInfo in a FunctionPass so that it can
11 // forward along the current Function so that we can make target specific
12 // decisions based on the particular subtarget specified for each Function.
14 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_ANALYSIS_FUNCTIONTARGETTRANSFORMINFO_H
17 #define LLVM_ANALYSIS_FUNCTIONTARGETTRANSFORMINFO_H
19 #include "TargetTransformInfo.h"
20 #include "llvm/Pass.h"
23 class FunctionTargetTransformInfo final : public FunctionPass {
26 const TargetTransformInfo *TTI;
28 FunctionTargetTransformInfo(const FunctionTargetTransformInfo &)
29 LLVM_DELETED_FUNCTION;
30 void operator=(const FunctionTargetTransformInfo &) LLVM_DELETED_FUNCTION;
34 FunctionTargetTransformInfo();
36 // Implementation boilerplate.
37 void getAnalysisUsage(AnalysisUsage &AU) const override;
38 void releaseMemory() override;
39 bool runOnFunction(Function &F) override;
41 // Shimmed functions from TargetTransformInfo.
43 getUnrollingPreferences(Loop *L,
44 TargetTransformInfo::UnrollingPreferences &UP) const {
45 TTI->getUnrollingPreferences(L, UP);