Revert "ARM: Do not spill CSR to stack on entry to noreturn functions"
Breaks ubsan test TestCases/Misc/missing_return.cpp on ARM
This reverts commit r329287
llvm-svn: 329486
diff --git a/llvm/test/CodeGen/ARM/arm-shrink-wrapping.ll b/llvm/test/CodeGen/ARM/arm-shrink-wrapping.ll
index c943f60..1985ff9 100644
--- a/llvm/test/CodeGen/ARM/arm-shrink-wrapping.ll
+++ b/llvm/test/CodeGen/ARM/arm-shrink-wrapping.ll
@@ -327,7 +327,7 @@
; DISABLE-NEXT: pop {r4, r7, pc}
;
; ENABLE-NEXT: bx lr
-define i32 @loopInfoRestoreOutsideLoop(i32 %cond, i32 %N) "no-frame-pointer-elim"="true" nounwind {
+define i32 @loopInfoRestoreOutsideLoop(i32 %cond, i32 %N) "no-frame-pointer-elim"="true" #0 {
entry:
%tobool = icmp eq i32 %cond, 0
br i1 %tobool, label %if.else, label %if.then
diff --git a/llvm/test/CodeGen/ARM/noreturn-csr-skip.mir b/llvm/test/CodeGen/ARM/noreturn-csr-skip.mir
deleted file mode 100644
index c3b9718..0000000
--- a/llvm/test/CodeGen/ARM/noreturn-csr-skip.mir
+++ /dev/null
@@ -1,51 +0,0 @@
-# RUN: llc -mtriple thumbv7m-none-eabi -run-pass prologepilog %s -o - | FileCheck %s
-
---- |
- define void @throw() noreturn { unreachable }
-
- define void @ret() nounwind { ret void }
-
- define void @noret() noreturn nounwind {
- start:
- %p = alloca i32
- store i32 42, i32* %p
- unreachable
- }
-...
----
-# This function may return by exception. Check that $r4 is saved and restored.
-# CHECK-LABEL: name: throw
-# CHECK: killed $r4
-# CHECK: def $r4
-name: throw
-body: |
- bb.0:
- $r4 = IMPLICIT_DEF
- tBX_RET 14, $noreg
----
----
-# This function may return. Check that $r4 is saved and restored.
-# CHECK-LABEL: name: ret
-# CHECK: killed $r4
-# CHECK: def $r4
-name: ret
-body: |
- bb.0:
- $r4 = IMPLICIT_DEF
- tBX_RET 14, $noreg
----
----
-# This function does not return. We need not save any CSR, but
-# other stack adjustments in the prologue are still necessary.
-# CHECK-LABEL: name: noret
-# CHECK-NOT: killed $r4
-# CHECK-NOT: def $r4
-# CHECK: $sp = frame-setup
-name: noret
-stack:
- - { id: 0, name: p, offset: 0, size: 4, alignment: 4, local-offset: -4 }
-body: |
- bb.0:
- $r4 = IMPLICIT_DEF
- tBX_RET 14, $noreg
----