From 062bcf30b19f5218a86db853966fa9b49d217076 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Thu, 16 Nov 2017 00:19:59 +0000 Subject: [PATCH] [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. llvm-svn: 318354 --- llvm/lib/Transforms/Scalar/GVNHoist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Transforms/Scalar/GVNHoist.cpp b/llvm/lib/Transforms/Scalar/GVNHoist.cpp index e90c89c..3b55184 100644 --- a/llvm/lib/Transforms/Scalar/GVNHoist.cpp +++ b/llvm/lib/Transforms/Scalar/GVNHoist.cpp @@ -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) { -- 2.7.4