diff options
author | Chris Lattner <sabre@nondot.org> | 2003-03-10 23:52:54 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-03-10 23:52:54 +0000 |
commit | 8408add00a690046ddbc3e5d9d19c6b640444f65 (patch) | |
tree | fc2e2c8c36d903e3570cae087dd5ad29e8293fcf /test/Transforms/InstCombine/or.ll | |
parent | a4f445b28c3c55949e6be72514f4225c95dc87a9 (diff) | |
download | external_llvm-8408add00a690046ddbc3e5d9d19c6b640444f65.zip external_llvm-8408add00a690046ddbc3e5d9d19c6b640444f65.tar.gz external_llvm-8408add00a690046ddbc3e5d9d19c6b640444f65.tar.bz2 |
Add optimizations:
- (A & C1)+(B & C2) -> (A & C1)|(B & C2) iff C1&C2 == 0
- (A & C1)^(B & C2) -> (A & C1)|(B & C2) iff C1&C2 == 0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5741 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/or.ll')
-rw-r--r-- | test/Transforms/InstCombine/or.ll | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/test/Transforms/InstCombine/or.ll b/test/Transforms/InstCombine/or.ll index 7ffd346..ec28e20 100644 --- a/test/Transforms/InstCombine/or.ll +++ b/test/Transforms/InstCombine/or.ll @@ -1,7 +1,7 @@ ; This test makes sure that these instructions are properly eliminated. ; -; RUN: if as < %s | opt -instcombine | dis | grep or\ +; RUN: if as < %s | opt -instcombine | dis | grep -v '%OROK = or' | grep or\ ; RUN: then exit 1 ; RUN: else exit 0 ; RUN: fi @@ -91,3 +91,11 @@ ubyte %test15(ubyte %A) { %C = xor ubyte %B, 17 ret ubyte %C } + +int %test16(int %A, int %B) { ; (A & C1)^(B & C2) -> (A & C1)|(B & C2) iff C1&C2 == 0 + %A1 = and int %A, 7 + %B1 = and int %B, 128 + %OROK = xor int %A1, %B1 + ret int %OROK +} + |