[PATCH] D18619: [AArch64] Combine callee-save and local stack SP adjustment instructions.

Tim Northover via llvm-commits llvm-commits at lists.llvm.org
Wed May 4 10:59:44 PDT 2016


t.p.northover added inline comments.

================
Comment at: lib/Target/AArch64/AArch64FrameLowering.cpp:336
@@ +335,3 @@
+  // For pre/post inc/dec, convert to non inc/dec and update the stack offset.
+  case AArch64::STPXpre:
+    NewOpc = AArch64::STPXi;
----------------
I think we're duplicating effort here. If the spill/restore functions always produce non-incremented versions we have fewer cases to cover here and those functions will be simpler too.

================
Comment at: lib/Target/AArch64/AArch64FrameLowering.cpp:412
@@ +411,3 @@
+  }
+  assert(LocalStackSize % 8 == 0);
+  // All generated opcodes have scaled offsets.
----------------
According to AAPCS, SP must equal 0 (mod 16) whenever it's used as the base of a load/store. Given the risk that there are adjacent loads/stores, LocalStackSize should probably satisfy that too. There seems to be no benefit in allowing 0x...8 since a following ADD/SUB would be needed anyway.


http://reviews.llvm.org/D18619





More information about the llvm-commits mailing list