diff options
author | Ehsan Amiri <amehsan@ca.ibm.com> | 2016-12-15 12:25:13 +0000 |
---|---|---|
committer | Ehsan Amiri <amehsan@ca.ibm.com> | 2016-12-15 12:25:13 +0000 |
commit | 795b0671c5fd3c064f9502d388e5f40a196b9d56 (patch) | |
tree | 3919e2c326458cea442b821277c0034fe1764270 /llvm/lib/CodeGen/MachineBasicBlock.cpp | |
parent | 3da2619b6f2827de20b2a727e06455fb4ee9c3fc (diff) | |
download | llvm-795b0671c5fd3c064f9502d388e5f40a196b9d56.zip llvm-795b0671c5fd3c064f9502d388e5f40a196b9d56.tar.gz llvm-795b0671c5fd3c064f9502d388e5f40a196b9d56.tar.bz2 |
[InstCombine] New opportunities for FoldAndOfICmp and FoldXorOfICmp
A number of new patterns for simplifying and/xor of icmp:
(icmp ne %x, 0) ^ (icmp ne %y, 0) => icmp ne %x, %y if the following is true:
1- (%x = and %a, %mask) and (%y = and %b, %mask)
2- %mask is a power of 2.
(icmp eq %x, 0) & (icmp ne %y, 0) => icmp ult %x, %y if the following is true:
1- (%x = and %a, %mask1) and (%y = and %b, %mask2)
2- Let %t be the smallest power of 2 where %mask1 & %t != 0. Then for any
%s that is a power of 2 and %s & %mask2 != 0, we must have %s <= %t.
For example if %mask1 = 24 and %mask2 = 16, setting %s = 16 and %t = 8
violates condition (2) above. So this optimization cannot be applied.
llvm-svn: 289813
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
0 files changed, 0 insertions, 0 deletions