[llvm] r310453 - [GlobalOpt] Switch an explicit loop to llvm::all_of(). NFCI.
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 9 02:23:29 PDT 2017
Author: davide
Date: Wed Aug 9 02:23:29 2017
New Revision: 310453
URL: http://llvm.org/viewvc/llvm-project?rev=310453&view=rev
Log:
[GlobalOpt] Switch an explicit loop to llvm::all_of(). NFCI.
Modified:
llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp
Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp?rev=310453&r1=310452&r2=310453&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Wed Aug 9 02:23:29 2017
@@ -404,11 +404,8 @@ static bool IsUserOfGlobalSafeForSRA(Use
}
}
- 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
More information about the llvm-commits
mailing list