[PATCH] D29489: Optimize SETCC + VSEL of incompatible or illegal types

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 23 03:08:11 PST 2017


jonpa updated this revision to Diff 89489.
jonpa added a comment.

Tests added for SystemZ.

Regenerated tests:
test/CodeGen/ARM/vuzp.ll
test/CodeGen/X86/2011-10-19-widen_vselect.ll
test/CodeGen/X86/2011-10-21-widen-cmp.ll
test/CodeGen/X86/psubus.ll

> Can you give some examples of the patterns that we're missing? I'm trying to improve combining *_EXTEND_VECTOR_INREG instructions which probably has a lot of crossover.

As I remember it, it was not possible to get around the fact that if type-legalization widened a VSELECT with the previous behaviour, bad things happened which were not possible to handle in the DAGCombiner. So, the point was that the best thing was to avoid the scalarization by handling it early per this patch. This seems to be the right thing regardless of how the DAGCombiner is improved in the future. I could try to check back and get the details if you wish, or at least see if the ComputeNumSignBits() improvements would be useful generally.

Is this ok to commit now, or is there any assert or check that is needed in the new method in the case of any arbitrary target? Are the regenerated tests really ok, or should they be checked by respective target maintainers?


https://reviews.llvm.org/D29489

Files:
  lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
  lib/CodeGen/SelectionDAG/LegalizeTypes.h
  lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
  test/CodeGen/ARM/vuzp.ll
  test/CodeGen/SystemZ/vec-cmpsel.ll
  test/CodeGen/X86/2011-10-19-widen_vselect.ll
  test/CodeGen/X86/2011-10-21-widen-cmp.ll
  test/CodeGen/X86/psubus.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29489.89489.patch
Type: text/x-patch
Size: 85434 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170223/cc9641d9/attachment-0001.bin>


More information about the llvm-commits mailing list