manupa-arm commented on a change in pull request #8865:
URL: https://github.com/apache/tvm/pull/8865#discussion_r700417745
##########
File path: src/target/llvm/codegen_hexagon.cc
##########
@@ -706,12 +706,42 @@ runtime::Module BuildHexagon(IRModule mod, Target target)
{
std::unique_ptr<llvm::TargetMachine> tm = GetLLVMTargetMachine(target);
std::unique_ptr<llvm::LLVMContext> ctx(new llvm::LLVMContext());
std::unique_ptr<CodeGenHexagon> cg(new CodeGenHexagon());
- cg->Init("TVMHexagonModule", tm.get(), ctx.get(), false, false, false);
+
+ std::vector<PrimFunc> funcs;
+ std::string entry_func;
+ Map<String, LinkedParam> linked_params;
+ bool found_linked_params = false;
+ bool could_have_linked_params =
target->GetAttr<Bool>("link-params").value_or(Bool(false));
+
for (auto kv : mod->functions) {
ICHECK(kv.second->IsInstance<PrimFuncNode>()) << "Can only lower IR Module
with PrimFuncs";
+ if (could_have_linked_params &&
+ kv.first->name_hint ==
::tvm::runtime::symbol::tvm_lookup_linked_param) {
+ Map<String, ObjectRef> attrs_dict = Downcast<Map<String,
ObjectRef>>(kv.second->attrs->dict);
+ CHECK(attrs_dict.find(::tvm::tir::attr::kLinkedParams) !=
attrs_dict.end())
+ << "no " << ::tvm::tir::attr::kLinkedParams << " attribute found!";
+ linked_params =
Review comment:
I thought the reason for declaring the Map outside of the scope of loop
is to set it -- hence the question.
Another way to ask the same thing : any reason to declare the Map outside of
the for loop ?
--
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]