You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/07/08 13:21:22 UTC

[GitHub] [tvm-rfcs] tqchen commented on pull request #83: [RFC] Create LLVM scope class for use with LLVM libraries

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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org