diff options
author | Kyle Butt <kyle+llvm@iteratee.net> | 2015-12-11 00:47:36 +0000 |
---|---|---|
committer | Kyle Butt <kyle+llvm@iteratee.net> | 2015-12-11 00:47:36 +0000 |
commit | 1452b76f1fafe9ba34a37c381ea6e4abba19ea96 (patch) | |
tree | a31389ff7df603b8d0d29299a23233e81d6d7f6f /lldb/packages/Python/lldbsuite/test/python_api/symbol-context/TestSymbolContext.py | |
parent | e59910cba9bb66fb18f01ee05dd43f94cae25b17 (diff) | |
download | bcm5719-llvm-1452b76f1fafe9ba34a37c381ea6e4abba19ea96.tar.gz bcm5719-llvm-1452b76f1fafe9ba34a37c381ea6e4abba19ea96.zip |
[PPC]: Peephole optimize small accesss to aligned globals.
Access to aligned globals gives us a chance to peephole optimize nonzero
offsets. If a struct is 4 byte aligned, then accesses to bytes 0-3 won't
overflow the available displacement. For example:
addis 3, 2, b4v@toc@ha
addi 4, 3, b4v@toc@l
lbz 5, b4v@toc@l(3) ; This is the result of the current peephole
lbz 6, 1(4) ; optimizer
lbz 7, 2(4)
lbz 8, 3(4)
If b4v is 4-byte aligned, we can skip using register 4 because we know
that b4v@toc@l+{1,2,3} won't overflow 32K, and instead generate:
addis 3, 2, b4v@toc@ha
lbz 4, b4v@toc@l(3)
lbz 5, b4v@toc@l+1(3)
lbz 6, b4v@toc@l+2(3)
lbz 7, b4v@toc@l+3(3)
Saving a register and an addition.
Larger alignments allow larger structures/arrays to be optimized.
llvm-svn: 255319
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/python_api/symbol-context/TestSymbolContext.py')
0 files changed, 0 insertions, 0 deletions