To check what kind of functions that get imported are inlined
I need the function size, counted while importing.
Details
Diff Detail
Event Timeline
include/llvm/Transforms/IPO/FunctionImport.h | ||
---|---|---|
32 | This one is small change, that I don't know if you like or not, so I didn't want to push it without review. | |
include/llvm/Transforms/Utils/ImportedFunctionsInliningStatistics.h | ||
80 ↗ | (On Diff #66738) | This one is should not be part of patch. I will remove it. |
I can imaging you wanting other summary information (callsite count, for example) too. Why not create a broader summary metadata and put everything there?
include/llvm/Transforms/IPO/FunctionImport.h | ||
---|---|---|
32 | It seems unnecessary to me, but if you do this change you should use ImportThresholdTy everywhere Threshold is used. |
I don't have plans right now of using such information. Do you have idea how helpful it could be? If not then YAGNI
include/llvm/Transforms/IPO/FunctionImport.h | ||
---|---|---|
32 | ok maybe I will look for such places. I just hate to see code that is trying to say something using comments instead of just using code (like types) |
Ok, fair enough, given that the importing heuristic only uses inst count currently. If and when CallGraphEdgeList is used (particularly some of callee profile counts), I would expect that it'll be useful to have that data but can be added then.
Streaming out the module summary to LLVM assembly has been on my TODO for awhile and would probably make all of this unnecessary. But that is a larger task. I would say just add what you need for now, since we may rip it out if/when the summary streaming is done.
BTW, the description would be clearer if you change "counted while importing" to "recorded from the summary during importing". I misunderstood what the patch was doing from the description, until I looked at the changes.
include/llvm/Transforms/IPO/FunctionImport.h | ||
---|---|---|
32 | This is unrelated to the rest of the change and should be committed as a separate patch, if at all, but I don't think it is really necessary. | |
lib/Transforms/IPO/FunctionImport.cpp | ||
604 | Why did this move? I guess it makes more sense to have it before the optional EnableImportMetadata block, but could you commit that separately as an NFC patch? | |
620 | "thinlto_inst_count" would make it clearer. | |
test/Transforms/FunctionImport/funcimport.ll | ||
70 | Check for !instructions_count here and elsewhere? |
test/Transforms/FunctionImport/funcimport.ll | ||
---|---|---|
70 | Can I don't match for the count? |
test/Transforms/FunctionImport/funcimport.ll | ||
---|---|---|
70 | Yeah that's fine |
Let's discuss Mehdi's point about simply using the summary to get this information during inlining first.
This one is small change, that I don't know if you like or not, so I didn't want to push it without review.