This is an archive of the discontinued LLVM Phabricator instance.

[X86] Add a hack to combinePMULDQ to manually turn SIGN_EXTEND_VECTOR_INREG/ZERO_EXTEND_VECTOR_INREG inputs into an ANY_EXTEND_VECTOR_INREG style shuffle
ClosedPublic

Authored by craig.topper on Aug 19 2019, 1:16 PM.

Details

Summary

ANY_EXTEND_VECTOR_INREG isn't currently marked Legal which prevents SimplifyDemandedBits from turning SIGN/ZERO_EXTEND_VECTOR_INREG into it after op legalization. And even if we did make it Legal, combineExtInVec doesn't do shuffle combining on the VECTOR_INREG nodes until AVX1.

This patch adds a quick hack to combinePMULDQ to directly emit a vector shuffle corresponding to an ANY_EXTEND_VECTOR_INREG operation. This avoids both of those issues without creating any other regressions on our tests. The xop-ifma.ll change here also showed up when I tried to resurrect D56306 and seemed to be the only improvement that patch creates now. This is a more direct way to get the benefit.

Diff Detail

Event Timeline

craig.topper created this revision.Aug 19 2019, 1:16 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 19 2019, 1:16 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
RKSimon accepted this revision.Aug 26 2019, 7:03 AM

LGTM, tbh I'd much prefer to get ANY_EXTEND_VECTOR_INREG handled properly, but there's still some yak shaving to do there.....

This revision is now accepted and ready to land.Aug 26 2019, 7:03 AM
This revision was automatically updated to reflect the committed changes.