[PATCH] D42898: Do not spill CSR to stack on entry to noreturn functions

Francis Visoiu Mistrih via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 5 14:39:26 PST 2018


thegameg added a comment.

One last comment and it should be good. Thanks!

Also, next time don't forget to add reviewers <https://www.llvm.org/docs/Phabricator.html> to your patch (I don't know if it was intended or not).



================
Comment at: test/CodeGen/ARM/noreturn-csr-skip.ll:18
+  ret void
+}
+
----------------
You could write MIR tests instead of using inline asm. This would allow you to test one specific pass at a time, here the PrologueEpilogueInserter.

Here's how it would look like for the function `ret`:

```
# RUN: llc -mtriple thumbv7m-none-eabi -run-pass prologepilog %s -o - | FileCheck %s

--- |
  define void @ret() nounwind { ret void }
...
---
# 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
---
```

For more info on MIR: http://llvm.org/docs/MIRLangRef.html.


https://reviews.llvm.org/D42898





More information about the llvm-commits mailing list