X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=lib%2FTarget%2FPowerPC%2FPPCTargetTransformInfo.cpp;h=37624ed93d3aec87ff9e49c5824d14c4439a6920;hp=0cb88c111bf2ac49f3427a016fa6282b4ece1542;hb=757c90dd00dc4902652b08e7d7f22ea2c0fbe3ac;hpb=6693d0de3eddc1610a1077e9ce53fe2691dd9153 diff --git a/lib/Target/PowerPC/PPCTargetTransformInfo.cpp b/lib/Target/PowerPC/PPCTargetTransformInfo.cpp index 0cb88c111bf..37624ed93d3 100644 --- a/lib/Target/PowerPC/PPCTargetTransformInfo.cpp +++ b/lib/Target/PowerPC/PPCTargetTransformInfo.cpp @@ -38,6 +38,7 @@ void initializePPCTTIPass(PassRegistry &); namespace { class PPCTTI final : public ImmutablePass, public TargetTransformInfo { + const TargetMachine *TM; const PPCSubtarget *ST; const PPCTargetLowering *TLI; @@ -47,7 +48,7 @@ public: } PPCTTI(const PPCTargetMachine *TM) - : ImmutablePass(ID), ST(TM->getSubtargetImpl()), + : ImmutablePass(ID), TM(TM), ST(TM->getSubtargetImpl()), TLI(TM->getSubtargetImpl()->getTargetLowering()) { initializePPCTTIPass(*PassRegistry::getPassRegistry()); } @@ -80,8 +81,8 @@ public: Type *Ty) const override; PopcntSupportKind getPopcntSupport(unsigned TyWidth) const override; - void getUnrollingPreferences( - Loop *L, UnrollingPreferences &UP) const override; + void getUnrollingPreferences(const Function *F, Loop *L, + UnrollingPreferences &UP) const override; /// @} @@ -269,8 +270,9 @@ unsigned PPCTTI::getIntImmCost(unsigned Opcode, unsigned Idx, const APInt &Imm, return PPCTTI::getIntImmCost(Imm, Ty); } -void PPCTTI::getUnrollingPreferences(Loop *L, UnrollingPreferences &UP) const { - if (ST->getDarwinDirective() == PPC::DIR_A2) { +void PPCTTI::getUnrollingPreferences(const Function *F, Loop *L, + UnrollingPreferences &UP) const { + if (TM->getSubtarget(F).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;