[llvm] r318354 - [GVNHoist] Fix a signed/unsigned comparison warning that occurs in 32-bit builds with gcc.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 15 16:19:59 PST 2017
Author: ctopper
Date: Wed Nov 15 16:19:59 2017
New Revision: 318354
URL: http://llvm.org/viewvc/llvm-project?rev=318354&view=rev
Log:
[GVNHoist] Fix a signed/unsigned comparison warning that occurs in 32-bit builds with gcc.
std::distance returns ptrdiff_t which is signed. 64-bit builds don't notice because type promotion widens the unsigned first.
Modified:
llvm/trunk/lib/Transforms/Scalar/GVNHoist.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/GVNHoist.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVNHoist.cpp?rev=318354&r1=318353&r2=318354&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/GVNHoist.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/GVNHoist.cpp Wed Nov 15 16:19:59 2017
@@ -578,7 +578,7 @@ private:
// Returns true when the values are flowing out to each edge.
bool valueAnticipable(CHIArgs C, TerminatorInst *TI) const {
- if (TI->getNumSuccessors() > std::distance(C.begin(), C.end()))
+ if (TI->getNumSuccessors() > (unsigned)std::distance(C.begin(), C.end()))
return false; // Not enough args in this CHI.
for (auto CHI : C) {
More information about the llvm-commits
mailing list