Skip to content

Commit 062bcf3

Browse files
committed
[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
1 parent e4572c6 commit 062bcf3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Transforms/Scalar/GVNHoist.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ class GVNHoist {
578578

579579
// Returns true when the values are flowing out to each edge.
580580
bool valueAnticipable(CHIArgs C, TerminatorInst *TI) const {
581-
if (TI->getNumSuccessors() > std::distance(C.begin(), C.end()))
581+
if (TI->getNumSuccessors() > (unsigned)std::distance(C.begin(), C.end()))
582582
return false; // Not enough args in this CHI.
583583

584584
for (auto CHI : C) {

0 commit comments

Comments
 (0)