From a5157e68d183e1bdf010e94a15dc0c44b65f889b Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Mon, 21 Jan 2013 13:04:33 +0000 Subject: Switch CodeMetrics itself over to use TTI to determine if an instruction is free. The whole CodeMetrics API should probably be reworked more, but this is enough to allow deleting the duplicate code there for computing whether an instruction is free. All of the passes using this have been updated to pull in TTI and hand it to the CodeMetrics stuff. Further, a dead CodeMetrics API (analyzeFunction) is nuked for lack of users. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173036 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Analysis/CodeMetrics.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'include/llvm/Analysis/CodeMetrics.h') diff --git a/include/llvm/Analysis/CodeMetrics.h b/include/llvm/Analysis/CodeMetrics.h index 2a03b93fd8..086934d0e6 100644 --- a/include/llvm/Analysis/CodeMetrics.h +++ b/include/llvm/Analysis/CodeMetrics.h @@ -23,11 +23,9 @@ class BasicBlock; class Function; class Instruction; class DataLayout; +class TargetTransformInfo; class Value; -/// \brief Check whether an instruction is likely to be "free" when lowered. -bool isInstructionFree(const Instruction *I, const DataLayout *TD = 0); - /// \brief Check whether a call will lower to something small. /// /// This tests checks whether this callsite will lower to something @@ -87,10 +85,7 @@ struct CodeMetrics { NumInlineCandidates(0), NumVectorInsts(0), NumRets(0) {} /// \brief Add information about a block to the current state. - void analyzeBasicBlock(const BasicBlock *BB, const DataLayout *TD = 0); - - /// \brief Add information about a function to the current state. - void analyzeFunction(Function *F, const DataLayout *TD = 0); + void analyzeBasicBlock(const BasicBlock *BB, const TargetTransformInfo &TTI); }; } -- cgit v1.2.3-18-g5258