From f9a1b2a4cfd4b6b5fc92a09c326f6daef4808059 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 13 Dec 2010 23:02:19 +0000 Subject: [PATCH] temporarily disable part of my previous patch, which causes an iterator invalidation issue, causing a crash on some versions of perlbmk. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121728 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/SimplifyCFG.cpp | 2 +- test/Transforms/SimplifyCFG/switch_create.ll | 51 ++++++++++++++------ 2 files changed, 37 insertions(+), 16 deletions(-) diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp index 12960c94645..61ddc7c0d4a 100644 --- a/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/lib/Transforms/Utils/SimplifyCFG.cpp @@ -1515,7 +1515,7 @@ bool llvm::FoldBranchToCommonDest(BranchInst *BI) { AddPredecessorToBlock(FalseDest, PredBlock, BB); PBI->setSuccessor(1, FalseDest); } - return SimplifyCFG(PBI->getParent()) | true; + return SimplifyCFG(BB) | true; } return false; } diff --git a/test/Transforms/SimplifyCFG/switch_create.ll b/test/Transforms/SimplifyCFG/switch_create.ll index 74a51d9c79d..e11f04e2da6 100644 --- a/test/Transforms/SimplifyCFG/switch_create.ll +++ b/test/Transforms/SimplifyCFG/switch_create.ll @@ -253,21 +253,21 @@ lor.end: ; preds = %lor.rhs, %lor.lhs.f ret i32 %conv46 ; CHECK: @test9 -; CHECK: %cmp = icmp ult i8 %c, 33 -; CHECK: br i1 %cmp, label %lor.end, label %switch.early.test - -; CHECK: switch.early.test: -; CHECK: switch i8 %c, label %lor.rhs [ -; CHECK: i8 46, label %lor.end -; CHECK: i8 44, label %lor.end -; CHECK: i8 58, label %lor.end -; CHECK: i8 59, label %lor.end -; CHECK: i8 60, label %lor.end -; CHECK: i8 62, label %lor.end -; CHECK: i8 34, label %lor.end -; CHECK: i8 92, label %lor.end -; CHECK: i8 39, label %lor.end -; CHECK: ] +; HECK: %cmp = icmp ult i8 %c, 33 +; HECK: br i1 %cmp, label %lor.end, label %switch.early.test + +; HECK: switch.early.test: +; HECK: switch i8 %c, label %lor.rhs [ +; HECK: i8 46, label %lor.end +; HECK: i8 44, label %lor.end +; HECK: i8 58, label %lor.end +; HECK: i8 59, label %lor.end +; HECK: i8 60, label %lor.end +; HECK: i8 62, label %lor.end +; HECK: i8 34, label %lor.end +; HECK: i8 92, label %lor.end +; HECK: i8 39, label %lor.end +; HECK: ] } define i32 @test10(i32 %mode, i1 %Cond) { @@ -331,3 +331,24 @@ return: ; preds = %if.end, %if.then ; CHECK: i32 4, label %return ; CHECK: ] } + +define void @test12() nounwind { +entry: + br label %bb49.us.us + +bb49.us.us: + %A = icmp eq i32 undef, undef + br i1 %A, label %bb55.us.us, label %malformed + +bb48.us.us: + %B = icmp ugt i32 undef, undef + br i1 %B, label %bb55.us.us, label %bb49.us.us + +bb55.us.us: + br label %bb48.us.us + +malformed: + ret void +; CHECK: @test12 + +} \ No newline at end of file -- 2.34.1