From c956ab66037e3b0e6b3a039728348de1db1c4ad6 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sun, 1 Feb 2015 14:22:17 +0000 Subject: [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 --- llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp') diff --git a/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp b/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp index 3519229eb09..98fe5cdd8db 100644 --- a/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp +++ b/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp @@ -183,7 +183,7 @@ unsigned PPCTTIImpl::getIntImmCost(unsigned Opcode, unsigned Idx, void PPCTTIImpl::getUnrollingPreferences(const Function *F, Loop *L, TTI::UnrollingPreferences &UP) { - if (TM->getSubtarget(F).getDarwinDirective() == PPC::DIR_A2) { + if (ST->getDarwinDirective() == PPC::DIR_A2) { // The A2 is in-order with a deep pipeline, and concatenation unrolling // helps expose latency-hiding opportunities to the instruction scheduler. UP.Partial = UP.Runtime = true; -- cgit v1.2.3