summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2016-03-28 18:07:40 +0000
committerReid Kleckner <rnk@google.com>2016-03-28 18:07:40 +0000
commitba85781f5846d156ff867340a203856aa1957dd6 (patch)
tree9f26256393faeed45a564a00c029a40ac47e5ee2 /llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp
parent6601a4420b3862d6cffc4180c1a7bcd238576be6 (diff)
downloadbcm5719-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.cpp12
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;
}
OpenPOWER on IntegriCloud