-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[LLVM] Fix get tm allow_missing check pos #13591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[LLVM] Fix get tm allow_missing check pos #13591
Conversation
|
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.
Generated by tvm-bot |
echuraev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks
| 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) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, you're right.
Fix get tm allow_missing check pos
Fix get tm allow_missing check pos
It seems that
GetOrCreateTargetMachine's failure check would be out oflookupTarget' nest scope.