Revert [GVN] Preserve loop related analysis/canonical forms.
This reverts r367332 (git commit 2d7227ec3ac91f36fc32b1c21e72e2f1f5d030ad)
llvm-svn: 367335
diff --git a/llvm/lib/Analysis/CFG.cpp b/llvm/lib/Analysis/CFG.cpp
index 8215b4e..18b83d6 100644
--- a/llvm/lib/Analysis/CFG.cpp
+++ b/llvm/lib/Analysis/CFG.cpp
@@ -87,18 +87,11 @@
/// with multiple predecessors.
bool llvm::isCriticalEdge(const Instruction *TI, unsigned SuccNum,
bool AllowIdenticalEdges) {
- assert(SuccNum < TI->getNumSuccessors() && "Illegal edge specification!");
- return isCriticalEdge(TI, TI->getSuccessor(SuccNum), AllowIdenticalEdges);
-}
-
-bool llvm::isCriticalEdge(const Instruction *TI, const BasicBlock *Dest,
- bool AllowIdenticalEdges) {
assert(TI->isTerminator() && "Must be a terminator to have successors!");
+ assert(SuccNum < TI->getNumSuccessors() && "Illegal edge specification!");
if (TI->getNumSuccessors() == 1) return false;
- assert(find(predecessors(Dest), TI->getParent()) != pred_end(Dest) &&
- "No edge between TI's block and Dest.");
-
+ const BasicBlock *Dest = TI->getSuccessor(SuccNum);
const_pred_iterator I = pred_begin(Dest), E = pred_end(Dest);
// If there is more than one predecessor, this is a critical edge...