aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.h
diff options
context:
space:
mode:
authorchenglin.bi <chenglin.bi@linaro.org>2023-02-15 10:33:54 +0800
committerchenglin.bi <chenglin.bi@linaro.org>2023-02-15 10:34:00 +0800
commitdd31a3b3a526c0fcbbc0f09d065670af2fbab861 (patch)
treedc46601a69620c1cce4353e2eecb71b788164479 /lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.h
parent06f06644efb003e0748e94ac11cb230271a006f8 (diff)
downloadllvm-dd31a3b3a526c0fcbbc0f09d065670af2fbab861.zip
llvm-dd31a3b3a526c0fcbbc0f09d065670af2fbab861.tar.gz
llvm-dd31a3b3a526c0fcbbc0f09d065670af2fbab861.tar.bz2
[InstCombine] fold icmp of the sum of ext bool based on limited range
For the pattern `(zext i1 X) + (sext i1 Y)`, the constant range is [-1, 1]. We can simplify the pattern by logical operations. Like: ``` (zext i1 X) + (sext i1 Y) == -1 --> ~X & Y (zext i1 X) + (sext i1 Y) == 0 --> ~(X ^ Y) (zext i1 X) + (sext i1 Y) == 1 --> X & ~Y ``` And other predicates can the combination of these results: ``` (zext i1 X) + (sext i1 Y)) != -1 --> X | ~Y (zext i1 X) + (sext i1 Y)) s> -1 --> X | ~Y (zext i1 X) + (sext i1 Y)) u< -1 --> X | ~Y (zext i1 X) + (sext i1 Y)) s> 0 --> X & ~Y (zext i1 X) + (sext i1 Y)) s< 0 --> ~X & Y (zext i1 X) + (sext i1 Y)) != 1 --> ~X | Y (zext i1 X) + (sext i1 Y)) s< 1 --> ~X | Y (zext i1 X) + (sext i1 Y)) u> 1 --> ~X & Y ``` All alive proofs: https://alive2.llvm.org/ce/z/KmgDpF https://alive2.llvm.org/ce/z/fLwWa9 https://alive2.llvm.org/ce/z/ZKQn2P Fix: https://github.com/llvm/llvm-project/issues/59666 Reviewed By: spatel Differential Revision: https://reviews.llvm.org/D143373
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.h')
0 files changed, 0 insertions, 0 deletions