forked from OSchip/llvm-project
[unroll] Don't check the loop set for whether an instruction is
contained in it each time we try to add it to the worklist, just check this when pulling it off the worklist. That way we do it at most once per instruction with the cost of the worklist set we would need to pay anyways. llvm-svn: 229060
This commit is contained in:
parent
e5c30e4e10
commit
5457e20d27
|
@ -472,8 +472,6 @@ public:
|
|||
Instruction *UI = dyn_cast<Instruction>(U);
|
||||
if (!UI)
|
||||
continue;
|
||||
if (!L->contains(UI))
|
||||
continue;
|
||||
Worklist.insert(UI);
|
||||
}
|
||||
}
|
||||
|
@ -483,14 +481,14 @@ public:
|
|||
// its users as well.
|
||||
while (!Worklist.empty()) {
|
||||
Instruction *I = Worklist.pop_back_val();
|
||||
if (!L->contains(I))
|
||||
continue;
|
||||
if (!visit(I))
|
||||
continue;
|
||||
for (User *U : I->users()) {
|
||||
Instruction *UI = dyn_cast<Instruction>(U);
|
||||
if (!UI)
|
||||
continue;
|
||||
if (!L->contains(UI))
|
||||
continue;
|
||||
Worklist.insert(UI);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue