I am trying to run two llvm passes on two different IRs to finish my analysis. These two passes need to exchange information during their excecution. I am doing so because I can’t link the two IRs I want to analyze together as a big IR and run my llvm pass on it.
What I want to do specifically is:
The first IR will call the functions in the second IR. Whenver there is a function call in the first IR to the second IR, the first pass will evoke the second pass on the second IR and give it some information as input. When the second pass is finished analysing its IR, it will return some information to the first pass.
Basically, I want to do the same analysis for two IRs just like they were linked together. Since I can’t actually link them togther, I need to manage the communication between two passes running on two IRs by myself.
I feel like to do so, I need to write another program to control these two passes, pretty like what the opt program does. But I am not sure if it is durable and feel overwhemled to start. Anyone can give me any suggestions about this? Thank you very much.