[PATCH] D76902: [PowerPC][AIX] ByVal formal argument support: multiple registers

Chris Bowler via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 27 10:17:02 PDT 2020


cebowleratibm added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:7110
+      HandleRegLoc(VA, Offset);
+      while (I != End && ArgLocs[I].getValNo() == VA.getValNo()) {
+        if (!ArgLocs[I].isRegLoc())
----------------
cebowleratibm wrote:
> I would tend to write this as:
> 
> 
> ```
> unsigned Offset = 0;
> HandleRegLoc(VA, Offset);
> Offset != PtrByteSize;
> for(; Offset != StackSize; Offset +=PtrByteSize) {
>   assert(ArgLocs[I].getValNo() == VA.getValNo() ...);
>   HandleRegLoc(ArgLocs[I++], Offset);
> }
> ```
> 
> This way we're effectively asserting that we initialize the expected number of bytes.  "I != End" should be part of an assertion.
Offset != PtrByteSize; => Offset += PtrByteSize;


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76902





More information about the llvm-commits mailing list