diff options
author | Duncan Sands <baldrick@free.fr> | 2012-02-05 19:43:37 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2012-02-05 19:43:37 +0000 |
commit | 9066fb5c4350c3b02fad69e9ed883fdb213ae01a (patch) | |
tree | 217e31cf0799c663d21ed1f33831ea3746d8ec44 | |
parent | 04d612aa12efd1aca4505ad07e23e7e82fe93823 (diff) | |
download | bcm5719-llvm-9066fb5c4350c3b02fad69e9ed883fdb213ae01a.tar.gz bcm5719-llvm-9066fb5c4350c3b02fad69e9ed883fdb213ae01a.zip |
Neaten up this method. Check that if there is only one
predecessor then it's Src.
llvm-svn: 149843
-rw-r--r-- | llvm/lib/Transforms/Scalar/GVN.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp index f6d6b90b99a..654125342a4 100644 --- a/llvm/lib/Transforms/Scalar/GVN.cpp +++ b/llvm/lib/Transforms/Scalar/GVN.cpp @@ -1999,10 +1999,10 @@ static bool isOnlyReachableViaThisEdge(BasicBlock *Src, BasicBlock *Dst, // only reachable from Src, in practice it is pointless since at the time // GVN runs all such loops have preheaders, which means that Dst will have // been changed to have only one predecessor, namely Src. - pred_iterator PI = pred_begin(Dst), PE = pred_end(Dst); - assert(PI != PE && "No edge between these basic blocks!"); + BasicBlock *Pred = Dst->getSinglePredecessor(); + assert((!Pred || Pred == Src) && "No edge between these basic blocks!"); (void)Src; - return PE == ++PI; + return Pred != 0; } /// processInstruction - When calculating availability, handle an instruction |