diff options
author | Reid Kleckner <rnk@google.com> | 2016-03-28 18:07:40 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2016-03-28 18:07:40 +0000 |
commit | ba85781f5846d156ff867340a203856aa1957dd6 (patch) | |
tree | 9f26256393faeed45a564a00c029a40ac47e5ee2 /llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp | |
parent | 6601a4420b3862d6cffc4180c1a7bcd238576be6 (diff) | |
download | bcm5719-llvm-ba85781f5846d156ff867340a203856aa1957dd6.tar.gz bcm5719-llvm-ba85781f5846d156ff867340a203856aa1957dd6.zip |
Revert "[SimlifyCFG] Prevent passes from destroying canonical loop structure, especially for nested loops"
This reverts commit r264596.
It does not compile.
llvm-svn: 264604
Diffstat (limited to 'llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp b/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp index 72ce7693ec0..687d388701e 100644 --- a/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp +++ b/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp @@ -28,7 +28,6 @@ #include "llvm/Analysis/GlobalsModRef.h" #include "llvm/Analysis/AssumptionCache.h" #include "llvm/Analysis/TargetTransformInfo.h" -#include "llvm/Analysis/CFG.h" #include "llvm/IR/Attributes.h" #include "llvm/IR/CFG.h" #include "llvm/IR/Constants.h" @@ -131,20 +130,13 @@ static bool iterativelySimplifyCFG(Function &F, const TargetTransformInfo &TTI, AssumptionCache *AC, unsigned BonusInstThreshold) { bool Changed = false; - bool LocalChange = true; - - SmallVector<std::pair<const BasicBlock *, const BasicBlock *>, 32> Edges; - FindFunctionBackedges(F, Edges); - SmallPtrSet<BasicBlock *, 16> LoopHeaders; - for (unsigned i = 0, e = Edges.size(); i != e; ++i) - LoopHeaders.insert(const_cast<BasicBlock *>(Edges[i].second)); - + bool LocalChange = true; while (LocalChange) { LocalChange = false; // Loop over all of the basic blocks and remove them if they are unneeded. for (Function::iterator BBIt = F.begin(); BBIt != F.end(); ) { - if (SimplifyCFG(&*BBIt++, TTI, BonusInstThreshold, AC, &LoopHeaders)) { + if (SimplifyCFG(&*BBIt++, TTI, BonusInstThreshold, AC)) { LocalChange = true; ++NumSimpl; } |