mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-22 10:29:35 +00:00
[unroll] Replace a boolean, for loop, condition, and break with
std::all_of and a lambda. Much cleaner, no functionality changed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229058 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
758256535c
commit
361ac0df65
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user