aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Stellard <tstellar@redhat.com>2017-11-28 16:35:04 +0000
committerTom Stellard <tstellar@redhat.com>2017-11-28 16:35:04 +0000
commit041898d210407c6e0715c4101713953e3ac39556 (patch)
treee31cc1fa6602159bc80e6f9b0025cf60ef8cbad9
parent6a66741f58c0375ff05d9fc328fafb6c0bd8ddab (diff)
downloadllvm-041898d210407c6e0715c4101713953e3ac39556.zip
llvm-041898d210407c6e0715c4101713953e3ac39556.tar.gz
llvm-041898d210407c6e0715c4101713953e3ac39556.tar.bz2
Merging r319130:
------------------------------------------------------------------------ r319130 | matze | 2017-11-27 17:17:52 -0800 (Mon, 27 Nov 2017) | 7 lines ARM: Fix PR32578 https://llvm.org/PR32578 I simplified and converted the reproducer into a lit test. Patch by Vedant Kumar! ------------------------------------------------------------------------ llvm-svn: 319181
-rw-r--r--llvm/lib/Target/ARM/ARMFrameLowering.cpp2
-rw-r--r--llvm/test/CodeGen/ARM/pr32578.ll27
2 files changed, 28 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/ARMFrameLowering.cpp b/llvm/lib/Target/ARM/ARMFrameLowering.cpp
index 6f380ae..00b788a 100644
--- a/llvm/lib/Target/ARM/ARMFrameLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMFrameLowering.cpp
@@ -479,7 +479,7 @@ void ARMFrameLowering::emitPrologue(MachineFunction &MF,
if (DPRCSSize > 0) {
// Since vpush register list cannot have gaps, there may be multiple vpush
// instructions in the prologue.
- while (MBBI->getOpcode() == ARM::VSTMDDB_UPD) {
+ while (MBBI != MBB.end() && MBBI->getOpcode() == ARM::VSTMDDB_UPD) {
DefCFAOffsetCandidates.addInst(MBBI, sizeOfSPAdjustment(*MBBI));
LastPush = MBBI++;
}
diff --git a/llvm/test/CodeGen/ARM/pr32578.ll b/llvm/test/CodeGen/ARM/pr32578.ll
new file mode 100644
index 0000000..541ba35
--- /dev/null
+++ b/llvm/test/CodeGen/ARM/pr32578.ll
@@ -0,0 +1,27 @@
+; RUN: llc -o - %s | FileCheck %s
+target triple = "armv7"
+
+; CHECK-LABEL: func:
+; CHECK: push {r11, lr}
+; CHECK: vpush {d8}
+; CEHCK: b .LBB0_2
+define arm_aapcscc double @func() {
+ br label %tailrecurse
+
+tailrecurse:
+ %v0 = load i16, i16* undef, align 8
+ %cond36.i = icmp eq i16 %v0, 3
+ br i1 %cond36.i, label %sw.bb.i, label %sw.epilog.i
+
+sw.bb.i:
+ %v1 = load double, double* undef, align 8
+ %call21.i = tail call arm_aapcscc double @func()
+ %mul.i = fmul double %v1, %call21.i
+ ret double %mul.i
+
+sw.epilog.i:
+ tail call arm_aapcscc void @_ZNK10shared_ptrdeEv()
+ br label %tailrecurse
+}
+
+declare arm_aapcscc void @_ZNK10shared_ptrdeEv() local_unnamed_addr