[PATCH] D26359: Don't assert on missing value from predecessor

Krzysztof Parzyszek via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 7 11:41:57 PST 2016


kparzysz added a comment.

I was unable to generate a .mir testcase for this.  The problem occurred with our internal compiler, with some non-public changes, and even that compiler would work fine on the .mir testcase that was printed immediately before register allocation (i.e. after machine scheduler).

However, here's a piece of information that illustrates the problem. It's a dump of LIS immediately before the problem occurs, i.e. before EliminateDeadDefs in "hoistAllSpills". The dump has been reduced to only include the offending register vreg268.

  ********** INTERVALS **********
  ...
  %vreg268 [256r,432r:0)[432r,544B:1)[608r,640B:2)[640B,848B:3)[864B,2152r:3)[4128B,4132r:3)[5456B,5488B:1)[5520r,5544B:4)[5544B,5600B:1)  0 at 256r 1 at 432r 2 at 608r 3 at 640B-phi 4 at 5520r L00000002 [432r,544B:0)[640B,848B:0)[864B,2152r:0)[4128B,4132r:0)[5456B,5488B:0)[5544B,5600B:0)  0 at 432r L00000001 [256r,544B:0)[608r,640B:1)[640B,848B:3)[864B,2152r:3)[4128B,4132r:3)[5456B,5488B:0)[5520r,5544B:2)[5544B,5600B:0)  0 at 256r 1 at 608r 2 at 5520r 3 at 640B-phi
  RegMasks:
  ********** MACHINEINSTRS **********
  # Machine code for function fred: NoPHIs, TracksLivenessFrame Objects:
    fi#0: size=8, align=8, at location [SP]
  
  0B      BB#0: derived from LLVM BB %b3
  256B            %vreg268:isub_hi<def,read-undef> = L2_loadruh_io %vreg187, 4
  432B            %vreg268:isub_lo<def> = COPY %vreg10
  448B            %vreg248<def> = S2_lsr_i_vw %vreg268, 8
              Successors according to CFG: BB#12 BB#1
  
  544B    BB#1:
              Predecessors according to CFG: BB#0
  608B            %vreg268:isub_hi<def,read-undef> = IMPLICIT_DEF
              Successors according to CFG: BB#2(?%)
  
  640B    BB#2: derived from LLVM BB %b16
              Predecessors according to CFG: BB#14 BB#1 BB#13
              Successors according to CFG: BB#4 BB#3
  
  848B    BB#3: derived from LLVM BB %b23
              Predecessors according to CFG: BB#2
  
  864B    BB#4: derived from LLVM BB %b24
              Predecessors according to CFG: BB#2
              Successors according to CFG: BB#8 BB#5
  
  1848B   BB#5: derived from LLVM BB %b31
              Predecessors according to CFG: BB#4
  2108B           S2_storerd_io <fi#0>, 0, %vreg268
              Successors according to CFG: BB#9 BB#6
  
  2144B   BB#6: derived from LLVM BB %b32
              Predecessors according to CFG: BB#5
  2152B           KILL <fi#0>, 0, %vreg268
              Successors according to CFG: BB#10 BB#7
  
  2240B   BB#7: derived from LLVM BB %b33
              Predecessors according to CFG: BB#6
              Successors according to CFG: BB#11
  
  4120B   BB#8: derived from LLVM BB %b53
              Predecessors according to CFG: BB#4
  
  4128B   BB#9: derived from LLVM BB %b54
              Predecessors according to CFG: BB#5
  4132B           KILL <fi#0>, 0, %vreg268
              Successors according to CFG: BB#11
  
  4256B   BB#10: derived from LLVM BB %b55
              Predecessors according to CFG: BB#6
              Successors according to CFG: BB#11
  
  4376B   BB#11: derived from LLVM BB %b56
              Predecessors according to CFG: BB#7 BB#10 BB#9
  
  5456B   BB#12: derived from LLVM BB %b64
              Predecessors according to CFG: BB#0
              Successors according to CFG: BB#14 BB#13
  
  5488B   BB#13:
              Predecessors according to CFG: BB#12
  5520B           %vreg268:isub_hi<def,read-undef> = IMPLICIT_DEF
              Successors according to CFG: BB#2
  
  5544B   BB#14: derived from LLVM BB %b66
              Predecessors according to CFG: BB#12
              Successors according to CFG: BB#2
  
  # End machine code for function fred.
  
  Deleting dead def 2152r KILL <fi#0>, 0, %vreg268; mem:ST8[FixedStack0] DoubleRegs:%vreg268
  Deleting dead def 4132r KILL <fi#0>, 0, %vreg268; mem:ST8[FixedStack0] DoubleRegs:%vreg268
  Shrink: %vreg268 [256r,432r:0)[432r,544B:1)[608r,640B:2)[640B,848B:3)[864B,2152r:3)[4128B,4132r:3)[5456B,5488B:1)[5520r,5544B:4)[5544B,5600B:1)  0 at 256r 1 at 432r 2 at 608r 3 at 640B-phi 4 at 5520r L00000002 [432r,544B:0)[640B,848B:0)[864B,2152r:0)[4128B,4132r:0)[5456B,5488B:0)[5544B,5600B:0)  0 at 432r L00000001 [256r,544B:0)[608r,640B:1)[640B,848B:3)[864B,2152r:3)[4128B,4132r:3)[5456B,5488B:0)[5520r,5544B:2)[5544B,5600B:0)  0 at 256r 1 at 608r 2 at 5520r 3 at 640B-phi
  Shrink:  L00000002 [432r,544B:0)[640B,848B:0)[864B,2152r:0)[4128B,4132r:0)[5456B,5488B:0)[5544B,5600B:0)  0 at 432r
   live-in at 1848B
   live-in at 864B
   live-in at 640B
  llc: /w/src/llvm.m/lib/CodeGen/LiveIntervalAnalysis.cpp:394: void extendSegmentsToUses(llvm::LiveRange &, const llvm::SlotIndexes &, ShrinkToUsesWorkList &, const llvm::LiveRange &): Assertion `OldRange.getVNInfoBefore(Stop) == VNI && "Wrong value out of predecessor"' failed.


Repository:
  rL LLVM

https://reviews.llvm.org/D26359





More information about the llvm-commits mailing list