summaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@sifive.com>2022-07-20 18:11:19 -0700
committerCraig Topper <craig.topper@sifive.com>2022-07-20 18:40:49 -0700
commit8983db15a3d8c026706d464f8cdb92072a4dc5ce (patch)
treed15089e37c4912fe6655aa75cca337af159a7ce6 /lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.cpp
parent7abbd6224b0b6089e4483a9c939be5d9a16b682b (diff)
[RISCV] Optimize (brcond (seteq (and X, 1 << C), 0))
If C > 10, this will require a constant to be materialized for the And. To avoid this, we can shift X left by XLen-1-C bits to put the tested bit in the MSB, then we can do a signed compare with 0 to determine if the MSB is 0 or 1. Thanks to @reames for the suggestion. I've implemented this inside of translateSetCCForBranch which is called when setcc+brcond or setcc+select is converted to br_cc or select_cc during lowering. It doesn't make sense to do this for general setcc since we lack a sgez instruction. I've tested bit 10, 11, 31, 32, 63 and a couple bits betwen 11 and 31 and between 32 and 63 for both i32 and i64 where applicable. Select has some deficiencies where we receive (and (srl X, C), 1) instead. This doesn't happen for br_cc due to the call to rebuildSetCC in the generic DAGCombiner for brcond. I'll explore improving select in a future patch. Reviewed By: reames Differential Revision: https://reviews.llvm.org/D130203
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.cpp')
0 files changed, 0 insertions, 0 deletions