Author: Jon Chesterfield Date: 2020-12-16T16:40:37Z New Revision: b607837c75d04cc007dcf855983dfa3b69f63d73
URL: https://github.com/llvm/llvm-project/commit/b607837c75d04cc007dcf855983dfa3b69f63d73 DIFF: https://github.com/llvm/llvm-project/commit/b607837c75d04cc007dcf855983dfa3b69f63d73.diff LOG: [libomptarget][nfc] Replace static const with enum [libomptarget][nfc] Replace static const with enum Semantically identical. Replaces 0xff... with ~0 to spare counting the f. Has the advantage that the compiler doesn't need to prove the 4/8 byte value dead before discarding it, and sidesteps the compilation question associated with what static means for a single source language. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D93328 Added: Modified: openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.h openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.h Removed: ################################################################################ diff --git a/openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.h b/openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.h index 34794587e0fe..d25ea8559c05 100644 --- a/openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.h +++ b/openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.h @@ -74,8 +74,9 @@ INLINE uint64_t __kmpc_impl_pack(uint32_t lo, uint32_t hi) { return (((uint64_t)hi) << 32) | (uint64_t)lo; } -static const __kmpc_impl_lanemask_t __kmpc_impl_all_lanes = - UINT64_C(0xffffffffffffffff); +enum : __kmpc_impl_lanemask_t { + __kmpc_impl_all_lanes = ~(__kmpc_impl_lanemask_t)0 +}; DEVICE __kmpc_impl_lanemask_t __kmpc_impl_lanemask_lt(); diff --git a/openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.h b/openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.h index 46ce751c44c4..411e1676b7c7 100644 --- a/openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.h +++ b/openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.h @@ -91,8 +91,9 @@ INLINE uint64_t __kmpc_impl_pack(uint32_t lo, uint32_t hi) { return val; } -static const __kmpc_impl_lanemask_t __kmpc_impl_all_lanes = - UINT32_C(0xffffffff); +enum : __kmpc_impl_lanemask_t { + __kmpc_impl_all_lanes = ~(__kmpc_impl_lanemask_t)0 +}; INLINE __kmpc_impl_lanemask_t __kmpc_impl_lanemask_lt() { __kmpc_impl_lanemask_t res; _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits