Using map structure in llvm IR

Hi,

How do I create a function in llvm IR which returns a StringMap datastructure?

thanks,
Bhavani

bhavani krishnan wrote:

Hi,

How do I create a function in llvm IR which returns a StringMap datastructure?

I think the simplest way to answer these sorts of questions is to write such a function in C++, then use llvm-g++ to compile it, with -emit-llvm.

You can disassemble the bitcode and see how to create one, or you can use llc -march=cpp to turn the bitcode into the C++ code that creates the equivalent bitcode.

Hope that helps,
Nick Lewycky

Hi,

I need to use Value Numbering in my optimization pass. I dont see this being used by any other passes. Please let me know which passes to include in addRequired and how to getAnalysis for value numbering. addRequired<GVN> doesn't seem to work.
Any help is appreciated!
    
Thanks in advance!
Bhavani

The GVN pass combines the analysis and optimization into one pass. If you want to use just the analysis, you'll have to refactor the GVN pass or steal code out of it.

-Chris