[PATCH] D106312: [AMDGPU] Allow rematerialization of virtual reg uses

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 20 12:31:52 PDT 2021


rampitec added a comment.

OK, here is the test which fails just the same way as aarch64 without any changes at all:

  # RUN: llc -march=amdgcn -mcpu=gfx900 -o - -verify-coalescing -run-pass=simple-register-coalescing %s
  
  ---
  name:            test
  tracksRegLiveness: true
  body:             |
    bb.0:
      liveins: $vgpr0
  
      %0:vgpr_32 = COPY $vgpr0
      %1:vgpr_32 = V_ADD_U32_e32 1, %0, implicit $exec
      %2:vgpr_32 = V_MOV_B32_e32 killed %1, implicit $exec
      $vgpr0 = COPY killed %2
      SI_RETURN_TO_EPILOG killed $vgpr0
  ...

We allow rematerialization of the V_MOV_B32 into the COPY, but %1 is killed at that slot and it ends up as:

  0B      bb.0:
            liveins: $vgpr0
  16B       KILL $vgpr0
  64B       $vgpr0 = V_MOV_B32_e32 %1:vgpr_32, implicit $exec
  80B       SI_RETURN_TO_EPILOG $vgpr0


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

https://reviews.llvm.org/D106312



More information about the llvm-commits mailing list