[PATCH] D100167: [AIX] Adjust CSR order to avoid breaking ABI regarding traceback

Zarko Todorovski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 30 05:58:38 PDT 2021


ZarkoCA accepted this revision.
ZarkoCA added a comment.
This revision is now accepted and ready to land.

LGTM, thanks for rebasing and updating the patch. Just some comment suggestions. 
I guess you may want to wait for the other reviewers to check if their comments were addressed to their liking.



================
Comment at: llvm/lib/Target/PowerPC/PPCRegisterInfo.td:304-308
   // On non-Darwin PPC64 systems, R2 can be allocated, but must be restored, so
   // put it at the end of the list.
-  let AltOrders = [(add (sub GPRC, R2), R2)];
+  // On AIX, CSR is allocated following suggestions from
+  // https://www.ibm.com/docs/en/ssw_aix_72/assembler/assembler_pdf.pdf.
+  // What's more, it helps setting correct `NumOfGPRsSaved' in tracetable.
----------------



================
Comment at: llvm/lib/Target/PowerPC/PPCRegisterInfo.td:320
                                                 X31, X13, X0, X1, FP8, BP8)> {
   // On non-Darwin PPC64 systems, R2 can be allocated, but must be restored, so
   // put it at the end of the list.
----------------
We can also remove references to Darwin here and below since there isn't support for that PPC Subtarget in llc anymore.  But this is just a suggestion as this isn't the main point of the patch. 


================
Comment at: llvm/test/CodeGen/PowerPC/aix-tracetable-csr.ll:17
 define void @baz(%3* %0) local_unnamed_addr #2 {
-; AIX-64: std 30
-; AIX-64: .byte 0x02 # -HasVectorInfo, -HasExtensionTable, NumOfGPRsSaved = 2
-; AIX-32: stw 30
-; AIX-32: .byte 0x02 # -HasVectorInfo, -HasExtensionTable, NumOfGPRsSaved = 2
+; AIX-64: std 31
+; AIX-64: .byte 0x01 # -HasVectorInfo, -HasExtensionTable, NumOfGPRsSaved = 1
----------------
Thank you for rebasing the patch because now this test is included and it shows exactly what this patch fixes with the traceback table. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100167/new/

https://reviews.llvm.org/D100167



More information about the llvm-commits mailing list