From edb5842b7cf53ba4a4b5d3e1bad49a9fad47c02b Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Sun, 24 Jun 2012 10:15:42 +0000 Subject: Remove dyn_cast + dereference pattern by replacing it with a cast and changing the safety check to look for the same type we're going to actually cast to. Fixes PR13180! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159110 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Transforms/SimplifyCFG/branch-fold.ll | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test') diff --git a/test/Transforms/SimplifyCFG/branch-fold.ll b/test/Transforms/SimplifyCFG/branch-fold.ll index 70c5fb5db2..7097dea424 100644 --- a/test/Transforms/SimplifyCFG/branch-fold.ll +++ b/test/Transforms/SimplifyCFG/branch-fold.ll @@ -50,3 +50,21 @@ c: %o2 = phi i1 [ false, %a ], [ %phitmp, %b ], [ false, %entry ] ret i1 %o2 } + +; PR13180 +define void @pr13180(i8 %p) { +entry: + %tobool = icmp eq i8 %p, 0 + br i1 %tobool, label %cond.false, label %cond.true + +cond.true: ; preds = %entry + br label %cond.end + +cond.false: ; preds = %entry + %phitmp = icmp eq i8 %p, 0 + br label %cond.end + +cond.end: ; preds = %cond.false, %cond.true + %cond = phi i1 [ undef, %cond.true ], [ %phitmp, %cond.false ] + unreachable +} -- cgit v1.2.3