[PATCH] D17015: ARM: Introduce conservative load/store optimization mode

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 8 18:56:28 PST 2016


MatzeB created this revision.
MatzeB added reviewers: jmolloy, rengolin, t.p.northover, mcrosier, john.brawn, charlieturner7c5.
MatzeB added a subscriber: llvm-commits.
MatzeB set the repository for this revision to rL LLVM.
Herald added subscribers: mcrosier, rengolin, aemerson.

Most of the time ARM has the CCR.UNALIGN_TRP bit set to false which
means that unaligned loads/stores do not trap and even extensive testing
will not catch these bugs. However the multi/double variants are not
affected by this bit and will still trap. In effect a more aggressive
load/store optimization will break existing (bad) code.

These bugs do not necessarily manifest in the broken code where the
misaligned pointer is formed but often later in perfectly legal code
where it is accessed. This means recompiling system libraries (which
have no alignment bugs) with a newer compiler will break existing
applications (with alignment bugs) that worked before.

So (under protest) I implemented this safe mode which limits the
formation of multi/double operations to cases that are not affected by
user code (stack operations like spills/reloads) or cases where the
normal operations trap anyway (floating point load/stores). It is
disabled by default.

Repository:
  rL LLVM

http://reviews.llvm.org/D17015

Files:
  lib/Target/ARM/ARMLoadStoreOptimizer.cpp
  test/CodeGen/ARM/ldrd.ll
  test/CodeGen/ARM/swift-vldm.ll
  test/CodeGen/Thumb2/thumb2-ldm.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17015.47286.patch
Type: text/x-patch
Size: 12460 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160209/455777bc/attachment.bin>


More information about the llvm-commits mailing list