[PATCH] D76875: [NFC] [PPC] [AIX] Test improvements for byval arguments that fit in a single register

Sean Fertile via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 30 08:03:32 PDT 2020


sfertile added inline comments.


================
Comment at: llvm/test/CodeGen/PowerPC/aix-cc-byval.ll:125
+; The DAG block permits some invalid inputs for the benefit of allowing more valid orderings.
+; 32BIT-DAG:   ADJCALLSTACKDOWN 56, 0, implicit-def dead $r1, implicit $r1
+; 32BIT-DAG:   $r3 = LI 42
----------------
cebowleratibm wrote:
> sfertile wrote:
> > The AdjustCallStackDown nodes should be a 'CHECK' as opposed to a 'CHECK-DAG'.
> The actual output is:
> 
> ```
>     renamable $r3 = LWZtoc @f, $r2 :: (load 4 from got)
>     renamable $f1 = LFS 0, killed renamable $r3 :: (dereferenceable load 4 from @f)
>     ADJCALLSTACKDOWN 56, 0, implicit-def dead $r1, implicit $r1
>     renamable $r3 = LWZtoc @gS2, $r2 :: (load 4 from got)
>     renamable $r3 = LHZ 0, killed renamable $r3 :: (load 2)
>     renamable $r5 = RLWINM killed renamable $r3, 16, 0, 15
>     $r3 = LI 42
>     $f2 = COPY renamable $f1
>     $r7 = LI 43
>     BL_NOP <mcsymbol .test_byval_2Byte>, csr_aix32, implicit-def dead $lr, implicit $rm, implicit $r3, implicit $f1, implicit $r5, implicit killed $f2, implicit killed $r7, implicit $r2, implicit-def $r1, implicit-def dead $r3
>     ADJCALLSTACKUP 56, 0, implicit-def dead $r1, implicit $r1
> ```
> I used the CHECK-DAG to keep it in the logical order, however, now I'm thinking we're missing some dependency information in the DAG during the call lowering.
Sorry Chris, I didn't consider that we were loading from a global. Because we are loading the float from a global we will have a DAG where the load is before the ADJUSTCALLSTACK nodes, with a CopyToReg from the virtual reg to f1/f2 inside the ADJUSTCALLSTACK nodes.  We are testing too late in the pipeline to check for CopyToREG nodes though.

If we had a local with a constant:

```
%call = call zeroext i8 @test_byval_2Byte(i32 signext 42, float 0x400921FA00000000, %struct.S2* byval(%struct.S2) align 1 @gS2, float 0x400921FA00000000, i32 signext 43)
```

then we should see the load of the float from the constant pool *inside* the ADJUSTCALLSTACK pair like I was thinking.

I suggest adjusting the tests: either to move the load of the global outside the call sequence or use a constant for the float arguments. But either way don't use CHECK-DAG on the ADJUSTCALLSTACKDOWN node, 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76875





More information about the llvm-commits mailing list