https://llvm.org/bugs/show_bug.cgi?id=27987

            Bug ID: 27987
           Summary: IfConversion adds Undef flag on use even if reg is
                    live
           Product: libraries
           Version: trunk
          Hardware: PC
               URL: http://reviews.llvm.org/D20907
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
          Assignee: pauls...@linux.vnet.ibm.com
          Reporter: pauls...@linux.vnet.ibm.com
                CC: llvm-bugs@lists.llvm.org
    Classification: Unclassified

IfConversion will call UpdatePredRedefs() after an MI has been predicated by
target, to update the liveness tracking, and also to add implicit use operands
on MI (for the register that has become conditionally def:ed). IfConversion was
always adding these use operands with the Undef flag, which caused later passes
to get into trouble, since that register will incorrectly be considered dead
before MI.

This was discovered with SystemZ, where the following transformation would take
place where it shouldn't:

%R4L<def> = L %R15D, 440, %noreg; mem:LD4[FixedStack5]
%R4H<def> = IIHF 1000
%R4L<def> = LOCR %R10L<kill>, 14, 10, %CC<imp-use>, %R4L<imp-use,undef>
>

%R4L<def> = L %R15D, 440, %noreg; mem:LD4[FixedStack5]
%R4D<def> = LLIHL 1000
%R4L<def> = LOCR %R10L<kill>, 14, 10, %CC<imp-use>, %R4L<imp-use,undef>

LivePhysRegs thinks during the SystemZShortenInst pass that %R4L is dead at
IIHF and replaces it with an LLIHL wich overwrites %R4L. The LOCR (Load On
Condition Register) produced by IfConversion, has the bad undef flag.

For a proposed bugfix, see http://reviews.llvm.org/D20907

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to