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/PowerPC/PPCTargetTransformInfo.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/PowerPC/PPCTargetTransformInfo.h')
| -rw-r--r-- | llvm/lib/Target/PowerPC/PPCTargetTransformInfo.h | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.h b/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.h index 83cb5e5d113..0429a26c200 100644 --- a/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.h +++ b/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.h @@ -30,35 +30,30 @@ class PPCTTIImpl : public BasicTTIImplBase<PPCTTIImpl> { typedef TargetTransformInfo TTI; friend BaseT; - const PPCTargetMachine *TM; const PPCSubtarget *ST; const PPCTargetLowering *TLI; - const PPCTargetMachine *getTM() const { return TM; } + const PPCSubtarget *getST() const { return ST; } const PPCTargetLowering *getTLI() const { return TLI; } public: explicit PPCTTIImpl(const PPCTargetMachine *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. PPCTTIImpl(const PPCTTIImpl &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) {} PPCTTIImpl(PPCTTIImpl &&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)) {} PPCTTIImpl &operator=(const PPCTTIImpl &RHS) { BaseT::operator=(static_cast<const BaseT &>(RHS)); - TM = RHS.TM; ST = RHS.ST; TLI = RHS.TLI; return *this; } PPCTTIImpl &operator=(PPCTTIImpl &&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; |

