[llvm-dev] Higher level program analysis

David Greene via llvm-dev llvm-dev at lists.llvm.org
Thu Mar 28 11:57:32 PDT 2019


Devirtualization is an example of predicting calls and is much more
easily done on a higher-level representation.  It is simply easier to
reason about certain things given information that is lost during
translation to LLVM IR.  The MLIR project makes similar arguments.

It would be helpful to know what's being attempted here.  I'm not sure
what the (hardware?) branch predictor has to do with making decisions
based compile-time information, unless some kind of PGO is being used.
I could imagine something that takes branch probabilities and guesses
the most likely path through a function, thus predicting certain calls
will happen over others.

                    -David

Bekket McClane via llvm-dev <llvm-dev at lists.llvm.org> writes:

> Hi PreeJackie,
>
> I still have difficulties associating ‘higher level program analysis’ with the possible candidate functions that will be executed next.
> Call graph will definitely be your tools(and actually it’s usually not considered ‘high level’), and function attributes might help. But AFAIC, there is little ‘high level’
> language constructions that can help us determinate the possible functions executed next.
> Maybe you can give us some examples?
>
> Best,
> Bekket
>
>  On Mar 27, 2019, at 8:55 PM, preejackie via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>
>  Hi all,
>
>  I'm looking for some program analysis techniques which help me to find potential functions to execute next, from the current executing function. I want to
>  decision based on compile time information. I consider LLVM IR is too low-level to make such analysis. So, I using call graph representation of module. I
>  figured out the probability of function which execute next based on the branch predictor, Call instruction distance from the entry of function. I believe that
>  many attributes can be derived from higher level program representation. Is there any similar work done like this? LLVM already support analysis for this?


More information about the llvm-dev mailing list