ARM: sort register lists by encoding in push/pop instructions.
authorTim Northover <tnorthover@apple.com>
Mon, 14 Nov 2016 19:02:17 +0000 (19:02 +0000)
committerTim Northover <tnorthover@apple.com>
Mon, 14 Nov 2016 19:02:17 +0000 (19:02 +0000)
commite908ea844c8b7ef92cdf50e1e93689609d649cab
tree8f793c7182655dec9ea2b85d40b48c65a3c30dc3
parent03c4c8c0a1354ed744cadcc9865bb1ff1824a6a4
ARM: sort register lists by encoding in push/pop instructions.

For example we were producing

    push {r8, r10, r11, r4, r5, r7, lr}

This is misleading (r4, r5 and r7 are actually pushed before the rest), and
other components (stack folding recently) often forget to deal with the extra
complexity coming from the different order, leading to miscompiles. Finally, we
warn about our own code in -no-integrated-as mode without this, which is really
not a good idea.

llvm-svn: 286866
llvm/lib/Target/ARM/ARMFrameLowering.cpp
llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp
llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp
llvm/test/CodeGen/ARM/swifterror.ll