[llvm-commits] [llvm] r51887 - in /llvm/trunk: lib/Transforms/Scalar/LoopUnswitch.cpp test/Transforms/LoopUnswitch/2008-06-02-DomInfo.ll
Devang Patel
dpatel at apple.com
Mon Jun 2 15:52:57 PDT 2008
Author: dpatel
Date: Mon Jun 2 17:52:56 2008
New Revision: 51887
URL: http://llvm.org/viewvc/llvm-project?rev=51887&view=rev
Log:
Update dom tree. Fix PR 2372.
Added:
llvm/trunk/test/Transforms/LoopUnswitch/2008-06-02-DomInfo.ll
Modified:
llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp?rev=51887&r1=51886&r2=51887&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp Mon Jun 2 17:52:56 2008
@@ -569,7 +569,6 @@
// Insert the new branch.
BranchInst::Create(TrueDest, FalseDest, BranchVal, InsertPt);
-
}
@@ -607,6 +606,10 @@
// insert the new conditional branch.
EmitPreheaderBranchOnCondition(Cond, Val, NewExit, NewPH,
OrigPH->getTerminator());
+ if (DT) {
+ DT->changeImmediateDominator(NewExit, OrigPH);
+ DT->changeImmediateDominator(NewPH, OrigPH);
+ }
LPM->deleteSimpleAnalysisValue(OrigPH->getTerminator(), L);
OrigPH->getTerminator()->eraseFromParent();
Added: llvm/trunk/test/Transforms/LoopUnswitch/2008-06-02-DomInfo.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopUnswitch/2008-06-02-DomInfo.ll?rev=51887&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/LoopUnswitch/2008-06-02-DomInfo.ll (added)
+++ llvm/trunk/test/Transforms/LoopUnswitch/2008-06-02-DomInfo.ll Mon Jun 2 17:52:56 2008
@@ -0,0 +1,26 @@
+; RUN: llvm-as < %s | opt -loop-unswitch -instcombine -gvn -disable-output
+; PR2372
+target triple = "i386-pc-linux-gnu"
+
+define i32 @func_3(i16 signext %p_5, i16 signext %p_6) nounwind {
+entry:
+ %tmp3 = icmp eq i16 %p_5, 0 ; <i1> [#uses=1]
+ %tmp1314 = sext i16 %p_6 to i32 ; <i32> [#uses=1]
+ %tmp28 = icmp ugt i32 %tmp1314, 3 ; <i1> [#uses=1]
+ %bothcond = or i1 %tmp28, false ; <i1> [#uses=1]
+ br label %bb
+bb: ; preds = %bb54, %entry
+ br i1 %tmp3, label %bb54, label %bb5
+bb5: ; preds = %bb
+ br i1 %bothcond, label %bb54, label %bb31
+bb31: ; preds = %bb5
+ br label %bb54
+bb54: ; preds = %bb31, %bb5, %bb
+ br i1 false, label %bb64, label %bb
+bb64: ; preds = %bb54
+ %tmp6566 = sext i16 %p_6 to i32 ; <i32> [#uses=1]
+ %tmp68 = tail call i32 (...)* @func_18( i32 1, i32 %tmp6566, i32 1 ) nounwind ; <i32> [#uses=0]
+ ret i32 undef
+}
+
+declare i32 @func_18(...)
More information about the llvm-commits
mailing list