[clang] [Clang] Restrict AMDGCN image built-ins (PR #180949)
Alexey Sachkov via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 6 02:58:12 PST 2026
================
@@ -293,7 +323,12 @@ bool SemaAMDGPU::CheckAMDGCNBuiltinFunctionCall(unsigned BuiltinID,
unsigned ArgCount = TheCall->getNumArgs() - 1;
llvm::APSInt Result;
- return (SemaRef.BuiltinConstantArg(TheCall, 1, Result)) ||
+ // Complain about dmask values which are too huge to fully fit into 4 bits
+ // (which is the actual size of the dmask in corresponding HW instructions).
+ constexpr unsigned DMaskArgNo = 1;
+ return (SemaRef.BuiltinConstantArgRange(TheCall, DMaskArgNo, /* Low = */ 0,
----------------
AlexeySachkov wrote:
Dropped in 56b4b4bc32c9cd45b9b3e54736ba07bfaef4b5b8
https://github.com/llvm/llvm-project/pull/180949
More information about the cfe-commits
mailing list