[PATCH] D108380: [openmp][nfc] Refactor GridValues

Jon Chesterfield via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 23 07:09:46 PDT 2021


JonChesterfield added inline comments.


================
Comment at: clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp:551
+      llvm::Log2_32(CGF.getTarget().getGridValue().GV_Warp_Size);
+  unsigned LaneIDMask = ~0 >> (32u - LaneIDBits);
   auto &RT = static_cast<CGOpenMPRuntimeGPU &>(CGF.CGM.getOpenMPRuntime());
----------------
Bug is here. `~0 >> 27u == -1` (bad) and `~0u >> 27u == 31` (good). Win for exact codegen tests.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108380/new/

https://reviews.llvm.org/D108380



More information about the cfe-commits mailing list