diff options
| author | Chandler Carruth <chandlerc@gmail.com> | 2015-02-01 14:22:17 +0000 |
|---|---|---|
| committer | Chandler Carruth <chandlerc@gmail.com> | 2015-02-01 14:22:17 +0000 |
| commit | c956ab66037e3b0e6b3a039728348de1db1c4ad6 (patch) | |
| tree | cb1ce486bb5c35458d300ea5f52cf6972d611bc2 /llvm/lib/Target/X86/X86TargetTransformInfo.h | |
| parent | c340ca839c083970e3ff0d123c771fe01e43c808 (diff) | |
| download | bcm5719-llvm-c956ab66037e3b0e6b3a039728348de1db1c4ad6.tar.gz bcm5719-llvm-c956ab66037e3b0e6b3a039728348de1db1c4ad6.zip | |
[multiversion] Switch the TTI queries from TargetMachine to Subtarget
now that we have a correct and cached subtarget specific to the
function.
Also, finish providing a cached per-function subtarget in the core
LLVMTargetMachine -- that layer hadn't switched over yet.
The only use of the TargetMachine was to re-lookup a subtarget for
a particular function to work around the fact that TTI was immutable.
Now that it is per-function and we haved a cached subtarget, use it.
This still leaves a few interfaces with real warts on them where we were
passing Function objects through the TTI interface. I'll remove these
and clean their usage up in subsequent commits now that this isn't
necessary.
llvm-svn: 227738
Diffstat (limited to 'llvm/lib/Target/X86/X86TargetTransformInfo.h')
| -rw-r--r-- | llvm/lib/Target/X86/X86TargetTransformInfo.h | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/llvm/lib/Target/X86/X86TargetTransformInfo.h b/llvm/lib/Target/X86/X86TargetTransformInfo.h index 57d40581a23..9f0adcfef62 100644 --- a/llvm/lib/Target/X86/X86TargetTransformInfo.h +++ b/llvm/lib/Target/X86/X86TargetTransformInfo.h @@ -30,37 +30,32 @@ class X86TTIImpl : public BasicTTIImplBase<X86TTIImpl> { typedef TargetTransformInfo TTI; friend BaseT; - const X86TargetMachine *TM; const X86Subtarget *ST; const X86TargetLowering *TLI; unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract); - const X86TargetMachine *getTM() const { return TM; } + const X86Subtarget *getST() const { return ST; } const X86TargetLowering *getTLI() const { return TLI; } public: explicit X86TTIImpl(const X86TargetMachine *TM, Function &F) - : BaseT(TM), TM(TM), ST(TM->getSubtargetImpl(F)), - TLI(ST->getTargetLowering()) {} + : BaseT(TM), ST(TM->getSubtargetImpl(F)), TLI(ST->getTargetLowering()) {} // Provide value semantics. MSVC requires that we spell all of these out. X86TTIImpl(const X86TTIImpl &Arg) - : BaseT(static_cast<const BaseT &>(Arg)), TM(Arg.TM), ST(Arg.ST), - TLI(Arg.TLI) {} + : BaseT(static_cast<const BaseT &>(Arg)), ST(Arg.ST), TLI(Arg.TLI) {} X86TTIImpl(X86TTIImpl &&Arg) - : BaseT(std::move(static_cast<BaseT &>(Arg))), TM(std::move(Arg.TM)), - ST(std::move(Arg.ST)), TLI(std::move(Arg.TLI)) {} + : BaseT(std::move(static_cast<BaseT &>(Arg))), ST(std::move(Arg.ST)), + TLI(std::move(Arg.TLI)) {} X86TTIImpl &operator=(const X86TTIImpl &RHS) { BaseT::operator=(static_cast<const BaseT &>(RHS)); - TM = RHS.TM; ST = RHS.ST; TLI = RHS.TLI; return *this; } X86TTIImpl &operator=(X86TTIImpl &&RHS) { BaseT::operator=(std::move(static_cast<BaseT &>(RHS))); - TM = std::move(RHS.TM); ST = std::move(RHS.ST); TLI = std::move(RHS.TLI); return *this; |

