This is an archive of the discontinued LLVM Phabricator instance.

[X86] Add PACK instructions to hasUndefRegUpdate so the BreakFalseDeps pass will reassign an undef second source to match the first source
ClosedPublic

Authored by craig.topper on Apr 28 2020, 12:20 PM.

Details

Summary

We generate PACK instructions with an undef second source when we are truncating from a 128-bit vector to something narrower and we don't care about the upper bits of the vector register. The register allocation process will always assign untied undef uses to xmm0. This creates a false dependency on xmm0.

By adding these instructions to hasUndefRegUpdate, we can get the BreakFalseDeps pass to reassign the source to match the other input. Normally this interface is used for instructions that might need an xor inserted to break the dependency. But the pass also has a heuristic that tries to use the same register as other sources. That should always be possible for these instructions so we'll never trigger the xor dependency break.

Diff Detail

Event Timeline

craig.topper created this revision.Apr 28 2020, 12:20 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 28 2020, 12:20 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
RKSimon accepted this revision.Apr 28 2020, 2:16 PM

LGTM - cheers

This revision is now accepted and ready to land.Apr 28 2020, 2:16 PM
This revision was automatically updated to reflect the committed changes.