[PATCH] D83916: Fixed warning about signed/unsigned comparison

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 15 15:40:42 PDT 2020


rampitec created this revision.
rampitec added reviewers: arsenm, lbenes.
Herald added subscribers: hiraditya, wdng.
Herald added a project: LLVM.

I've got the report clang11 issues signed/unsigned mismatch
warning here. For some reason only clang11 seems to issue
this warning.


https://reviews.llvm.org/D83916

Files:
  llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp


Index: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
===================================================================
--- llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -7407,7 +7407,7 @@
 
       while (SameTypeIt != E &&
              (*SameTypeIt)->getType() == EltTy &&
-             (SameTypeIt - IncIt) < MaxNumElts) {
+             unsigned(SameTypeIt - IncIt) < MaxNumElts) {
         VisitedInstrs.insert(*SameTypeIt);
         ++SameTypeIt;
       }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83916.278330.patch
Type: text/x-patch
Size: 521 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200715/e327fc3b/attachment.bin>


More information about the llvm-commits mailing list