[llvm-commits] [llvm] r108513 - in /llvm/trunk: lib/VMCore/Dominators.cpp test/Transforms/LoopSimplify/2010-07-15-IncorrectDomFrontierUpdate.ll
Tobias Grosser
grosser at fim.uni-passau.de
Thu Jul 15 22:59:46 PDT 2010
Author: grosser
Date: Fri Jul 16 00:59:45 2010
New Revision: 108513
URL: http://llvm.org/viewvc/llvm-project?rev=108513&view=rev
Log:
LoopSimplify does not update domfrontier correctly.
This fixes PR7649.
Added:
llvm/trunk/test/Transforms/LoopSimplify/2010-07-15-IncorrectDomFrontierUpdate.ll
Modified:
llvm/trunk/lib/VMCore/Dominators.cpp
Modified: llvm/trunk/lib/VMCore/Dominators.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Dominators.cpp?rev=108513&r1=108512&r2=108513&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Dominators.cpp (original)
+++ llvm/trunk/lib/VMCore/Dominators.cpp Fri Jul 16 00:59:45 2010
@@ -148,11 +148,11 @@
}
// If NewBB dominates NewBBSucc, then DF(NewBB) is now going to be the
- // DF(PredBlocks[0]) without the stuff that the new block does not dominate
+ // DF(NewBBSucc) without the stuff that the new block does not dominate
// a predecessor of.
DominatorTree &DT = getAnalysis<DominatorTree>();
if (DT.dominates(NewBB, NewBBSucc)) {
- DominanceFrontier::iterator DFI = find(PredBlocks[0]);
+ DominanceFrontier::iterator DFI = find(NewBBSucc);
if (DFI != end()) {
DominanceFrontier::DomSetType Set = DFI->second;
// Filter out stuff in Set that we do not dominate a predecessor of.
Added: llvm/trunk/test/Transforms/LoopSimplify/2010-07-15-IncorrectDomFrontierUpdate.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopSimplify/2010-07-15-IncorrectDomFrontierUpdate.ll?rev=108513&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/LoopSimplify/2010-07-15-IncorrectDomFrontierUpdate.ll (added)
+++ llvm/trunk/test/Transforms/LoopSimplify/2010-07-15-IncorrectDomFrontierUpdate.ll Fri Jul 16 00:59:45 2010
@@ -0,0 +1,20 @@
+; RUN: opt < %s -domfrontier -loopsimplify -domfrontier -verify-dom-info -analyze
+
+
+define void @a() nounwind {
+entry:
+ br i1 undef, label %bb37, label %bb1.i
+
+bb1.i: ; preds = %bb1.i, %bb
+ %indvar = phi i64 [ %indvar.next, %bb1.i ], [ 0, %entry ] ; <i64> [#uses=1]
+ %indvar.next = add i64 %indvar, 1 ; <i64> [#uses=2]
+ %exitcond = icmp eq i64 %indvar.next, 576 ; <i1> [#uses=1]
+ br i1 %exitcond, label %bb37, label %bb1.i
+
+bb37: ; preds = %bb1.i, %bb
+ br label %return
+
+
+return: ; preds = %bb39
+ ret void
+}
More information about the llvm-commits
mailing list