Skip to content

Conversation

@wrongtest-intellif
Copy link
Contributor

It seems that GetOrCreateTargetMachine's failure check would be out of lookupTarget' nest scope.

@tvm-bot
Copy link
Collaborator

tvm-bot commented Dec 10, 2022

Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.

  • No users to tag found in teams: llvm See #10317 for details

Generated by tvm-bot

@wrongtest-intellif
Copy link
Contributor Author

cc @kparzysz-quic

Copy link
Contributor

@echuraev echuraev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks

@echuraev echuraev merged commit ae07437 into apache:main Dec 12, 2022
llvm_instance->createTargetMachine(triple_, cpu_, GetTargetFeatureString(), target_options_,
reloc_model_, code_model_, opt_level_);
target_machine_ = std::unique_ptr<llvm::TargetMachine>(tm);
if (!allow_missing) {
Copy link
Contributor

@kparzysz-quic kparzysz-quic Dec 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only place where target_machine_ is assigned a value, so this check was actually sufficient.

Edit: the change doesn't break anything, so it can stay.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Emmmm but when llvm::TargetRegistry::lookupTarget(triple_, error) failed,the target_machine_ is also nullptr,

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, you're right.

fzi-peccia pushed a commit to fzi-peccia/tvm that referenced this pull request Mar 27, 2023
mikeseven pushed a commit to mikeseven/tvm that referenced this pull request Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants