[LLVMdev] Memory Dependence Analysis: getNonLocalDependency()
resistor at mac.com
Mon Jul 28 21:00:41 CDT 2008
On Jul 28, 2008, at 5:53 PM, Prakash Prabhu wrote:
> Thanks for the quick reply, Owen. I went through the code in
> MemoryDependenceAnalysis.cpp again. Since DenseMap<BasicBlock*,
> Value*> maps a BasicBlock to a single Value (Instruction) and it is
> populated by a DFS on the reverse Control Flow Graph starting at the
> query instruction's block, is it correct to say that the last
> dependent instruction in each visited basic block is what is
> mapped ? For example, if a basicblock B has two instructions:
> store i32 1, i32* %i, align 4 (say inst1)
> load i32* %i, align 4 ; <i32>:39 [#uses=1] (say inst2)
> and suppose i had one more Store instruction to %i outside B which
> is the query, then when B is visited, in the DenseMap only the
> mapping <B, inst2> is added and not <B, inst1> ?
> I am guessing that this information is sufficient for most code-
> hoisting optimizations since just the knowledge that a basic block
> has some load/store instruction accessing the same (modulo the
> pointer analysis) address is sufficient to prevent the
> transformation from causing an unsafe code-movement ?
Yup, that's exactly right.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 2624 bytes
Desc: not available
Url : http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20080728/2a934dd7/attachment.bin
More information about the LLVMdev