[PATCH] D27910: [ARM] ARMLoadStoreOpt generates deprecated T1 STM
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 28 15:44:54 PST 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL296538: [ARM] Don't generate deprecated T1 STM. (authored by efriedma).
Changed prior to commit:
https://reviews.llvm.org/D27910?vs=81911&id=90095#toc
Repository:
rL LLVM
https://reviews.llvm.org/D27910
Files:
llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
llvm/trunk/test/CodeGen/Thumb/stm-deprecated.ll
Index: llvm/trunk/test/CodeGen/Thumb/stm-deprecated.ll
===================================================================
--- llvm/trunk/test/CodeGen/Thumb/stm-deprecated.ll
+++ llvm/trunk/test/CodeGen/Thumb/stm-deprecated.ll
@@ -0,0 +1,19 @@
+; RUN: llc -mtriple=thumbv6m-eabi -verify-machineinstrs %s -o - | FileCheck %s
+; RUN: llc -mtriple=thumbv5e-linux-gnueabi -verify-machineinstrs %s -o - | FileCheck %s
+
+%0 = type { %0*, %0*, i32 }
+
+ at x1 = external global %0, align 4
+ at x2 = external global %0, align 4
+
+; CHECK: str r0, [r1]
+; CHECK-NEXT: str r1, [r1, #4]
+; CHECK-NOT: stm
+
+define void @foo(i32 %unused, %0* %x) {
+ %first = getelementptr inbounds %0, %0* %x, i32 0, i32 0
+ %second = getelementptr inbounds %0, %0* %x, i32 0, i32 1
+ store %0* @x1, %0** %first
+ store %0* %x, %0** %second
+ unreachable
+}
Index: llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
===================================================================
--- llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
+++ llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
@@ -609,13 +609,12 @@
// Exception: If the base register is in the input reglist, Thumb1 LDM is
// non-writeback.
// It's also not possible to merge an STR of the base register in Thumb1.
- if (isThumb1 && isi32Load(Opcode) && ContainsReg(Regs, Base)) {
+ if (isThumb1 && ContainsReg(Regs, Base)) {
assert(Base != ARM::SP && "Thumb1 does not allow SP in register list");
- if (Opcode == ARM::tLDRi) {
+ if (Opcode == ARM::tLDRi)
Writeback = false;
- } else if (Opcode == ARM::tSTRi) {
+ else if (Opcode == ARM::tSTRi)
return nullptr;
- }
}
ARM_AM::AMSubMode Mode = ARM_AM::ia;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27910.90095.patch
Type: text/x-patch
Size: 1702 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170228/f9fbb57a/attachment.bin>
More information about the llvm-commits
mailing list