[llvm] [AMDGPU][InsertWaitCnts] Make HWEvent a BitMask (PR #203864)
Pierre van Houtryve via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 23 02:55:14 PDT 2026
Pierre-vh wrote:
> Why not use `BitmaskEnum` to generate the bitwise ops? That file already creates a familiar interface for all bitmask enums. For example, `BitmaskEnum` already has a `^=` operator which can be used to unset individual bits. That seems cleaner than the bespoke `remove()`.
I addressed the other comments, but the simple reason is that having some additional operators is valuable. If we just have a raw enum class + BitMaskEnum it creates friction in some places. Examples:
- No default initialization
- Lots of operations need separate functions, so no dot operator.
I initially started this as an enum class exactly like that but after I wasted time tracking down a bug due to an uninitialized mask + seeings thins like `contains(A, B)` which weren't self-documenting, I preferred to do this instead and I am much happier with it
https://github.com/llvm/llvm-project/pull/203864
More information about the llvm-commits
mailing list