This is an archive of the discontinued LLVM Phabricator instance.

[SLPVectorizer] Add initial alternate opcode support for cast instructions.
ClosedPublic

Authored by RKSimon on Jul 10 2018, 7:22 AM.

Details

Summary

We currently only support binary instructions in the alternate opcode shuffles.

This patch is an initial attempt at adding cast instructions as well, this raises several issues that we probably want to address as we continue to generalize the alternate mechanism:

1 - Duplication of cost determination - we should probably add scalar/vector costs helper functions and get BoUpSLP::getEntryCost to use them instead of determining costs directly.
2 - Support alternate instructions with the same opcode (e.g. casts with different src types) - alternate vectorization of calls with different IntrinsicIDs will require this.
3 - Allow alternates to be a different instruction type - mixing binary/cast/call etc.
4 - Allow passthrough of unsupported alternate instructions - related to PR30787/D28907 'copyable' elements.

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon created this revision.Jul 10 2018, 7:22 AM
dtemirbulatov accepted this revision.Jul 10 2018, 8:22 PM

looks good for me.

This revision is now accepted and ready to land.Jul 10 2018, 8:22 PM
This revision was automatically updated to reflect the committed changes.

This change broke compilation and started triggering asserts for me. See http://martin.st/temp/hb-ot-font-f498e6.cpp and .sh for repro. Will file a proper PR later when I have more time.

Filed a proper bug report as PR38154.

Reverted in SVN r336949.