diff options
author | Chris Lattner <sabre@nondot.org> | 2010-03-05 08:46:26 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-03-05 08:46:26 +0000 |
commit | f34f48c57870cf4eb4d48e23b11e29b95d1950c3 (patch) | |
tree | 9fecd1a9fb8c1a80af885eb1c130568a7a7af330 /test/Transforms/InstCombine | |
parent | 76e70312dbf8fc61ac00e13b00f4996f95f40174 (diff) | |
download | llvm-f34f48c57870cf4eb4d48e23b11e29b95d1950c3.tar.gz llvm-f34f48c57870cf4eb4d48e23b11e29b95d1950c3.tar.bz2 llvm-f34f48c57870cf4eb4d48e23b11e29b95d1950c3.tar.xz |
Fix PR6503. This turned into a much more interesting and nasty bug. Various
parts of the cmp|cmp and cmp&cmp folding logic wasn't prepared for vectors
(unrelated to the bug but noticed while in the code) and the code was
*definitely* not safe to use by the (cast icmp)|(cast icmp) handling logic
that I added in r95855. Fix all this up by changing the various routines
to more consistently use IRBuilder and not pass in the I which had the wrong
type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97801 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine')
-rw-r--r-- | test/Transforms/InstCombine/crash.ll | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/crash.ll b/test/Transforms/InstCombine/crash.ll index 2faa5392d4..854bfc81de 100644 --- a/test/Transforms/InstCombine/crash.ll +++ b/test/Transforms/InstCombine/crash.ll @@ -237,3 +237,18 @@ entry: %or = or i32 %and42, %and47 ret i32 %or } + +; PR6503 +define void @test12(i32* %A) nounwind { +entry: + %tmp1 = load i32* %A + %cmp = icmp ugt i32 1, %tmp1 ; <i1> [#uses=1] + %conv = zext i1 %cmp to i32 ; <i32> [#uses=1] + %tmp2 = load i32* %A + %cmp3 = icmp ne i32 %tmp2, 0 ; <i1> [#uses=1] + %conv4 = zext i1 %cmp3 to i32 ; <i32> [#uses=1] + %or = or i32 %conv, %conv4 ; <i32> [#uses=1] + %cmp5 = icmp ugt i32 undef, %or ; <i1> [#uses=1] + %conv6 = zext i1 %cmp5 to i32 ; <i32> [#uses=0] + ret void +} |