tqchen commented on PR #83:
URL: https://github.com/apache/tvm-rfcs/pull/83#issuecomment-1178983089

   Thanks @kparzysz-quic . Sorry for the delayed reply since we are taking 
break here.
   
   Overall I like the direction we are going. Just to figure out the spectrum 
of possible APIs
   
   My main question is how are we going to interact with multiple ParseIR 
calls. Some example would be helpful. For example, is it OK for us to have 
nested LLVMScope
   
   ```c++
   void Example() {
        LLVMScope scope1(target);
        {
             // what is the effect here, seems mod_data1 is immediate in scope
             auto mod_data1 = LLVMScope::ParseIR(name);
        }
   }
   ```
   
   I also wonder if there is a way to "defer" the scope initialization. e.g. 
can LLVMModule be created, stored in the LLVMScope, but the target does not 
take in-effect until we enter the scope.  We call InitializeLLVM in the 
constructor of LLVMTarget, but do other things like option setting in the enter 
stage.Something like
   
   ```c++
   void Example() {
        LLVMTarget target1(target);
        auto mod_data = LLVMTarget::ParseIR(name);
        // enter target1 scope
        With<LLVMTarget> scope1(target1);
        {
              // entering target in mod_data
             With<LLVMTarget> scope2(mod_data);
        }
   }
   ```
   I think the main question is how coupled the operations related to LLVM are.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to