Move Function Specialization to its correct location. NFC.
authorSjoerd Meijer <sjoerd.meijer@arm.com>
Fri, 11 Jun 2021 13:43:49 +0000 (14:43 +0100)
committerSjoerd Meijer <sjoerd.meijer@arm.com>
Fri, 11 Jun 2021 14:00:10 +0000 (15:00 +0100)
As a follow up of rGc4a0969b9c14, and as part of D104102, move it to
the IPO transformations directory.

llvm/lib/Transforms/IPO/CMakeLists.txt
llvm/lib/Transforms/IPO/FunctionSpecialization.cpp [moved from llvm/lib/Transforms/Scalar/FunctionSpecialization.cpp with 99% similarity]
llvm/lib/Transforms/Scalar/CMakeLists.txt

index 34788bc..2392b13 100644 (file)
@@ -15,6 +15,7 @@ add_llvm_component_library(LLVMipo
   ForceFunctionAttrs.cpp
   FunctionAttrs.cpp
   FunctionImport.cpp
+  FunctionSpecialization.cpp
   GlobalDCE.cpp
   GlobalOpt.cpp
   GlobalSplit.cpp
@@ -247,7 +247,7 @@ private:
 
     // Otherwise, set the specialization cost to be the cost of all the
     // instructions in the function and penalty for specializing more functions.
-    unsigned Penalty = (NumFuncSpecialized + 1);
+    unsigned Penalty = NumFuncSpecialized + 1;
     return Metrics.NumInsts * InlineConstants::InstrCost * Penalty;
   }
 
@@ -506,7 +506,6 @@ private:
       CallSitesToRewrite.push_back(&CS);
     }
     for (auto *CS : CallSitesToRewrite) {
-
       if ((CS->getFunction() == Clone && CS->getArgOperand(ArgNo) == &Arg) ||
           CS->getArgOperand(ArgNo) == C) {
         CS->setCalledFunction(Clone);
index 99ae122..45619c4 100644 (file)
@@ -13,7 +13,6 @@ add_llvm_component_library(LLVMScalarOpts
   EarlyCSE.cpp
   FlattenCFGPass.cpp
   Float2Int.cpp
-  FunctionSpecialization.cpp
   GuardWidening.cpp
   GVN.cpp
   GVNHoist.cpp