[Openmp-commits] [PATCH] D46071: Representing the target device information in the LLVM IR
Alexey Bataev via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Wed Apr 25 11:47:16 PDT 2018
ABataev added a comment.
Hmm, I don't think this is correct. I think it is against the OpenMP standard.
According to OpenMP 4.5:
When an original variable is mapped to a device data environment and the associated 19 corresponding variable is not present in the device data environment, a new corresponding variable 20 (of the same type and size as the original variable) is created in the device data environment.
If you try to offload the code from x86_64 to i386 with long int type, for example, you won't be able to create the variable of the same size. I think, that this kind of offloading should be just not allowed.
Also, it means, that the code generated by the backend will be different rather than the code emitted by the frontend. You're going to break the ABI using some LLVM transformations.
That's very strange that you started with the patches. This is a very important thing that requires a discussion. I think you'd better start with the RFC. Currently, all this stuff looks like some kind of a hack.
More information about the Openmp-commits