[PATCH] D24228: [Thumb] Save/restore high registers in Thumb1 pro/epilogues

Diana Picus via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 14 08:33:49 PDT 2016


rovka added a subscriber: rovka.
rovka added a comment.

This looks good in general (especially the tests). I think it would be nice to factor out the duplicated code into some helpers though.


================
Comment at: lib/Target/ARM/Thumb1FrameLowering.cpp:314
@@ -313,3 @@
-    for (int i = 2, e = MI.getNumOperands() - 2; i != e; ++i)
-      if (!isCalleeSavedRegister(MI.getOperand(i).getReg(), CSRegs))
-        return false;
----------------
Can't you update this check rather than delete it?

================
Comment at: test/CodeGen/Thumb/callee_save.ll:49
@@ +48,3 @@
+; One high and one low register clobbered. lr also gets pushed to simplify the
+; return, and r4 to keep the stack aligned. Here, we could use r0-r3, r4, r7 or
+; lr to save/restore r8.
----------------
Isn't r4 pushed because it's clobbered by the inline asm? And r7 to keep the stack aligned?

================
Comment at: test/CodeGen/Thumb/callee_save.ll:131
@@ +130,3 @@
+
+; 4 high regs clobbered, all 4 argument registers used. We push an extra 4 high
+; registers, so that we can use them for saving the high regs.
----------------
You mean an extra 4 low registers? (same below)


Repository:
  rL LLVM

https://reviews.llvm.org/D24228





More information about the llvm-commits mailing list