[clang] [llvm] [HLSL] AST support for WaveSize attribute. (PR #101240)

Chris B via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 30 10:58:29 PDT 2024


================
@@ -357,6 +398,74 @@ void SemaHLSL::handleNumThreadsAttr(Decl *D, const ParsedAttr &AL) {
     D->addAttr(NewAttr);
 }
 
+static bool isValidWaveSizeValue(unsigned Value) {
+  return (Value >= 4 && Value <= 128 && ((Value & (Value - 1)) == 0));
----------------
llvm-beanz wrote:

Can we instead use `llvm::isPowerOf2_32`? That is clearer to read.

https://github.com/llvm/llvm-project/pull/101240


More information about the cfe-commits mailing list