]> git.proxmox.com Git - rustc.git/blame - src/llvm/include/llvm/Analysis/FunctionTargetTransformInfo.h
Imported Upstream version 1.0.0+dfsg1
[rustc.git] / src / llvm / include / llvm / Analysis / FunctionTargetTransformInfo.h
CommitLineData
1a4d82fc
JJ
1//===- llvm/Analysis/FunctionTargetTransformInfo.h --------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
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.
13//
14//===----------------------------------------------------------------------===//
15
16#ifndef LLVM_ANALYSIS_FUNCTIONTARGETTRANSFORMINFO_H
17#define LLVM_ANALYSIS_FUNCTIONTARGETTRANSFORMINFO_H
18
1a4d82fc 19#include "TargetTransformInfo.h"
85aaf69f 20#include "llvm/Pass.h"
1a4d82fc
JJ
21
22namespace llvm {
23class FunctionTargetTransformInfo final : public FunctionPass {
24private:
25 const Function *Fn;
26 const TargetTransformInfo *TTI;
27
28 FunctionTargetTransformInfo(const FunctionTargetTransformInfo &)
29 LLVM_DELETED_FUNCTION;
30 void operator=(const FunctionTargetTransformInfo &) LLVM_DELETED_FUNCTION;
31
32public:
33 static char ID;
34 FunctionTargetTransformInfo();
35
36 // Implementation boilerplate.
37 void getAnalysisUsage(AnalysisUsage &AU) const override;
38 void releaseMemory() override;
39 bool runOnFunction(Function &F) override;
40
41 // Shimmed functions from TargetTransformInfo.
42 void
43 getUnrollingPreferences(Loop *L,
44 TargetTransformInfo::UnrollingPreferences &UP) const {
45 TTI->getUnrollingPreferences(Fn, L, UP);
46 }
47};
48}
49#endif