[LLVMdev] How to force MemoryDependenceAnalysis to run on original module

Marc Brünink marc at bruenink.de
Fri Aug 21 12:15:20 PDT 2009


Devang Patel schrieb:
> On Fri, Aug 21, 2009 at 10:48 AM, Marc Brünink<marc at bruenink.de> wrote:
> 
>>>> actually my problem is easier. So I still have hope that it is possible:
>>>>
>>>> MemDep->Pass1->Pass2
>>>>
>>>> Pass1 uses MemDep. Pass2 only uses Pass1. Eventually, Pass2 changes the
>>>> code. Unfortunately, non-local dependencies of MemDep might point to
>>>> code changed by Pass2. Therefore, Pass1 might see changes applied by
>>>> Pass2. This breaks encapsulation.
>>>>
> 
> Pass1 and Pass2 are function passes. Pass1 will first operate on
> function F1 before Pass2 gets a chance on F1. However, after Pass2
> operates on F1, the Pass1 will not operate on F1, so it won't see any
> changes applied by Pass2.

Hi,

that's not the end of the story; it's just the beginning:
Pass2 changes F1. Next, Pass1 is run on F2. Pass1 asks MemDep for 
non-local dependencies. Unfortunately the non-local dependency is an 
instruction in F1. So Pass1 might see changes done by Pass2.

Ciao
Marc



More information about the llvm-dev mailing list