Presently AMDGPU backend errors with "unsupported call to function" upon encountering a call to llvm.log{,10}.{f16,f32} intrinsics. This patch adds custom lowering to avoid that error on both R600 and SI.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Better version: handle log10 as well, define constants locally, handle f16, do not pretend to handle f64. Tests incoming.
lib/Target/AMDGPU/AMDGPUISelLowering.cpp | ||
---|---|---|
250 ↗ | (On Diff #89036) | v2f32 and v4f32 can be moved to |
1891 ↗ | (On Diff #89036) | Does FDIV have good enough precision to do this? OCL requires 2.5 ULP, and I'm not sure how good the EG/CM hw is. |
lib/Target/AMDGPU/AMDGPUISelLowering.cpp | ||
---|---|---|
16–18 ↗ | (On Diff #91190) | Should name something else that doesn't collide with the standard names |
test/CodeGen/AMDGPU/llvm.log.f16.ll | ||
2 ↗ | (On Diff #91190) | Can you also add a gfx900 lines for testing <2 x hal> |
test/CodeGen/AMDGPU/llvm.log10.ll | ||
3 ↗ | (On Diff #91190) | Remove -mcpu=SI. Also should sort r600 lines later |
Sorry for the delay, updated patch, now passes tests, addressed all the comments. I would appreciate if you could check if I got all the R_ and A_ prefixes correctly (it's just variable naming, but there is some logic behind it -- register vs address, I presume?) in f16 tests.
No, absolutely not, it was a combination of limited time for Clover/Clang/LLVM and reluctance to finish things that are almost done but not "interesting" to complete. Thanks for the OK, full patch coming much sooner than this one. :-)
Should also handle f16?