[LLVMdev] SSA for memory objects

John Criswell jtcriswel at gmail.com
Sun Oct 19 08:55:44 PDT 2014


Dear Tyler,

First, you *could* represent memory objects in SSA form now that LLVM 
supports vector and structure-based SSA virtual registers. However, 
there is no LLVM pass that will take heap-based memory objects and 
convert them into SSA form.  Moreover, the code generators are not 
expecting the compiler to put heap variables into SSA form, and so if 
you can generate native code from a program that has been transformed in 
this way, it will probably not run very fast.

Second, regarding analysis passes, I'm not sure that LLVM really has 
passes for doing data-flow analysis on values in memory.  The best I can 
think of is the DSA points-to analysis; this lives in the poolalloc 
source code and isn't used by LLVM itself.  It has been used by a few 
research projects to do data-flow analysis on values traveling through 
the heap.

There are other analyses within LLVM that may reason about heap objects 
using the AliasAnalysis interface (the passes to remove redundant loads 
and stores comes to mind), but I don't think they do proper Kam-Ullman 
data-flow analysis on data traveling *through* heap objects (but someone 
can correct me if I'm wrong on that).

Regards,

John Criswell

On 10/19/14, 11:32 AM, Tyler Denniston wrote:
> Hello,
>
> I'm looking to learn more about what is available for memory 
> versioning or inducing some kind of SSA for memory objects. I found 
> this page:
>
>   http://llvm.org/docs/tutorial/OCamlLangImpl7.html#memory-in-llvm
>
> Which says: "[LLVM] does not require (or permit) memory objects to be 
> in SSA form.... In LLVM, instead of encoding dataflow analysis of 
> memory into the LLVM IR, it is handled with Analysis Passes which are 
> computed on demand."
>
> However, there is no mention of which analyses provide this. I also 
> haven't been able to turn up much in the way of documentation or 
> examples, so I'm grateful for any additional pointers.
>
> Thanks,
>
> Tyler
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev


-- 
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
http://www.cs.rochester.edu/u/criswell




More information about the llvm-dev mailing list