AndrewZhaoLuo commented on a change in pull request #9223:
URL: https://github.com/apache/tvm/pull/9223#discussion_r731310152



##########
File path: src/target/llvm/llvm_common.cc
##########
@@ -139,8 +152,22 @@ std::unique_ptr<llvm::TargetMachine> 
GetLLVMTargetMachine(const Target& target,
     ICHECK(allow_null) << err << " target_triple=" << target_triple;
     return nullptr;
   }
-  llvm::TargetMachine* tm =
-      llvm_target->createTargetMachine(target_triple, mcpu, mattr, opt, 
llvm::Reloc::PIC_);
+
+  Integer llvm_opt_level = target->GetAttr<Integer>("O").value_or(Integer(2));

Review comment:
       Hmm so the link listed is for the PassManager. Higher opt level = more 
passes much like we have relay opt level. It appears to be associated with -O3 
in clang. However, CodeGenOpts appears to be a separate thing that is set in 
clang too 
https://github.com/llvm/llvm-project/blob/main/clang/lib/CodeGen/BackendUtil.cpp#L935.
 Looks like this emits the assembly. This is also associated with clang's -O3.
   
   So the flag should control everything.




-- 
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