This is an archive of the discontinued LLVM Phabricator instance.

[X86][SSE] Use ISD::MULHS for constant vXi16 ISD::SRA lowering (PR38151)
ClosedPublic

Authored by RKSimon on Sep 17 2018, 7:10 AM.

Details

Summary

Similar to the existing ISD::SRL constant vector shifts from D49562, this patch adds ISD::SRA support with ISD::MULHS.

As we're dealing with signed values, we have to handle shift by zero and shift by one special cases, so XOP+AVX2/AVX512 splitting/extension is still a better solution - really we should still use ISD::MULHS if one of the special cases are used but for now I've just left a TODO and filtered by isKnownNeverZero.

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon created this revision.Sep 17 2018, 7:10 AM
This revision is now accepted and ready to land.Sep 25 2018, 10:52 PM
This revision was automatically updated to reflect the committed changes.