yxsamliu wrote: `__AMDGCN_WAVEFRONT_SIZE__` could also be used in other offloading languages e.g. OpenMP. The check for non-constantness is not specific to HIP.
It is a constant when the triple is amdgcn and -target-cpu is specified. Otherwise it should not be treated as constant. I think you could refactor the code to introduce one more function Sema::isMacroTargetSpecificConstant, which returns whether a macro is constant based on triple and CPU. Then diagnose it in HIP like the current patch does. In this way, the check may be used by other languages. https://github.com/llvm/llvm-project/pull/109663 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits