This is an archive of the discontinued LLVM Phabricator instance.

[X86] Allow fake unary unpckhpd and movhlps to be commuted for execution domain fixing purposes
ClosedPublic

Authored by craig.topper on Aug 1 2018, 1:09 PM.

Details

Summary

These instructions perform the same operation, but the semantic of which operand is destroyed is reversed. If the same register is used as both operands we can change the execution domain without worrying about this difference.

Unfortunately, this really only works in cases where the input register is killed by the instruction. If its not killed, the two address isntruction pass inserts a copy that will become a move instruction. This makes the instruction use different physical registers that contain the same data at the time the unpck/movhlps executes. I've considered using a unary pseudo instruction with tied operand to trick the two address instruction pass. We could then expand the pseudo post regalloc to get the same physical register on both inputs.

Diff Detail

Event Timeline

craig.topper created this revision.Aug 1 2018, 1:09 PM
RKSimon accepted this revision.Aug 2 2018, 7:38 AM

LGTM - please can you add a TODO describing the non-killed register case

This revision is now accepted and ready to land.Aug 2 2018, 7:38 AM
This revision was automatically updated to reflect the committed changes.