Hi folks, recently, I’ve developed multiple passes based on llvm IR. Among them there is a complicated dependency, so, for the sake of modularity, I just finish one pass, write its result to file, and feed the result to a later pass. for example, a sophisticated call graph analysis is needed by many other passes, so I just write the call instructions(in its text presentation) associated with the functions it can potentially call.
This causes a performance issue which is not caused by file I/O(surprisingly) but by the fact that I used the text representation to mark an Instruction of interest.(so if the result is associated with an instruction, I just write its text representation to a file), and later after reading the file in, I compare it with the text of IR that I have, and the intensive getting the text presentation from the IR takes 97% of the rendering time.
I know this sounds kind of silly but, it seems there is no way to mark an instruction across different passes.
Does anyone has idea about this?