1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 13:11:39 +01:00

[unroll] Replace a boolean, for loop, condition, and break with

std::all_of and a lambda. Much cleaner, no functionality
changed.

llvm-svn: 229058
This commit is contained in:
Chandler Carruth 2015-02-13 04:18:14 +00:00
parent 4ae15f9bf1
commit 94b76fa886

View File

@ -542,14 +542,10 @@ public:
continue;
if (DeadInstructions.count(I))
continue;
bool AllUsersFolded = true;
for (User *U : I->users())
if (!DeadInstructions.count(cast<Instruction>(U))) {
AllUsersFolded = false;
break;
}
if (AllUsersFolded) {
if (std::all_of(I->user_begin(), I->user_end(), [&](User *U) {
return DeadInstructions.count(cast<Instruction>(U));
})) {
NumberOfOptimizedInstructions += TTI.getUserCost(I);
DeadInstructions.insert(I);
EnqueueOperands(*I);