[llvm-bugs] [Bug 27987] New: IfConversion adds Undef flag on use even if reg is live
via llvm-bugs
llvm-bugs at lists.llvm.org
Fri Jun 3 00:08:53 PDT 2016
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: paulsson at linux.vnet.ibm.com
Reporter: paulsson at linux.vnet.ibm.com
CC: llvm-bugs at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160603/2a1d052a/attachment.html>
More information about the llvm-bugs
mailing list