[PATCH] D56796: [DAGCombiner][x86] add transform/hook to vectorize: cast(extract V, Y)

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 16 10:10:15 PST 2019


spatel created this revision.
spatel added reviewers: RKSimon, craig.topper, lebedev.ri, andreadb.
Herald added a subscriber: mcrosier.

This is a fix for PR39974:
https://bugs.llvm.org/show_bug.cgi?id=39974

I didn't see any existing TLI hooks that capture what we need to know if this is profitable, so I'm proposing a new hook that includes the source and destination types of the cast op. This is enabled for x86 only here, but any target that wants to avoid a register file back-and-forth may find this useful.

The known bits diffs suggest that we can do better at simplifying based on vector demanded elements, but I'm assuming those are not the typical patterns.
We would also likely improve things by moving shuffles ahead of the cast in the case where we are not extracting from element 0.


https://reviews.llvm.org/D56796

Files:
  include/llvm/CodeGen/TargetLowering.h
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  lib/Target/X86/X86ISelLowering.cpp
  lib/Target/X86/X86ISelLowering.h
  test/CodeGen/X86/known-bits-vector.ll
  test/CodeGen/X86/known-signbits-vector.ll
  test/CodeGen/X86/vec_int_to_fp.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56796.182087.patch
Type: text/x-patch
Size: 18259 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190116/3a316539/attachment.bin>


More information about the llvm-commits mailing list