[PATCH] D63233: [CodeGenPrepare] shift both sides of a vector select when profitable

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 12 16:30:33 PDT 2019


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

This is based on the example/discussion in PR37428:
https://bugs.llvm.org/show_bug.cgi?id=37428

Proper vector shift instructions don't appear until AVX2, so we may generate several extra instructions within a loop trying to compensate for that. It's difficult to recover from that expansion later than this, so use the existing TLI hook and splat analysis to enable better codegen.


https://reviews.llvm.org/D63233

Files:
  llvm/lib/CodeGen/CodeGenPrepare.cpp
  llvm/test/CodeGen/X86/vector-shift-lshr-128.ll
  llvm/test/CodeGen/X86/vector-shift-shl-128.ll
  llvm/test/Transforms/CodeGenPrepare/X86/vec-shift.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63233.204383.patch
Type: text/x-patch
Size: 24878 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190612/af07f3bd/attachment.bin>


More information about the llvm-commits mailing list