[PATCH] D29454: [DAGCombine] RFC: Recognise any_extend_vector_inreg and truncation style shuffle masks

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 2 07:38:27 PST 2017


RKSimon created this revision.

During legalization we are often creating shuffles (via a build_vector scalarization stage) that are "any_extend_vector_inreg" style masks, and also other masks that are the equivalent of "truncate_vector_inreg" (if we had such a thing).

This RFC is an attempt to match these cases to help undo the effects of just leaving shuffle lowering to handle it - which typically means we lose track of the undefined elements of the shuffles resulting in an unnecessary extension+truncation stage for widened illegal types.

The 2011-10-21-widen-cmp.ll regression can be fixed by making SIGN_EXTEND_VECTOR_IN_REG legal in SSE instead of lowering them to X86ISD::VSEXT (PR31712). An alternative could be to improve target-specific DemandedElts handling at the DAG level (not a small amount of work....).

The regressions encountered in https://reviews.llvm.org/D28537 would be fixed by this.


Repository:
  rL LLVM

https://reviews.llvm.org/D29454

Files:
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  test/CodeGen/X86/2011-10-21-widen-cmp.ll
  test/CodeGen/X86/avx512-cvt.ll
  test/CodeGen/X86/avx512-vec-cmp.ll
  test/CodeGen/X86/sse-minmax.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29454.86812.patch
Type: text/x-patch
Size: 8724 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170202/06505e30/attachment.bin>


More information about the llvm-commits mailing list