[cfe-dev] [analyzer][RFC] Get info from the LLVM IR for precision

Johannes Doerfert via cfe-dev cfe-dev at lists.llvm.org
Mon Sep 21 15:29:08 PDT 2020


Disclaimer: I haven't read the entire thread.

On 8/14/20 6:19 AM, Gábor Márton via cfe-dev wrote:
>> Is this really the most reasonable way to get the information you want?
> Here is a list of information we would like to have access to (this is
> non-comprehensive, Artem could probably extend it) :
> 1) Is a function pure?
> 2) Does a function read/write only the memory pointed to by its arguments?
> 3) Does a calle make any copies of the pointer argument that outlive the
> callee itself?
> 4) Value ranges.
> 5) Is a loop dead?
> 6) Is a parameter or return pointer is dereferenceable?

FWIW, if you run the Attributor you get 1), 2), 3) 4), and 6).
We are working on 5) and there are *a lot* of other things you
could get of out the results.

We could introduce a mode in which we don't delete IR so the mapping
from AST to IR remains. For now, the Attributor would delete internal
functions that are unnecessary for example.

Let me know if this sounds interesting and we can discuss it further :)

~ Johannes



More information about the cfe-dev mailing list