diff options
author | Chris Lattner <sabre@nondot.org> | 2009-10-26 01:06:31 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-10-26 01:06:31 +0000 |
commit | 863928fc39c7f1ab86779415eb704b2f2474b995 (patch) | |
tree | 3b3a61d0d841f735be0cbb4bb83d7b1c7efd3cad /test/Transforms | |
parent | 1125f58efcfe4e93322f993aa74215e6ffacd8ea (diff) | |
download | external_llvm-863928fc39c7f1ab86779415eb704b2f2474b995.zip external_llvm-863928fc39c7f1ab86779415eb704b2f2474b995.tar.gz external_llvm-863928fc39c7f1ab86779415eb704b2f2474b995.tar.bz2 |
Implement PR3266 & PR5276, folding:
not (or (icmp, icmp)) -> and(icmp, icmp)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85085 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r-- | test/Transforms/InstCombine/or.ll | 17 | ||||
-rw-r--r-- | test/Transforms/InstCombine/xor-demorgans.ll | 12 |
2 files changed, 16 insertions, 13 deletions
diff --git a/test/Transforms/InstCombine/or.ll b/test/Transforms/InstCombine/or.ll index dbdd08a..b72480b 100644 --- a/test/Transforms/InstCombine/or.ll +++ b/test/Transforms/InstCombine/or.ll @@ -237,4 +237,19 @@ define i1 @test24(double %X, double %Y) { ; CHECK: @test24 ; CHECK: %bothcond = fcmp uno double %Y, %X ; <i1> [#uses=1] ; CHECK: ret i1 %bothcond -}
\ No newline at end of file +} + +; PR3266 & PR5276 +define i1 @test25(i32 %A, i32 %B) { + %C = icmp eq i32 %A, 0 + %D = icmp eq i32 %B, 57 + %E = or i1 %C, %D + %F = xor i1 %E, -1 + ret i1 %F + +; CHECK: @test25 +; CHECK: icmp ne i32 %A, 0 +; CHECK-NEXT: icmp ne i32 %B, 57 +; CHECK-NEXT: %F = and i1 +; CHECK-NEXT: ret i1 %F +} diff --git a/test/Transforms/InstCombine/xor-demorgans.ll b/test/Transforms/InstCombine/xor-demorgans.ll deleted file mode 100644 index 3383845..0000000 --- a/test/Transforms/InstCombine/xor-demorgans.ll +++ /dev/null @@ -1,12 +0,0 @@ -; RUN: opt < %s -instcombine -S | not grep {= or} -; PR3266 -; XFAIL: * - -define i1 @foo(i32 %x, i32 %y) nounwind { -.summary: - %0 = icmp sgt i32 %x, 4 ; <i1> [#uses=1] - %1 = icmp sgt i32 %y, 0 ; <i1> [#uses=1] - %.demorgan = or i1 %1, %0 ; <i1> [#uses=1] - %2 = xor i1 %.demorgan, true ; <i1> [#uses=1] - ret i1 %2 -} |