[clang] 1bc52c3 - [CGOpenMP] Use getSigned() for NumTeams constant

Nikita Popov via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 16 03:30:30 PST 2025


Author: Nikita Popov
Date: 2025-12-16T12:30:21+01:00
New Revision: 1bc52c34c26d7f257365db1f2ec2e0e56fe97e15

URL: https://github.com/llvm/llvm-project/commit/1bc52c34c26d7f257365db1f2ec2e0e56fe97e15
DIFF: https://github.com/llvm/llvm-project/commit/1bc52c34c26d7f257365db1f2ec2e0e56fe97e15.diff

LOG: [CGOpenMP] Use getSigned() for NumTeams constant

This value may be -1.

Added: 
    

Modified: 
    clang/lib/CodeGen/CGOpenMPRuntime.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/CodeGen/CGOpenMPRuntime.cpp b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
index 43ec1572aaf90..39cf3052011e1 100644
--- a/clang/lib/CodeGen/CGOpenMPRuntime.cpp
+++ b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
@@ -6477,7 +6477,7 @@ llvm::Value *CGOpenMPRuntime::emitNumTeamsForTargetDirective(
   }
 
   assert(MinNT == MaxNT && "Num threads ranges require handling here.");
-  return llvm::ConstantInt::get(CGF.Int32Ty, MinNT);
+  return llvm::ConstantInt::getSigned(CGF.Int32Ty, MinNT);
 }
 
 /// Check for a num threads constant value (stored in \p DefaultVal), or


        


More information about the cfe-commits mailing list