[libc-commits] [libc] 99c9515 - [libc][obvious] Correctly hoist mask out of the loop

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Tue May 23 10:21:18 PDT 2023


Author: Joseph Huber
Date: 2023-05-23T12:21:10-05:00
New Revision: 99c9515b370886fde4b87248eaab77a37848ed25

URL: https://github.com/llvm/llvm-project/commit/99c9515b370886fde4b87248eaab77a37848ed25
DIFF: https://github.com/llvm/llvm-project/commit/99c9515b370886fde4b87248eaab77a37848ed25.diff

LOG: [libc][obvious] Correctly hoist mask out of the loop

Summry:
This was accidentally dropped from a previous patch following a rebase.
Fix it to where it's consistent.

Differential Revision: https://reviews.llvm.org/D151232

Added: 
    

Modified: 
    libc/src/__support/RPC/rpc.h

Removed: 
    


################################################################################
diff  --git a/libc/src/__support/RPC/rpc.h b/libc/src/__support/RPC/rpc.h
index 836cdbecf539..de08ec063915 100644
--- a/libc/src/__support/RPC/rpc.h
+++ b/libc/src/__support/RPC/rpc.h
@@ -443,7 +443,8 @@ LIBC_INLINE void Port<T>::send_n(const void *const *src, uint64_t *size) {
     inline_memcpy(&buffer->data[1], lane_value(src, id), len);
   });
   uint64_t idx = sizeof(Buffer::data) - sizeof(uint64_t);
-  while (gpu::ballot(process.get_packet(index).header.mask, idx < num_sends)) {
+  uint64_t mask = process.get_packet(index).header.mask;
+  while (gpu::ballot(mask, idx < num_sends)) {
     send([=](Buffer *buffer, uint32_t id) {
       uint64_t len = lane_value(size, id) - idx > sizeof(Buffer::data)
                          ? sizeof(Buffer::data)


        


More information about the libc-commits mailing list