diff options
author | Noah Goldstein <goldstein.w.n@gmail.com> | 2023-02-06 12:06:22 -0600 |
---|---|---|
committer | Noah Goldstein <goldstein.w.n@gmail.com> | 2023-02-06 14:09:18 -0600 |
commit | abbd256a810a0b0c92dda88a3050fc85cb604a9c (patch) | |
tree | dc0978b37d219d354e03c7c3df03dd57ba59cf7f /lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.h | |
parent | 2a3732f934b1ef46fc8f0fdae77836c6604533cb (diff) | |
download | llvm-abbd256a810a0b0c92dda88a3050fc85cb604a9c.zip llvm-abbd256a810a0b0c92dda88a3050fc85cb604a9c.tar.gz llvm-abbd256a810a0b0c92dda88a3050fc85cb604a9c.tar.bz2 |
Improve transforms for (icmp uPred X * Z, Y * Z) -> (icmp uPred X, Y)
Several cases where missing.
1. `(icmp eq/ne X*Z, Y*Z) [if Z % 2 != 0] -> (icmp eq/ne X, Y)`
EQ: https://alive2.llvm.org/ce/z/6_HPZ5
NE: https://alive2.llvm.org/ce/z/c34qSU
There was previously an implementation of this that work of `Y`
was non-constant, but it was missing if `Y*Z` evaluated to a
constant and/or `nsw`/`nuw` where both false. As well it only
worked if `Z` was a constant but we can check 1s bit of
`KnownBits` to cover more cases.
2. `(icmp eq/ne X*Z, Y*Z) [if Z != 0 and nsw(X*Y) and nsw(Y*Z)] -> (icmp eq/ne X, Y)`
EQ: https://alive2.llvm.org/ce/z/6SdAG6
NE: https://alive2.llvm.org/ce/z/fjsq_b
This was previously implemented only to work if `Z` was constant,
but we can use `isKnownNonZero` to cover more cases.
3. `(icmp uPred X*Y, Y*Z) [if Z != 0 and nuw(X*Y) and nuw(X*Y)] -> (icmp uPred X, Y)`
EQ: https://alive2.llvm.org/ce/z/FqWQLX
NE: https://alive2.llvm.org/ce/z/2gHrd2
ULT: https://alive2.llvm.org/ce/z/MUAWgZ
ULE: https://alive2.llvm.org/ce/z/szQQ2L
UGT: https://alive2.llvm.org/ce/z/McVUdu
UGE: https://alive2.llvm.org/ce/z/95uyC8
This was previously implemented only for `eq/ne` cases. As well
only if `Z` was constant, but again we can use `isKnownNonZero` to
cover more cases.
Reviewed By: spatel
Differential Revision: https://reviews.llvm.org/D142786
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.h')
0 files changed, 0 insertions, 0 deletions