Marc Brünink
2009-Aug-20 18:44 UTC
[LLVMdev] How to force MemoryDependenceAnalysis to run on original module
Hi, I do have a FunctionPass that does change the code. This FunctionPass requires another FunctionPass which performs all the necessary analyses. This AnalysisPass again requires MemoryDependenceAnalysis. The problem is, that I would like MemoryDependenceAnalysis to run on the unaltered module. I do not want to have dependencies to changed code. What is the cleanest way to do this? Sounds easy, but I do not get it right :D Thanks Marc
Chris Lattner
2009-Aug-20 21:01 UTC
[LLVMdev] How to force MemoryDependenceAnalysis to run on original module
On Aug 20, 2009, at 11:44 AM, Marc Brünink wrote:> Hi, > > I do have a FunctionPass that does change the code. This FunctionPass > requires another FunctionPass which performs all the necessary > analyses. > This AnalysisPass again requires MemoryDependenceAnalysis. > > The problem is, that I would like MemoryDependenceAnalysis to run on > the > unaltered module. I do not want to have dependencies to changed code. > What is the cleanest way to do this? > Sounds easy, but I do not get it right :DHi Marc, This isn't really possible. The issue is that MemDep doesn't just "analyze your function". It is designed to be as lazy as possible, which means that it only does analysis when a query is performed. This means that if you have MemDep->Pass1->Pass2 and Pass2 uses MemDep info that you need to make Pass1 preserve that memdep info. -Chris
Marc Brünink
2009-Aug-21 10:04 UTC
[LLVMdev] How to force MemoryDependenceAnalysis to run on original module
Chris Lattner schrieb:> > On Aug 20, 2009, at 11:44 AM, Marc Brünink wrote: > >> Hi, >> >> I do have a FunctionPass that does change the code. This FunctionPass >> requires another FunctionPass which performs all the necessary analyses. >> This AnalysisPass again requires MemoryDependenceAnalysis. >> >> The problem is, that I would like MemoryDependenceAnalysis to run on the >> unaltered module. I do not want to have dependencies to changed code. >> What is the cleanest way to do this? >> Sounds easy, but I do not get it right :D > > Hi Marc, > > This isn't really possible. The issue is that MemDep doesn't just > "analyze your function". It is designed to be as lazy as possible, > which means that it only does analysis when a query is performed. This > means that if you have MemDep->Pass1->Pass2 and Pass2 uses MemDep info > that you need to make Pass1 preserve that memdep info.Hi, 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. So I want to make sure the PassManager runs Pass1 on the whole module, before Pass2's runOnFunction is called the first time. Still impossible? Thanks Marc
Apparently Analagous Threads
- [LLVMdev] How to force MemoryDependenceAnalysis to run on original module
- [LLVMdev] How to force MemoryDependenceAnalysis to run on original module
- [LLVMdev] How to force MemoryDependenceAnalysis to run on original module
- [LLVMdev] How to force MemoryDependenceAnalysis to run on original module
- [LLVMdev] How to force MemoryDependenceAnalysis to run on original module