This is an archive of the discontinued LLVM Phabricator instance.

[PHIElimination] Fix accounting for undef uses when updating LiveVariables
ClosedPublic

Authored by foad on Oct 11 2021, 8:20 AM.

Details

Summary

PHI elimination updates LiveVariables info as described here:

// We only need to update the LiveVariables kill of SrcReg if this was the
// last PHI use of SrcReg to be lowered on this CFG edge and it is not live
// out of the predecessor. We can also ignore undef sources.

Unfortunately if the last use also happened to be an undef use then it
would fail to update the LiveVariables at all. Fix this by not counting
undef uses in the VRegPHIUse map.

Thanks to Mikael Holmén for the test case!

Diff Detail

Event Timeline

foad created this revision.Oct 11 2021, 8:20 AM
foad requested review of this revision.Oct 11 2021, 8:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 11 2021, 8:20 AM
MatzeB accepted this revision.Oct 11 2021, 9:39 AM

LGTM

This revision is now accepted and ready to land.Oct 11 2021, 9:39 AM