IfConversion adds Undef flag on use even if reg is live
| Bugzilla Link | 27987 |
| Resolution | FIXED |
| Resolved on | Jun 23, 2016 04:00 |
| Version | trunk |
| OS | Linux |
| CC | @hfinkel |
Extended Description
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
%R4L
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
r273545
assigned to @JonPsson