This patch add codegen support for the has_device_addr clause. It use the same logic of is_device_ptr.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
seeing a buildbot failure on amdgpu bot
https://lab.llvm.org/buildbot/#/builders/193/builds/18788
clang/test/OpenMP/target_has_device_addr_codegen.cpp | ||
---|---|---|
317 | This looks the same as is_device_ptr(k). I don't think that's the correct thing to do for has_device_addr(k). For has_device_addr(k), the value being stored to %offload.baseptrs should be i32** [[K]], and not a load from it. Similarly, the kernel argument should be [[K]] and not [[TMP2]] (which is a load from [[K]]). | |
openmp/libomptarget/test/mapping/has_device_addr.cpp | ||
19 | The clause used here should either be has_device_addr(data_device[0]) or is_device_ptr(data_device). data_device itself is an i32** which is allocated on the host (%data_device = alloca i32*). Its pointee has a device address (%data_device_0 = load i32*, i32** %data_device). |
This looks the same as is_device_ptr(k). I don't think that's the correct thing to do for has_device_addr(k). For has_device_addr(k), the value being stored to %offload.baseptrs should be i32** [[K]], and not a load from it.
Similarly, the kernel argument should be [[K]] and not [[TMP2]] (which is a load from [[K]]).