diff options
author | David Majnemer <david.majnemer@gmail.com> | 2013-05-06 21:21:31 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2013-05-06 21:21:31 +0000 |
commit | 8ec23cb07e22198a720c4e151241059cca215c08 (patch) | |
tree | 992d7bc3a38cb201502c179d1fd08c22b4bac0a2 /test/Transforms | |
parent | e305e03d6f71f70a7102f15ac5ff6fd93cf9e818 (diff) | |
download | external_llvm-8ec23cb07e22198a720c4e151241059cca215c08.zip external_llvm-8ec23cb07e22198a720c4e151241059cca215c08.tar.gz external_llvm-8ec23cb07e22198a720c4e151241059cca215c08.tar.bz2 |
InstCombine: (X ^ signbit) + C -> X + (signbit ^ C)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181249 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r-- | test/Transforms/InstCombine/sub-xor.ll | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/sub-xor.ll b/test/Transforms/InstCombine/sub-xor.ll index 279e4ac..1d14852 100644 --- a/test/Transforms/InstCombine/sub-xor.ll +++ b/test/Transforms/InstCombine/sub-xor.ll @@ -35,3 +35,13 @@ define i32 @test3(i32 %x) nounwind { ; CHECK-NEXT: sub i32 73, %and ; CHECK-NEXT: ret } + +define i32 @test4(i32 %x) nounwind { + %sub = xor i32 %x, 2147483648 + %add = add i32 %sub, 42 + ret i32 %add + +; CHECK: @test4 +; CHECK-NEXT: add i32 %x, -2147483606 +; CHECK-NEXT: ret +} |