[multiversion] Remove the function parameter from the unrolling
authorChandler Carruth <chandlerc@gmail.com>
Sun, 1 Feb 2015 14:31:23 +0000 (14:31 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sun, 1 Feb 2015 14:31:23 +0000 (14:31 +0000)
preferences interface on TTI now that all of TTI is per-function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227741 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/FunctionTargetTransformInfo.h
include/llvm/Analysis/TargetTransformInfo.h
include/llvm/Analysis/TargetTransformInfoImpl.h
include/llvm/CodeGen/BasicTTIImpl.h
lib/Analysis/TargetTransformInfo.cpp
lib/Target/AArch64/AArch64TargetTransformInfo.cpp
lib/Target/AArch64/AArch64TargetTransformInfo.h
lib/Target/PowerPC/PPCTargetTransformInfo.cpp
lib/Target/PowerPC/PPCTargetTransformInfo.h
lib/Target/R600/AMDGPUTargetTransformInfo.cpp
lib/Target/R600/AMDGPUTargetTransformInfo.h

index fce5a1a92bd90021168a9ee09eacf8e901e3a0cc..a321729301042be70ceb56e008249f011bf57940 100644 (file)
@@ -42,7 +42,7 @@ public:
   void
   getUnrollingPreferences(Loop *L,
                           TargetTransformInfo::UnrollingPreferences &UP) const {
-    TTI->getUnrollingPreferences(Fn, L, UP);
+    TTI->getUnrollingPreferences(L, UP);
   }
 };
 }
index 1d3db7bfe457c4e2feb1aba761c7f8d00f1d1ac4..53da46019b39a2b2b256de580f72ebb14fd37c76 100644 (file)
@@ -249,8 +249,7 @@ public:
   /// \brief Get target-customized preferences for the generic loop unrolling
   /// transformation. The caller will initialize UP with the current
   /// target-independent defaults.
-  void getUnrollingPreferences(const Function *F, Loop *L,
-                               UnrollingPreferences &UP) const;
+  void getUnrollingPreferences(Loop *L, UnrollingPreferences &UP) const;
 
   /// @}
 
@@ -499,8 +498,7 @@ public:
   virtual unsigned getUserCost(const User *U) = 0;
   virtual bool hasBranchDivergence() = 0;
   virtual bool isLoweredToCall(const Function *F) = 0;
