[PATCH] D25384: [ThinLTO] Record references to aliases to calls

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 7 22:30:34 PDT 2016


tejohnson added inline comments.


================
Comment at: lib/Analysis/ModuleSummaryAnalysis.cpp:58
         // specially by WriteFunction and are added to a separate list.
-        if (!(CS && CS.isCallee(&OI)))
+        if (!(CS && CS.isCallee(&OI) && CS.getCalledFunction()))
           RefEdges.insert(Operand);
----------------
mehdi_amini wrote:
> tejohnson wrote:
> > mehdi_amini wrote:
> > > I don't understand this change. I seem to me that you're adding a reference when we're calling an alias. Why isn't the alias added as a callee?
> > Because there is no called function (it's null). Note we can still find the aliasee function in the ref graph via the alias summary. Maybe we should add a call edge to the alias regardless, so we could import via the alias summary...let me try that . 
> I have a doubt about what we generate (and should generate) on you example, is it:
> 
> - main reference analias
> - main calls aliasee
> - analias reference aliasee
> 
> Or:
> 
> - main calls analias
> - analias reference aliasee
> 
> I tend to lean for the second one.
Aliases are represented explicitly in the summary, although they are not created here. 

What we will generate with my new fix is the same as what we are already generating if the call to the alias was intra-module. This is simply:
- main calls analias

Later on we will generate an ALIAS record in the summary to record the relationship:
- analias aliases aliasee
(in the bitcode writer)

Then in the bitcode reader we will turn that into an AliasSummary so that we can follow the call from main to analias (recorded in the FunctionSummary for main) through to aliasee via the AliasSummmary.


https://reviews.llvm.org/D25384





More information about the llvm-commits mailing list