[PATCH] D128553: [LiveIntervals] Fix incorrect range (re)construction from subranges.

Daniil Fukalov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 24 12:44:40 PDT 2022


dfukalov added a comment.

LiveIntervals dumps for the test, before the patch:
Before first move:

  %1 [16r,32r:0) 0 at 16r  L0000000000000003 [16r,32r:0) 0 at 16r  L000000000000000C [16r,32r:0) 0 at 16r  weight:0.000000e+00
  %2 [32r,32d:0) 0 at 32r  weight:0.000000e+00
  %3 [48r,64r:0)[64r,80r:1) 0 at 48r 1 at 64r  L0000000000000003 [48r,80r:0) 0 at 48r  L000000000000000C [64r,80r:0) 0 at 64r  weight:0.000000e+00
  %4 [80r,80d:0) 0 at 80r  weight:0.000000e+00
  RegMasks:
  ********** MACHINEINSTRS **********
  # Machine code for function func: NoPHIs
  
  0B      bb.0:
  16B       INLINEASM &"" [attdialect], $0:[regdef:VGPR_32], def undef %1.sub0:vreg_64, $1:[regdef:VGPR_32], def undef %1.sub1:vreg_64
  32B       dead %2:vreg_64 = COPY %1:vreg_64
  48B       undef %3.sub0:vreg_64 = V_MOV_B32_e32 0, implicit $exec
  64B       %3.sub1:vreg_64 = COPY %3.sub0:vreg_64
  80B       dead %4:vreg_64 = COPY %3:vreg_64

After the first move:

  %1 [16r,72r:0) 0 at 16r  L0000000000000003 [16r,72r:0) 0 at 16r  L000000000000000C [16r,72r:0) 0 at 16r  weight:0.000000e+00
  %2 [72r,72d:0) 0 at 72r  weight:0.000000e+00
  %3 [48r,64r:0)[64r,80r:1) 0 at 48r 1 at 64r  L0000000000000003 [48r,80r:0) 0 at 48r  L000000000000000C [64r,80r:0) 0 at 64r  weight:0.000000e+00
  %4 [80r,80d:0) 0 at 80r  weight:0.000000e+00
  RegMasks:
  ********** MACHINEINSTRS **********
  # Machine code for function func: NoPHIs
  
  0B      bb.0:
  16B       INLINEASM &"" [attdialect], $0:[regdef:VGPR_32], def undef %1.sub0:vreg_64, $1:[regdef:VGPR_32], def undef %1.sub1:vreg_64
  48B       undef %3.sub0:vreg_64 = V_MOV_B32_e32 0, implicit $exec
  64B       %3.sub1:vreg_64 = COPY %3.sub0:vreg_64
  72B       dead %2:vreg_64 = COPY %1:vreg_64
  80B       dead %4:vreg_64 = COPY %3:vreg_64

After the second move, (main range got `[16r,16d:1)` in the `constructMainRangeFromSubranges()` before L000000000000000C was updated from [16r,72r:0) to [68r,72r:0))

  %1 [16r,16d:1)[68r,72r:0) 0 at 68r 1 at 16r  L0000000000000003 [68r,72r:0) 0 at 68r  L000000000000000C [68r,72r:0) 0 at 68r  weight:0.000000e+00
  %2 [72r,72d:0) 0 at 72r  weight:0.000000e+00
  %3 [48r,64r:0)[64r,80r:1) 0 at 48r 1 at 64r  L0000000000000003 [48r,80r:0) 0 at 48r  L000000000000000C [64r,80r:0) 0 at 64r  weight:0.000000e+00
  %4 [80r,80d:0) 0 at 80r  weight:0.000000e+00
  RegMasks:
  ********** MACHINEINSTRS **********
  # Machine code for function func: NoPHIs
  
  0B      bb.0:
  48B       undef %3.sub0:vreg_64 = V_MOV_B32_e32 0, implicit $exec
  64B       %3.sub1:vreg_64 = COPY %3.sub0:vreg_64
  68B       INLINEASM &"" [attdialect], $0:[regdef:VGPR_32], def undef %1.sub0:vreg_64, $1:[regdef:VGPR_32], def undef %1.sub1:vreg_64
  72B       dead %2:vreg_64 = COPY %1:vreg_64
  80B       dead %4:vreg_64 = COPY %3:vreg_64



  - Bad machine code: No instruction at VNInfo def index ***
- function:    func
- basic block: %bb.0  (0x1bcd4b61968) [0B;96B)
- liverange:   [16r,16d:1)[68r,72r:0) 0 at 68r 1 at 16r
- v. register: %1
- ValNo:       1 (def 16r)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128553



More information about the llvm-commits mailing list