[PATCH] D79718: [CGP] include funnel shift intrinsic when sinking splatted operands

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 11 09:07:37 PDT 2020


spatel created this revision.
spatel added reviewers: lebedev.ri, craig.topper, RKSimon.
Herald added subscribers: hiraditya, mcrosier.
Herald added a project: LLVM.

SDAG suffers when it can't see that a funnel operand is a splat value (due to single-basic-block visibility), so invert the normal loop hoisting rules to move a splat op closer to its use.

This builds on the transform added with rL201655 <https://reviews.llvm.org/rL201655>, and this would be part 1 of an enhancement similar to D63233 <https://reviews.llvm.org/D63233>.

This is needed to re-fix PR37426:
https://bugs.llvm.org/show_bug.cgi?id=37426
...because we got better at canonicalizing IR to funnel shift intrinsics.

I'm proposing to re-use the existing TLI hook for cheap vector shift because that should be a very similar heuristic (assuming that a target is going to use the same shift instructions/hardware for a custom/legal vector rotate/funnel as it does for a simple shift); x86 is the only public target that overrides this hook.


https://reviews.llvm.org/D79718

Files:
  llvm/lib/CodeGen/CodeGenPrepare.cpp
  llvm/test/CodeGen/X86/vector-fshl-128.ll
  llvm/test/Transforms/CodeGenPrepare/X86/x86-shuffle-sink.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79718.263181.patch
Type: text/x-patch
Size: 13777 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200511/7136be11/attachment.bin>


More information about the llvm-commits mailing list