Skip to content
  • Jakob Stoklund Olesen's avatar
    Avoid creating dangling physreg live ranges during DCE. · 374071dd
    Jakob Stoklund Olesen authored
    LiveRangeEdit::eliminateDeadDefs() can delete a dead instruction that
    reads unreserved physregs. This would leave the corresponding regunit
    live interval dangling because we don't have shrinkToUses() for physical
    registers.
    
    Fix this problem by turning the instruction into a KILL instead of
    deleting it. This happens in a landing pad in
    test/CodeGen/X86/2012-05-19-CoalescerCrash.ll:
    
      %vreg27<def,dead> = COPY %EDX<kill>; GR32:%vreg27
    
    becomes:
    
      KILL %EDX<kill>
    
    An upcoming fix to the machine verifier will catch problems like this by
    verifying regunit live intervals.
    
    This fixes PR13498. I am not including the test case from the PR since
    we already have one exposing the problem once the verifier is fixed.
    
    llvm-svn: 161182
    374071dd
Loading