When defining a BitEnumAttr and enum class is also generated. This enum class will have the following operators being defined:
|
// inline constexpr <enum-type> operator|(<enum-type> a, <enum-type> b); |
|
// inline constexpr <enum-type> operator&(<enum-type> a, <enum-type> b); |
|
// inline constexpr <enum-type> operator^(<enum-type> a, <enum-type> b); |
|
// inline constexpr <enum-type> operator~(<enum-type> bits); |
Adding missing compound assignment operators |=, &=, ^=, would be an improvement that would make some code more concise. For example, in the VectorToSPIRV lowering process, we have some lines of code that could be simplified from:
auto memoryAccess = spirv::MemoryAccess::None
memoryAccess = memoryAccess | spirv::MemoryAccess::Aligned;
to
memoryAccess |= spirv::MemoryAccess::Aligned;