[PATCH] D36432: [IPSCCP] Add function specialization ability

Chad Rosier via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 9 11:35:59 PDT 2017

mcrosier added inline comments.

Comment at: lib/Transforms/Scalar/SCCP.cpp:249
+  /// Mark all of the blocks in function \p F non-executable. Clients can used
+  /// this method to erase a function from the module (e.g., if it has been
used -> use

Comment at: lib/Transforms/Scalar/SCCP.cpp:2023
+      Params.DefaultThreshold += InlineConstants::IndirectCallThreshold;
+      InlineCost IC = getInlineCost(CS, CalledFunction, Params, CalleeTTI,
+                                    *GetAC, GetBFI, PSI);
The inline cost model already takes into consideration cold call sites, but I was wondering if it would make sense to use this information directly during functional specialization.

For example, you could filter out cold calls and avoid the overhead of computing the inline cost in cases when you think inlining likely won't happen or where specialization isn't likely to be beneficial.

Of course, the inline cost computation will bail sooner with a lower threshold (due to the call site being cold), so you might not be saving too much..

Just a thought.


More information about the llvm-commits mailing list