[llvm] 59a5c58 - [FuncSpec][NFC] Leave a comment for future improvements.

Alexandros Lamprineas via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 25 04:19:13 PDT 2023


Author: Alexandros Lamprineas
Date: 2023-07-25T11:58:42+01:00
New Revision: 59a5c582dc35aa4e50a66bdf18fe7e3a35802fd4

URL: https://github.com/llvm/llvm-project/commit/59a5c582dc35aa4e50a66bdf18fe7e3a35802fd4
DIFF: https://github.com/llvm/llvm-project/commit/59a5c582dc35aa4e50a66bdf18fe7e3a35802fd4.diff

LOG: [FuncSpec][NFC] Leave a comment for future improvements.

Adds a TODO for checking inlinining opportunities while traversing
the users of the specialization arguments. This was brought up in
the review of D154852.

Added: 
    

Modified: 
    llvm/lib/Transforms/IPO/FunctionSpecialization.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/IPO/FunctionSpecialization.cpp b/llvm/lib/Transforms/IPO/FunctionSpecialization.cpp
index cae0fc7b733543..3d6c501e45968e 100644
--- a/llvm/lib/Transforms/IPO/FunctionSpecialization.cpp
+++ b/llvm/lib/Transforms/IPO/FunctionSpecialization.cpp
@@ -877,6 +877,9 @@ Cost FunctionSpecializer::getSpecializationBonus(Argument *A, Constant *C,
   // The below heuristic is only concerned with exposing inlining
   // opportunities via indirect call promotion. If the argument is not a
   // (potentially casted) function pointer, give up.
+  //
+  // TODO: Perhaps we should consider checking such inlining opportunities
+  // while traversing the users of the specialization arguments ?
   Function *CalledFunction = dyn_cast<Function>(C->stripPointerCasts());
   if (!CalledFunction)
     return TotalCost;


        


More information about the llvm-commits mailing list