Currently, calling omp_target_memcpy with 0 size is treated as an error and the function returns OFFLOAD_FAIL. However, there is nothing in the standard prohibiting a 0-length memcpy. This patch changes the current behavior and makes omp_target_memcpy return immediately with OFFLOAD_SUCCESS if length is 0.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Semantic change is good.
Did you consider putting the equal zero test within the existing <= condition? Length zero should be infrequent (and when statically detected we should elide the call), so we can have one fewer conditional branch on the hot path. Probably in the noise though.