[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
This commit is contained in:
Craig Topper 2017-11-16 00:19:59 +00:00
parent e4572c6b73
commit 062bcf30b1
1 changed files with 1 additions and 1 deletions

View File

@ -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) {