[llvm] r252557 - [ARM] Handle t2ADDri in ARMAsmPrinter::EmitUnwindingInstruction.
Akira Hatanaka via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 9 16:10:42 PST 2015
Author: ahatanak
Date: Mon Nov 9 18:10:41 2015
New Revision: 252557
URL: http://llvm.org/viewvc/llvm-project?rev=252557&view=rev
Log:
[ARM] Handle t2ADDri in ARMAsmPrinter::EmitUnwindingInstruction.
This fixes a bug in ARMAsmPrinter::EmitUnwindingInstruction where
llvm_unreachable was reached because t2ADDri wasn't handled.
Test case provided by Tim Northover.
rdar://problem/23270609
http://reviews.llvm.org/D14518
Added:
llvm/trunk/test/CodeGen/Thumb2/emit-unwinding.ll
Modified:
llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp?rev=252557&r1=252556&r2=252557&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp Mon Nov 9 18:10:41 2015
@@ -1125,6 +1125,7 @@ void ARMAsmPrinter::EmitUnwindingInstruc
Offset = 0;
break;
case ARM::ADDri:
+ case ARM::t2ADDri:
Offset = -MI->getOperand(2).getImm();
break;
case ARM::SUBri:
Added: llvm/trunk/test/CodeGen/Thumb2/emit-unwinding.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/emit-unwinding.ll?rev=252557&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/emit-unwinding.ll (added)
+++ llvm/trunk/test/CodeGen/Thumb2/emit-unwinding.ll Mon Nov 9 18:10:41 2015
@@ -0,0 +1,11 @@
+; RUN: llc -mtriple thumbv7em-apple-unknown-eabi-macho %s -o - -O0 | FileCheck %s
+
+; CHECK: add.w r11, sp, #{{[1-9]+}}
+
+define void @foo1() {
+ call void asm sideeffect "", "~{r4}"()
+ call void @foo2()
+ ret void
+}
+
+declare void @foo2()
More information about the llvm-commits
mailing list