diff options
| author | Chandler Carruth <chandlerc@gmail.com> | 2015-02-13 04:30:44 +0000 |
|---|---|---|
| committer | Chandler Carruth <chandlerc@gmail.com> | 2015-02-13 04:30:44 +0000 |
| commit | 5457e20d2739db63f654c70269418a8153e8c945 (patch) | |
| tree | f26ef2ab2fa6f55e6ebafb2a32712dc40a166aa7 | |
| parent | e5c30e4e10491107c8c6692a0150e624d561fd2a (diff) | |
| download | bcm5719-llvm-5457e20d2739db63f654c70269418a8153e8c945.tar.gz bcm5719-llvm-5457e20d2739db63f654c70269418a8153e8c945.zip | |
[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
| -rw-r--r-- | llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp b/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp index 0851f436904..8cf0450dd9e 100644 --- a/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp +++ b/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp @@ -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); } } |

