[LLVMdev] What are all the LLVM IRs that will write into memory?

Chuck Zhao czhao at eecg.toronto.edu
Thu Jan 6 07:55:57 PST 2011


On 1/5/2011 9:16 PM, Reid Kleckner wrote:
> On Wed, Jan 5, 2011 at 7:03 PM, Chuck Zhao<czhao at eecg.toronto.edu>  wrote:
>> LLVMers,
>>
>> I need to intercept all LLVM IR instructions that will write into memory and
>> start to do analysis on these instructions.
> ...
>> Does that mean any LLVM IR that has a valid result field will be able to
>> store the result into memory?
> Yes, if the value ends up getting spilled to the stack.
>
>> How about those temps allocated into registers via register allocation?
>> Is there a way to tell such temps at compile time before RA?
> No, I think you need to perform register allocation in order to know
> about writes to the stack.
>
I am actually doing static analysis/optimizations before register 
allocation.
I feel I understand it properly, I will have to intercept each and every 
of such instructions.
Though some may end up being registered allocated, but there is no way 
to know which ones are in the optimization process before RA.
It is safe to assume them all will end of in memory.

Thank you very much, Reid,

Chuck

> Are you doing a static analysis on the instructions or are you trying
> to instrument all memory stores?  If so, Pin and DynamoRIO seem like
> better choices, unless you want to do a static instrumentation, in
> which case I don't know what the right tool would be.
>
> Reid
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list