This is an archive of the discontinued LLVM Phabricator instance.

[X86] Add pseudo instructions to use MULX with a single destination when the low result isn't used.
ClosedPublic

Authored by craig.topper on May 24 2020, 4:49 PM.

Details

Summary

The instruction is defined to only produce high result if both
destinations are the same. We can exploit this to avoid
unnecessarily clobbering a register.

In order to hide this from register allocation we use a pseudo
instruction and expand the result during MCInst creation.

Diff Detail

Event Timeline

craig.topper created this revision.May 24 2020, 4:49 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 24 2020, 4:49 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
RKSimon accepted this revision.May 30 2020, 2:17 AM

LGTM with one trivial minor

llvm/lib/Target/X86/X86MCInstLower.cpp
2014

for (unsigned I = 1, E = MI->getNumOperands(); I < E; ++I) ??

This revision is now accepted and ready to land.May 30 2020, 2:17 AM
This revision was automatically updated to reflect the committed changes.