summaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@sifive.com>2025-02-19 11:30:55 -0800
committerGitHub <noreply@github.com>2025-02-19 11:30:55 -0800
commitc3ebbfd7368ec3e4737427eef602296a868a4ecd (patch)
treee56d104a23c64923169f97ded8ebc3164192f8d6 /lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
parent5caefe261fb20a70497772c24bf4e9af0ff52aef (diff)
[RISCV] Add a pass to remove ADDI by reassociating to fold into load/store address. (#127151)
SelectionDAG will not reassociate adds to the end of a chain if there are multiple users of later additions. This prevents isel from folding the immediate into a load/store address. One easy way to see this is accessing an array in a struct with two different indices. An ADDI will be used to get to the start of the array then 2 different SHXADD instructions will be used to add the scaled indices. Finally the SHXADD will be used by different load instructions. We can remove the ADDI by folding the offset into each load. This patch adds a new pass that analyzes how an ADDI constant propagates through address arithmetic. If the arithmetic is only used by a load/store and the offset is small enough, we can adjust the load/store offset and remove the ADDI. This pass is placed before MachineCSE to allow cleanups if some instructions become common after removing offsets from their inputs. This pass gives ~3% improvement on dynamic instruction count on 541.leela_r and 544.nab_r from SPEC2017 for the train data set. There's a ~1% improvement on 557.xz_r.
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp')
0 files changed, 0 insertions, 0 deletions