[PATCH] D21321: [mips] Optimize stack pointer adjustments.

Simon Dardis via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 14 02:18:01 PDT 2016


sdardis created this revision.
sdardis added a reviewer: dsanders.
sdardis added subscribers: llvm-commits, theraven.
sdardis set the repository for this revision to rL LLVM.
Herald added a reviewer: vkalintiris.
Herald added subscribers: sdardis, dsanders.

Instead of always using addu to adjust the stack pointer when the
size out is of the range of an addiu instruction, use subu so that
a smaller constant can be generated.

This can give savings of ~3 instructions whenever a function has a
a stack frame whose size is out of range of an addiu instruction.

This change may break some naive stack unwinders.

Resolves PR/26291.

Thanks to David Chisnall for reporting the issue.

Repository:
  rL LLVM

http://reviews.llvm.org/D21321

Files:
  lib/Target/Mips/MCTargetDesc/MipsABIInfo.cpp
  lib/Target/Mips/MCTargetDesc/MipsABIInfo.h
  lib/Target/Mips/MipsSEInstrInfo.cpp
  test/CodeGen/Mips/cstmaterialization/stack.ll
  test/CodeGen/Mips/eh-dwarf-cfa.ll
  test/CodeGen/Mips/largeimm1.ll
  test/CodeGen/Mips/largeimmprinting.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21321.60659.patch
Type: text/x-patch
Size: 7185 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160614/1f30aa2d/attachment.bin>


More information about the llvm-commits mailing list