OSDN Git Service

[x86][CGP] try to hoist funnel shift above select-of-splats
authorSanjay Patel <spatel@rotateright.com>
Fri, 15 May 2020 19:22:30 +0000 (15:22 -0400)
committerSanjay Patel <spatel@rotateright.com>
Sat, 16 May 2020 14:44:47 +0000 (10:44 -0400)
commit5be37cb124f71e267f1cf7bc3929486fde2acd0a
tree094c8f2b6c6de886759c36b4916e59d65cb4093c
parent72f1fb2edf596e6030f6b55439c732631edb4e91
[x86][CGP] try to hoist funnel shift above select-of-splats

This is basically the same patch as D63233, but converted to
funnel shifts rather than regular shifts. I did not see a
way to effectively share code for these 2 cases though.

This follows D79718 and D79827 to re-fix PR37426 because
that gets canonicalized to funnel shift intrinsics in IR.

I did draft an alternative patch as an enhancement to
"shouldSinkOperands()", but that was awkward because
we have to key the transform from the select, but then
look at both its users and its operands.
llvm/lib/CodeGen/CodeGenPrepare.cpp
llvm/test/CodeGen/X86/vector-fshl-256.ll
llvm/test/Transforms/CodeGenPrepare/X86/vec-shift.ll