[LLVMdev] Anomaly with CallGraph construction

Duncan Sands baldrick at free.fr
Tue Mar 29 07:47:29 PDT 2011


Hi Gabriel,

...
> Summarizing, I have two questions: 1) is the CallGraph analysis "working as
> intended" here?; and 2) what would be the correct approach
> to modifying the proposed analysis in order to detect that randlc() is being
> called in that CallInst ?

the reason that the callgraph analysis does not try to understand indirect
calls like this is that other passes are supposed to sort such things out
if they can be sorted out.  If they failed then there is no point in having
the callgraph analysis try too.  The main place that tries to sort out such
bitcasts is transformConstExprCastCall in InstCombineCalls.cpp.  You may want
to rummage around in there to work out why it thinks removing the bitcast is
unsafe.

So the answers to your questions are: (1) yes, and (2) it is not a job for the
analysis - instcombine is the place to take care of this.

Ciao, Duncan.



More information about the llvm-dev mailing list