[multiversion] Remove the cached TargetMachine pointer from the

intermediate TTI implementation template and instead query up to the
derived class for both the TargetMachine and the TargetLowering.

Most of the derived types had a TLI cached already and there is no need
to store a less precisely typed target machine pointer.

This will in turn make it much cleaner to look up the TLI via
a per-function subtarget instead of the generic subtarget, and it will
pave the way toward pulling the subtarget used for unroll preferences
into the same form once we are *always* using the function to look up
the correct subtarget.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227737 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chandler Carruth
2015-02-01 14:01:15 +00:00
parent 7b1ef137a2
commit d0bfb83efb
9 changed files with 129 additions and 37 deletions

View File

@@ -33,4 +33,5 @@ cl::opt<unsigned>
cl::desc("Threshold for partial unrolling"),
cl::Hidden);
BasicTTIImpl::BasicTTIImpl(const TargetMachine *TM) : BaseT(TM) {}
BasicTTIImpl::BasicTTIImpl(const TargetMachine *TM)
: BaseT(TM), TM(TM), TLI(TM->getSubtargetImpl()->getTargetLowering()) {}