diff options
author | Chris Lattner <sabre@nondot.org> | 2010-04-20 05:09:16 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-04-20 05:09:16 +0000 |
commit | a78130c3207e59bfb2ec0b77ca3f48677685d9ae (patch) | |
tree | d3a1523f1678b87f9ac25ccb2d4ba0a1296d0c8c /test/Transforms/LoopUnswitch | |
parent | f1cfb953375b726f999976924f95fb80db3c1c97 (diff) | |
download | llvm-a78130c3207e59bfb2ec0b77ca3f48677685d9ae.tar.gz llvm-a78130c3207e59bfb2ec0b77ca3f48677685d9ae.tar.bz2 llvm-a78130c3207e59bfb2ec0b77ca3f48677685d9ae.tar.xz |
RewriteLoopBodyWithConditionConstant can end up rewriting the
condition we're unswitching on. In this case, don't try to
simplify the second copy of the loop which may be dead or not,
but is probably a constant now. This fixes PR6879
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101870 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/LoopUnswitch')
-rw-r--r-- | test/Transforms/LoopUnswitch/crash.ll | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/Transforms/LoopUnswitch/crash.ll b/test/Transforms/LoopUnswitch/crash.ll index fac55a6bb1..101fb7a2c2 100644 --- a/test/Transforms/LoopUnswitch/crash.ll +++ b/test/Transforms/LoopUnswitch/crash.ll @@ -45,3 +45,22 @@ for.body: ; preds = %for.body, %bb.nph for.end: ; preds = %for.body, %entry ret void } + +; PR6879 +define i32* @test3(i32** %p_45, i16 zeroext %p_46, i64 %p_47, i64 %p_48, i16 signext %p_49) nounwind { +entry: + br label %for.cond + +for.cond: ; preds = %for.cond4, %entry + br i1 false, label %for.cond4, label %for.end88 + +for.cond4: ; preds = %for.cond + %conv46 = trunc i32 0 to i8 ; <i8> [#uses=2] + %cmp60 = icmp sgt i8 %conv46, 124 ; <i1> [#uses=1] + %or.cond = and i1 undef, %cmp60 ; <i1> [#uses=1] + %cond = select i1 %or.cond, i8 %conv46, i8 undef ; <i8> [#uses=0] + br label %for.cond + +for.end88: ; preds = %for.cond + ret i32* undef +} |