From: Diogo Sampaio Date: Mon, 30 Dec 2019 15:43:32 +0000 (+0000) Subject: [ARM][Thumb][FIX] Add unwinding information to t4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f33fd9648c442a23f863e03ea1c806da15278fd1;p=platform%2Fupstream%2Fllvm.git [ARM][Thumb][FIX] Add unwinding information to t4 Summary: Add missing part of patch D71361. Now that the stack-frame can be operated using a addw/subw instruction, they should appear in the unwinding list. Reviewers: dmgreen, efriedma Reviewed By: dmgreen Subscribers: kristof.beyls, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D72000 --- diff --git a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp index ed0969f..d180849 100644 --- a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp +++ b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp @@ -1170,10 +1170,12 @@ void ARMAsmPrinter::EmitUnwindingInstruction(const MachineInstr *MI) { break; case ARM::ADDri: case ARM::t2ADDri: + case ARM::t2ADDri12: Offset = -MI->getOperand(2).getImm(); break; case ARM::SUBri: case ARM::t2SUBri: + case ARM::t2SUBri12: Offset = MI->getOperand(2).getImm(); break; case ARM::tSUBspi: diff --git a/llvm/test/CodeGen/Thumb2/emit-unwinding.ll b/llvm/test/CodeGen/Thumb2/emit-unwinding.ll index b77bb9e..13d509a 100644 --- a/llvm/test/CodeGen/Thumb2/emit-unwinding.ll +++ b/llvm/test/CodeGen/Thumb2/emit-unwinding.ll @@ -9,3 +9,18 @@ define void @foo1() { } declare void @foo2() + +; CHECK: _bar: +; CHECK-NEXT: .cfi_startproc +; CHECK-NEXT: @ %bb.0: +; CHECK-NEXT: subw sp, sp, #3800 +; CHECK-NEXT: .cfi_def_cfa_offset 3800 +; CHECK-NEXT: addw sp, sp, #3800 +; CHECK-NEXT: bx lr +; CHECK-NEXT: .cfi_endproc + +define void @bar() { + %a1 = alloca [3800 x i8], align 4 + %p = getelementptr inbounds [3800 x i8], [3800 x i8]* %a1, i32 0, i32 0 + ret void +}