Fix -mfloat-abi=soft compilation for ARM with OpenCL target#6150
Merged
tqchen merged 1 commit intoapache:masterfrom Aug 5, 2020
Merged
Fix -mfloat-abi=soft compilation for ARM with OpenCL target#6150tqchen merged 1 commit intoapache:masterfrom
tqchen merged 1 commit intoapache:masterfrom
Conversation
cf1db08 to
19a7795
Compare
Contributor
Author
|
Looks like some unrelated failures in ci? |
Member
|
Yes, looks like the CI failure is not related |
19a7795 to
01d6a32
Compare
01d6a32 to
647b7b9
Compare
Contributor
Author
|
@kevinthesun CI is passing now |
wjliu1998
pushed a commit
to wjliu1998/incubator-tvm
that referenced
this pull request
Aug 13, 2020
trevor-m
pushed a commit
to trevor-m/tvm
that referenced
this pull request
Aug 26, 2020
trevor-m
pushed a commit
to trevor-m/tvm
that referenced
this pull request
Aug 26, 2020
trevor-m
pushed a commit
to trevor-m/tvm
that referenced
this pull request
Aug 26, 2020
trevor-m
pushed a commit
to trevor-m/tvm
that referenced
this pull request
Sep 2, 2020
trevor-m
pushed a commit
to neo-ai/tvm
that referenced
this pull request
Sep 3, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, any extra attributes of the llvm target are not being passed through to LLVMModule during
ModulePackImportsToLLVM. This will cause compilation to fail witherror: /tmp/tmpctakbpk1/devc.o uses VFP register arguments, output does notwhen the target is opencl and the target_host requires-mfloat-abi=soft. This regression was introduced by #4657.There are two reasons why:
python/tvm/runtime/module.pyuses "_get_target_triple" to get the target triple to use forModulePackImportsToLLVM. However, the implementation of that function returnstm_->getTargetTriple().str()which will only have the standard<arch><sub>-<vendor>-<sys>-<abi>and is missing any extra flags or attributes such as-mfloat-abi=soft.module_->getTargetTriple()is called which again doesn't have the extra flags and attributes: https://github.com/apache/incubator-tvm/blob/master/src/target/llvm/llvm_module.cc#L254This PR fixes those problems by:
_get_target_triple(only mfloat-abi for now). This part doesn't seem ideal to me. Any thoughts on how to improve? Can we store the user's full target string earlier on?CodeGenBlobso thatLLVMModuleNode::Init(std::unique_ptr<llvm::Module> module, std::shared_ptr<llvm::LLVMContext> ctx)can retrieve it: https://github.com/apache/incubator-tvm/blob/master/src/target/llvm/llvm_module.cc#L247 This matches whatLLVMModuleNode::Init(const IRModule& mod, std::string target)already does.Discuss post: https://discuss.tvm.ai/t/opencl-target-for-32-bit-arm-linux-android-broken-after-pr-4657/7252
Fixes #6019