diff options
author | Abinaya Saravanan <quic_asaravan@quicinc.com> | 2024-09-14 05:18:34 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-13 18:48:34 -0500 |
commit | c010b72e9b4e3b1ae7467eb86102fc43c338fe19 (patch) | |
tree | 7ef8797a51fccc120ab0e751b5d822a341ee9e95 /llvm/unittests/Support/CommandLineTest.cpp | |
parent | 536bdc99e6ed2388426ce94d0bd75a61aecab396 (diff) | |
download | llvm-c010b72e9b4e3b1ae7467eb86102fc43c338fe19.zip llvm-c010b72e9b4e3b1ae7467eb86102fc43c338fe19.tar.gz llvm-c010b72e9b4e3b1ae7467eb86102fc43c338fe19.tar.bz2 |
[HEXAGON] AddrModeOpt support for HVX and optimize adds (#106368)
This patch does 3 things:
1. Add support for optimizing the address mode of HVX load/store
instructions
2. Reduce the value of Add instruction immediates by replacing with the
difference from other Addi instructions that share common base:
For Example, If we have the below sequence of instructions: r1 =
add(r2,# 1024) ... r3 = add(r2,# 1152) ... r4 = add(r2,# 1280)
Where the register r2 has the same reaching definition, They get
modified to the below sequence:
r1 = add(r2,# 1024)
...
r3 = add(r1,# 128)
...
r4 = add(r1,# 256)
3. Fixes a bug pass where the addi instructions were modified based on a
predicated register definition, leading to incorrect output.
Eg:
INST-1: if (p0) r2 = add(r13,# 128)
INST-2: r1 = add(r2,# 1024)
INST-3: r3 = add(r2,# 1152)
INST-4: r5 = add(r2,# 1280)
In the above case, since r2's definition is predicated, we do not want
to modify the uses of r2 in INST-3/INST-4 with add(r1,#128/256)
4.Fixes a corner case
It looks like we never check whether the offset register is actually
live (not clobbered) at optimization site. Add the check whether it is
live at MBB entrance. The rest should have already been verified.
5. Fixes a bad codegen
For whatever reason we do transformation without checking if the value
in register actually reaches the user. This is second identical fix for
this pass.
Co-authored-by: Anirudh Sundar <quic_sanirudh@quicinc.com>
Co-authored-by: Sergei Larin <slarin@quicinc.com>
Diffstat (limited to 'llvm/unittests/Support/CommandLineTest.cpp')
0 files changed, 0 insertions, 0 deletions