[llvm] [NVPTX] Constant fold blockDim when reqntid is specified (PR #191575)

Alex MacLean via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 13 20:11:48 PDT 2026


================
@@ -66,47 +66,64 @@ static bool runNVVMIntrRange(Function &F) {
   if (!isKernelFunction(F))
     return false;
 
-  const auto OverallReqNTID = getOverallReqNTID(F);
+  const auto ReqNTID = getReqNTID(F);
   const auto OverallMaxNTID = getOverallMaxNTID(F);
   const auto OverallClusterRank = getOverallClusterRank(F);
 
   // If this function lacks any range information, do nothing.
-  if (!(OverallReqNTID || OverallMaxNTID || OverallClusterRank))
+  if (!(ReqNTID.size() || OverallMaxNTID || OverallClusterRank))
----------------
AlexMaclean wrote:

I think !empty is preferable here

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


More information about the llvm-commits mailing list