[llvm-branch-commits] [llvm] b890faf - [OpenMPIRBuilder] Silence compiler warning. NFC.

Michael Kruse via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sat Jan 23 19:05:56 PST 2021


Author: Michael Kruse
Date: 2021-01-23T21:00:37-06:00
New Revision: b890fafe672c01daac4ca2b8f740cd0cade78060

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

LOG: [OpenMPIRBuilder] Silence compiler warning. NFC.

Address the compiler warning
OMPIRBuilder.cpp:1232:27: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]

Added: 
    

Modified: 
    llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp b/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
index e70847b2f02c..1f67aecb57e9 100644
--- a/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
+++ b/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
@@ -1228,9 +1228,9 @@ static void removeUnusedBlocksFromParent(ArrayRef<BasicBlock *> BBs) {
 std::vector<CanonicalLoopInfo *>
 OpenMPIRBuilder::tileLoops(DebugLoc DL, ArrayRef<CanonicalLoopInfo *> Loops,
                            ArrayRef<Value *> TileSizes) {
-  int NumLoops = Loops.size();
-  assert(TileSizes.size() == NumLoops &&
+  assert(TileSizes.size() == Loops.size() &&
          "Must pass as many tile sizes as there are loops");
+  int NumLoops = Loops.size();
   assert(NumLoops >= 1 && "At least one loop to tile required");
 
   CanonicalLoopInfo *OutermostLoop = Loops.front();


        


More information about the llvm-branch-commits mailing list