This patch ensures that all outlined functions parameters are i64 and ptr when compiling for a target device, which is what the OpenMP runtime expects. The values are then cast to the correct type inside the kernel.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I would strongly recommend to make sure the arguments are 64 bit without i2p/p2i casts. This has all sorts of bad effects and it is a reason our clang kernels perform often poorly.
If the size of a pointer is 64-bit can we use the pointers directly, unless pointers are 32-bit and then fall back on the i2p/p2i casts?
clang ABI lowering adds padding arguments and/or structs to account for this, for the 32-bit case it would emit something like { ptr, i32 }
llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp | ||
---|---|---|
4299 | Assuming 64-bit pointer |
llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp | ||
---|---|---|
4299 |
Yes, should there be a comment? |
llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp | ||
---|---|---|
4299 | Yes, I was also more thinking it's assuming a 64-bit address space specifically |
llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp | ||
---|---|---|
4299 | Yes, both the given address space and the generic. Does LLVM allow different pointer sizes for different address spaces? |
Assuming 64-bit pointer