> > The reason is that ParseIR needs to make calls to LLVM functions to create > > the llvm::Module. > > I get this part, my main question is whether we can initializeLLVM in the > Target constructor but do option resetting in enter/exit, i could miss > something here.
I see what you mean. My concern is that since command line options can be used almost everywhere in LLVM (not just optimizations or code generation), we should try to do the saving as early as possible (and restoring as late as possible). Ideally all the LLVM calls in the program would be enclosed in the save/restore functions (even the bitcode reader registers a couple of command line flags). At the same time we could make a deliberate decision to only apply the save/restore to a part of LLVM functionality, i.e. allow some kinds of LLVM function calls to happen outside of the save/restore scope. Let me know what you think. -- Reply to this email directly or view it on GitHub: https://github.com/apache/tvm-rfcs/pull/83#issuecomment-1180408342 You are receiving this because you are subscribed to this thread. Message ID: <apache/tvm-rfcs/pull/83/c1180408...@github.com>