[LLVMdev] Specifying Additional Compilation Passes to lli
madiyaan
ahmadsharif at hotmail.com
Wed Oct 29 20:41:16 PDT 2008
Hello:
I am trying to do something similar to what Tom was doing. I want to add a
profiling pass to the entire module before JIT'ing it. I then want to run
the JIT'd functions for a while and then re-JIT them after they have been
executed enough times.
I am currently facing some difficulties. For example, in lli.cpp I added
right after the line that says MP=getBitCodeModuleProvider(Buffer,
&ErrorMsg); :
PassManager PM;
PM.add(new TargetData(Mod));
PM.add(new PrintModulePass());
PM.add(createEdgeProfilerPass());
PM.run(*Mod);
Correct me if I am wrong, but this is what I thought would be the way to
first print the module and then run a edge profiler pass. However, this does
not work, and asserts that Ghostlinkage is not allowed inside the print
module pass. If I comment that out, it gives me some other assert when
running the EdgeProfiler pass.
Can someone point out if I am doing something obviously wrong?
My second question is this: assume that I successfully create a profiler
pass and now the application has been JIT and is running (and incrementing
the edge counters). How do I read these back in a subsequent pass? What I
want to do is ideally wait till 1 second (presumably using a placing a timer
interrupt in lli.cpp), and read back all the counter values and clear all
the JIT's code cache and re-optimize based on profile information. What is
the most direct/efficient way of doing this?
Thanks in advance,
--
View this message in context: http://www.nabble.com/Specifying-Additional-Compilation-Passes-to-lli-tp19440321p20240416.html
Sent from the LLVM - Dev mailing list archive at Nabble.com.
More information about the llvm-dev
mailing list