diff options
| author | Simon Atanasyan <simon@atanasyan.com> | 2019-08-23 13:36:24 +0000 |
|---|---|---|
| committer | Simon Atanasyan <simon@atanasyan.com> | 2019-08-23 13:36:24 +0000 |
| commit | 5f7d6ac7bf3b7a954d9826b93872063f8eb08810 (patch) | |
| tree | 8b0a5a136d562971373a44c86fb2aef1a5cf07db /llvm/lib/Target/Mips/MipsPreLegalizerCombiner.cpp | |
| parent | 58492b1895e23869253592544ae87f58742013e3 (diff) | |
| download | bcm5719-llvm-5f7d6ac7bf3b7a954d9826b93872063f8eb08810.tar.gz bcm5719-llvm-5f7d6ac7bf3b7a954d9826b93872063f8eb08810.zip | |
[mips] Reduce number of instructions used for loading a global symbol's value
Now `lw/sw $reg, sym+offset` pseudo instructions for global symbol `sym`
are lowering into the following three instructions.
```
lw $reg, %got(symbol)($gp)
addiu $reg, $reg, offset
lw/sw $reg, 0($reg)
```
It's possible to reduce the number of instructions by taking the offset
in account in the final `lw/sw` command. This patch implements that
optimization.
```
lw $reg, %got(symbol)($gp)
lw/sw $reg, offset($reg)
```
Differential Revision: https://reviews.llvm.org/D66553
llvm-svn: 369756
Diffstat (limited to 'llvm/lib/Target/Mips/MipsPreLegalizerCombiner.cpp')
0 files changed, 0 insertions, 0 deletions

