This is an archive of the discontinued LLVM Phabricator instance.

[X86] Clear kill flags when rewriting SETCC uses in flag copy lowering.
ClosedPublic

Authored by craig.topper on Sep 19 2021, 3:55 PM.

Details

Summary

When we rewrite the setcc we replace set old setcc output register
with the new CondReg. But since CondReg can be shared by other
replacements, we don't know if the kill flags for the old register
are valid for CondReg. So be conservative and remove them.

The test case has a SETCCr and a SETCCm on the same condition so
they end up sharing the same CondReg. The SETCCr had one use with
a kill flag. This kill flag isn't valid after the replacement because
CondReg needs a live range extending to the later SETCCm replacment.

Fixes PR51903.

Diff Detail

Event Timeline

craig.topper created this revision.Sep 19 2021, 3:55 PM
craig.topper requested review of this revision.Sep 19 2021, 3:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 19 2021, 3:55 PM
RKSimon accepted this revision.Sep 21 2021, 1:23 PM

LGTM

This revision is now accepted and ready to land.Sep 21 2021, 1:23 PM
This revision was landed with ongoing or failed builds.Sep 21 2021, 2:30 PM
This revision was automatically updated to reflect the committed changes.
craig.topper edited the summary of this revision. (Show Details)Sep 21 2021, 2:35 PM

For reference, this was re-committed at rGb81e26c7f470ee324095f7adfbe0384974db4375