mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 22:24:07 +00:00
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
This commit is contained in:
@ -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.
|
||||
|
Reference in New Issue
Block a user