================ @@ -1296,6 +1303,157 @@ struct AAAMDGPUNoAGPR const char AAAMDGPUNoAGPR::ID = 0; +/// An abstract attribute to propagate the function attribute +/// "amdgpu-cluster-dims" from kernel entry functions to device functions. +struct AAAMDGPUClusterDims + : public StateWrapper<BooleanState, AbstractAttribute> { + using Base = StateWrapper<BooleanState, AbstractAttribute>; + AAAMDGPUClusterDims(const IRPosition &IRP, Attributor &A) : Base(IRP) {} + + /// Create an abstract attribute view for the position \p IRP. + static AAAMDGPUClusterDims &createForPosition(const IRPosition &IRP, + Attributor &A); + + /// See AbstractAttribute::getName(). + StringRef getName() const override { return "AAAMDGPUClusterDims"; } + + /// See AbstractAttribute::getIdAddr(). + const char *getIdAddr() const override { return &ID; } + + /// This function should return true if the type of the \p AA is + /// AAAMDGPUClusterDims. + static bool classof(const AbstractAttribute *AA) { + return (AA->getIdAddr() == &ID); ---------------- arsenm wrote:
```suggestion return AA->getIdAddr() == &ID; ``` https://github.com/llvm/llvm-project/pull/158076 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits