From ba85781f5846d156ff867340a203856aa1957dd6 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Mon, 28 Mar 2016 18:07:40 +0000 Subject: Revert "[SimlifyCFG] Prevent passes from destroying canonical loop structure, especially for nested loops" This reverts commit r264596. It does not compile. llvm-svn: 264604 --- llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp') 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, 32> Edges; - FindFunctionBackedges(F, Edges); - SmallPtrSet LoopHeaders; - for (unsigned i = 0, e = Edges.size(); i != e; ++i) - LoopHeaders.insert(const_cast(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; } -- cgit v1.2.3