ibsidorenko commented on code in PR #12398:
URL: https://github.com/apache/tvm/pull/12398#discussion_r997407769


##########
src/relay/backend/utils.cc:
##########
@@ -219,17 +219,22 @@ ExecutorCodegenMetadata::ExecutorCodegenMetadata(
 
 TVM_REGISTER_NODE_TYPE(ExecutorCodegenMetadataNode);
 
-Array<Pass> GetPassPrefix(bool is_homogeneous, bool is_vm) {
+Array<Pass> GetPassPrefix(Target homogeneous_target, bool is_vm) {
   Array<Pass> pass_seqs;
   // TODO(mbs): Would be nice to get spans on all diagnostics, but since they 
arg forgotton
   // by most passes there's little utility in including this now. Plus we'd 
need to only do
   // this if there's no existing spans to work from.
   // pass_seqs.push_back(parser::AnnotateSpans());
   Array<runtime::String> entry_functions{"main"};
+  // Can be undefined in case of heterogeneous execution
+  bool is_homogeneous = homogeneous_target.defined();
   pass_seqs.push_back(transform::RemoveUnusedFunctions(entry_functions));
   pass_seqs.push_back(transform::ToBasicBlockNormalForm());
   // Run all dialect legalization passes.
-  pass_seqs.push_back(relay::qnn::transform::Legalize());
+  // Skip these passes for Hexagon target.
+  if ((is_homogeneous && homogeneous_target->GetTargetDeviceType() != 
kDLHexagon) ||
+      !is_homogeneous)

Review Comment:
   Done



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