Open HazyFish opened 1 year ago
cc @androm3da
@llvm/issue-subscribers-backend-hexagon
Passing/returning boolean vectors to functions has never been supported, there no ABI for that. If you want to pass those, you need to convert them to vectors of integers and back.
I can reproduce this crash with LLVM 13 and 14 (I have builds with assertions enabled). With LLVM 10 (without assertions) the code compiles, but the output doesn't pass the indicated value to f.1
.
Passing/returning boolean vectors to functions has never been supported, there no ABI for that. If you want to pass those, you need to convert them to vectors of integers and back.
Sorry if this is a dumb question @kparzysz-quic but could a compiler like clang produce the IR above? And if it did, it would be a clang defect for not recognizing the target's ABI?
It's a legitimate question---I don't think that right now people have the ability to write C/C++ code that would translate to something like this, but clang already has some sort of extension allowing boolean vectors (which is only enabled for some GPU target, IIRC), so eventually it may be possible to do this.
The issue is that we'd need to amend the ABI, to either allow passing/returning boolean vectors, or specify the conversions. At the moment LLVM is (AFAIK) the only compiler targeting Hexagon with HVX, so we could get away with handling it internally to LLVM, but it would make it harder for other potential future compilers/code generators to be binary-compatible with LLVM.
My point was really that this is not a regression. Any code trying to do this has never really worked correctly even if it compiled without errors.
The issue is that we'd need to amend the ABI, to either allow passing/returning boolean vectors, or specify the conversions.
Ok, I think that might be useful, I'll look into this along with the architecture documentation improvements we'll need.
My point was really that this is not a regression. Any code trying to do this has never really worked correctly even if it compiled without errors.
Ok, I understand now.
@kparzysz-quic I found another case related to Boolean vectors.
https://godbolt.org/z/cqGEhTM8G
Is this also something that's not supported by ABI, or is it something wrong with the backend?
That's an actual bug. Thanks for reporting it.
Ok, I will open a new issue for that
That's an actual bug. Thanks for reporting it.
Description
Hexagon backend cannot handle call operand v8i1, v16i1, v32i1 with latest LLVM. The problem doesn't exist when using LLVM 14 / 15 release.
Minimal Reproduction
https://godbolt.org/z/obdbYonah
Code
Stack Trace