Skip to content
  • Jakob Stoklund Olesen's avatar
    Fix liveness computations in BranchFolding. · d633abeb
    Jakob Stoklund Olesen authored
    The old code would look at kills and defs in one pass over the
    instruction operands, causing problems with this code:
    
      %R0<def>, %CPSR<def,dead> = tLSLri %R5<kill>, 2, pred:14, pred:%noreg
      %R0<def>, %CPSR<def,dead> = tADDrr %R4<kill>, %R0<kill>, pred:14, %pred:%noreg
    
    The last instruction kills and redefines %R0, so it is still live after
    the instruction.
    
    This caused a register scavenger crash when compiling 483.xalancbmk for
    armv6. I am not including a test case because it requires too much bad
    luck to expose this old bug.
    
    First you need to convince the register allocator to use %R0 twice on
    the tADDrr instruction, then you have to convince BranchFolding to do
    something that causes it to run the register scavenger on he bad block.
    
    <rdar://problem/9898200>
    
    llvm-svn: 136973
    d633abeb
Loading