diff options
author | chenglin.bi <chenglin.bi@cixcomputing.com> | 2022-06-23 21:47:45 +0800 |
---|---|---|
committer | chenglin.bi <chenglin.bi@cixcomputing.com> | 2022-06-23 21:53:07 +0800 |
commit | 30e49a3794726fd9d0ae60d34880f15e64a9fb3f (patch) | |
tree | 6b09b00cd8ede7ff84ad65bc2439d3a34aa13f5f /lldb/source/Commands/CommandObjectScript.cpp | |
parent | 6b187fdf3bb409061b6a235487517f478b09afed (diff) | |
download | llvm-30e49a3794726fd9d0ae60d34880f15e64a9fb3f.zip llvm-30e49a3794726fd9d0ae60d34880f15e64a9fb3f.tar.gz llvm-30e49a3794726fd9d0ae60d34880f15e64a9fb3f.tar.bz2 |
[InstCombine] Optimise shift+and+boolean conversion pattern to simple comparison
if (`C1` is pow2) & (`(C2 & ~(C1-1)) + C1)` is pow2):
((C1 << X) & C2) == 0 -> X >= (Log2(C2+C1) - Log2(C1));
https://alive2.llvm.org/ce/z/EJAl1R
((C1 << X) & C2) != 0 -> X < (Log2(C2+C1) - Log2(C1));
https://alive2.llvm.org/ce/z/3bVRVz
And remove dead code.
Fix: https://github.com/llvm/llvm-project/issues/56124
Reviewed By: spatel
Differential Revision: https://reviews.llvm.org/D126591
Diffstat (limited to 'lldb/source/Commands/CommandObjectScript.cpp')
0 files changed, 0 insertions, 0 deletions