-  virtual void getUnrollingPreferences(const Function *F, Loop *L,
-                                       UnrollingPreferences &UP) = 0;
+  virtual void getUnrollingPreferences(Loop *L, UnrollingPreferences &UP) = 0;
   virtual bool isLegalAddImmediate(int64_t Imm) = 0;
   virtual bool isLegalICmpImmediate(int64_t Imm) = 0;
   virtual bool isLegalAddressingMode(Type *Ty, GlobalValue *BaseGV,
@@ -596,9 +594,8 @@ public:
   bool isLoweredToCall(const Function *F) override {
     return Impl.isLoweredToCall(F);
   }
-  void getUnrollingPreferences(const Function *F, Loop *L,
-                               UnrollingPreferences &UP) override {
-    return Impl.getUnrollingPreferences(F, L, UP);
+  void getUnrollingPreferences(Loop *L, UnrollingPreferences &UP) override {
+    return Impl.getUnrollingPreferences(L, UP);
   }
   bool isLegalAddImmediate(int64_t Imm) override {
     return Impl.isLegalAddImmediate(Imm);
index 01fb8b6da78a65365e4eee6006f1c9bfa98df882..488f96e6ade55d089cebc81953322403540527cf 100644 (file)
@@ -198,8 +198,7 @@ public:
     return true;
   }
 
-  void getUnrollingPreferences(const Function *, Loop *,
-                               TTI::UnrollingPreferences &) {}
+  void getUnrollingPreferences(Loop *, TTI::UnrollingPreferences &) {}
 
   bool isLegalAddImmediate(int64_t Imm) { return false; }
 
index d7129579cf014f7e9a23d2beaba6efb388f3df16..61664327244faabe1b43240e11553e6ee9ac1602 100644 (file)
@@ -167,8 +167,7 @@ public:
            TLI->isOperationLegalOrCustom(ISD::FSQRT, VT);
   }
 
-  void getUnrollingPreferences(const Function *F, Loop *L,
-                               TTI::UnrollingPreferences &UP) {
+  void getUnrollingPreferences(Loop *L, TTI::UnrollingPreferences &UP) {
     // This unrolling functionality is target independent, but to provide some
     // motivation for its intended use, for x86:
 
index d51cfb347ff01a2419bc8bb1a5e2ff7a3b861812..5a50d36ee8ba3f00b6cc3c75deba8eaa91443f11 100644 (file)
@@ -81,8 +81,8 @@ bool TargetTransformInfo::isLoweredToCall(const Function *F) const {
 }
 
 void TargetTransformInfo::getUnrollingPreferences(
-    const Function *F, Loop *L, UnrollingPreferences &UP) const {
-  return TTIImpl->getUnrollingPreferences(F, L, UP);
+    Loop *L, UnrollingPreferences &UP) const {
+  return TTIImpl->getUnrollingPreferences(L, UP);
 }
 
 bool TargetTransformInfo::isLegalAddImmediate(int64_t Imm) const {
index eab080bb24c38d1a44b377096ef99a6672167155..0646d855ab73177fb2a431ec2f453a0e532b07f6 100644 (file)
@@ -424,7 +424,7 @@ unsigned AArch64TTIImpl::getMaxInterleaveFactor() {
   return 2;
 }
 
-void AArch64TTIImpl::getUnrollingPreferences(const Function *F, Loop *L,
+void AArch64TTIImpl::getUnrollingPreferences(Loop *L,
                                              TTI::UnrollingPreferences &UP) {
   // Disable partial & runtime unrolling on -Os.
   UP.PartialOptSizeThreshold = 0;
index fffeb981b5300818014d28898f3bd0bfcaf45cb6..dd3fd1f5ab790db5371233a82ec7f779900e51e9 100644 (file)
@@ -132,8 +132,7 @@ public:
 
   unsigned getCostOfKeepingLiveOverCall(ArrayRef<Type *> Tys);
 
-  void getUnrollingPreferences(const Function *F, Loop *L,
-                               TTI::UnrollingPreferences &UP);
+  void getUnrollingPreferences(Loop *L, TTI::UnrollingPreferences &UP);
 
   Value *getOrCreateResultFromMemIntrinsic(IntrinsicInst *Inst,
                                            Type *ExpectedType);
index 98fe5cdd8db2b6ca901440a73e4b4202e728c8a6..4003b1b0812e21bae37d3bd782ccbeb6940940e8 100644 (file)
@@ -181,7 +181,7 @@ unsigned PPCTTIImpl::getIntImmCost(unsigned Opcode, unsigned Idx,
   return PPCTTIImpl::getIntImmCost(Imm, Ty);
 }
 
-void PPCTTIImpl::getUnrollingPreferences(const Function *F, Loop *L,
+void PPCTTIImpl::getUnrollingPreferences(Loop *L,
                                          TTI::UnrollingPreferences &UP) {
   if (ST->getDarwinDirective() == PPC::DIR_A2) {
     // The A2 is in-order with a deep pipeline, and concatenation unrolling
@@ -189,7 +189,7 @@ void PPCTTIImpl::getUnrollingPreferences(const Function *F, Loop *L,
     UP.Partial = UP.Runtime = true;
   }
 
-  BaseT::getUnrollingPreferences(F, L, UP);
+  BaseT::getUnrollingPreferences(L, UP);
 }
 
 unsigned PPCTTIImpl::getNumberOfRegisters(bool Vector) {
index 0429a26c200c5dde542ea4034d1a0a0291a49bb7..cef7079423472f1bbdb9ae3be9ca67c820f18be4 100644 (file)
@@ -71,8 +71,7 @@ public:
                          Type *Ty);
 
   TTI::PopcntSupportKind getPopcntSupport(unsigned TyWidth);
-  void getUnrollingPreferences(const Function *F, Loop *L,
-                               TTI::UnrollingPreferences &UP);
+  void getUnrollingPreferences(Loop *L, TTI::UnrollingPreferences &UP);
 
   /// @}
 
index be7b2f4297107156f213d64215658d7c6ca75e0d..4647ddf038ebfcfcbf5d7d4ec2a1e352fdc2148c 100644 (file)
@@ -27,7 +27,7 @@ using namespace llvm;
 
 #define DEBUG_TYPE "AMDGPUtti"
 
-void AMDGPUTTIImpl::getUnrollingPreferences(const Function *, Loop *L,
+void AMDGPUTTIImpl::getUnrollingPreferences(Loop *L,
                                             TTI::UnrollingPreferences &UP) {
   UP.Threshold = 300; // Twice the default.
   UP.Count = UINT_MAX;
index 4c4103302065bf9df4e6b12114058e26dace7ea4..4abbdf20e766ca10a5922937678e99f593d4d3fa 100644 (file)
@@ -61,8 +61,7 @@ public:
 
   bool hasBranchDivergence() { return true; }
 
-  void getUnrollingPreferences(const Function *F, Loop *L,
-                               TTI::UnrollingPreferences &UP);
+  void getUnrollingPreferences(Loop *L, TTI::UnrollingPreferences &UP);
 
   TTI::PopcntSupportKind getPopcntSupport(unsigned TyWidth) {
     assert(isPowerOf2_32(TyWidth) && "Ty width must be power of 2");