Skip to content

Commit

Permalink
[GlobalOpt] Switch an explicit loop to llvm::all_of(). NFCI.
Browse files Browse the repository at this point in the history
llvm-svn: 310453
  • Loading branch information
dcci committed Aug 9, 2017
1 parent c10e34d commit c163fac
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions llvm/lib/Transforms/IPO/GlobalOpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,11 +404,8 @@ static bool IsUserOfGlobalSafeForSRA(User *U, GlobalValue *GV) {
}
}

for (User *UU : U->users())
if (!isSafeSROAElementUse(UU))
return false;

return true;
return llvm::all_of(U->users(),
[](User *UU) { return isSafeSROAElementUse(UU); });
}

/// Look at all uses of the global and decide whether it is safe for us to
Expand Down

0 comments on commit c163fac

Please sign in to comment.