diff options
| author | Chandler Carruth <chandlerc@gmail.com> | 2013-01-21 13:04:33 +0000 |
|---|---|---|
| committer | Chandler Carruth <chandlerc@gmail.com> | 2013-01-21 13:04:33 +0000 |
| commit | bb9caa9241d3653185a0b510e4e02e2fa93e9f14 (patch) | |
| tree | 9854d16468cb1c2bac84d869c62f6e274144022a /llvm/lib/Analysis/TargetTransformInfo.cpp | |
| parent | 52b8a052344c871b859e5f2d43d5c9b8fff46c8f (diff) | |
| download | bcm5719-llvm-bb9caa9241d3653185a0b510e4e02e2fa93e9f14.tar.gz bcm5719-llvm-bb9caa9241d3653185a0b510e4e02e2fa93e9f14.zip | |
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.
llvm-svn: 173036
Diffstat (limited to 'llvm/lib/Analysis/TargetTransformInfo.cpp')
| -rw-r--r-- | llvm/lib/Analysis/TargetTransformInfo.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/TargetTransformInfo.cpp b/llvm/lib/Analysis/TargetTransformInfo.cpp index 16ee6eb35c6..99720d4d034 100644 --- a/llvm/lib/Analysis/TargetTransformInfo.cpp +++ b/llvm/lib/Analysis/TargetTransformInfo.cpp @@ -258,6 +258,9 @@ struct NoTTI : ImmutablePass, TargetTransformInfo { } unsigned getUserCost(const User *U) const { + if (isa<PHINode>(U)) + return TCC_Free; // Model all PHI nodes as free. + if (const GEPOperator *GEP = dyn_cast<GEPOperator>(U)) // In the basic model we just assume that all-constant GEPs will be // folded into their uses via addressing modes. |

