[PATCH] D77578: [AIX][PPC] Implement caller byval arguments in stack memory

Sean Fertile via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 13 10:45:07 PDT 2020


sfertile added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:7383
       // Initialize registers, which are fully occupied by the by-val argument.
-      while (I != E && LoadOffset + PtrByteSize <= ByValSize) {
+      while (I != E && ArgLocs[I].isRegLoc() && 
+             LoadOffset + PtrByteSize <= ByValSize) {
----------------
'I != E' shouldn't be part of the while loops condition. If you really want a sanity check on the value you can have an assertion inside the while loop after `I` is incremented (And `LoadOffset` is incremented) that checks that either 'I' is not equal to 'E' or we have copied the whole ByVal argument.


================
Comment at: llvm/test/CodeGen/PowerPC/aix-cc-byval-mem.ll:56
+; 32BIT-DAG:   li 5, 256
+; 32BIT-NEXT:  bl .memcpy
+; 32BIT:       bl .test_byval_mem2
----------------
Missing the nop for toc-restore,  and loading of arguments for the call to `test_byval_mem2` for both 32-bit and 64-bit check directives.


================
Comment at: llvm/test/CodeGen/PowerPC/aix-cc-byval-mem.ll:88
+; 32BIT-DAG:   li 5, 33
+; 32BIT-NEXT:  bl .memcpy
+; 32BIT-DAG:   lwz 5, 0([[REG]])
----------------
Check for the nop after the call to memcpy


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77578





More information about the llvm-commits mailing list