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

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 21 01:55:33 PST 2017


jonpa updated this revision to Diff 89171.
jonpa marked an inline comment as done.
jonpa added a comment.

> Yes if promotion can stop all of these cases then its probably a better place to handle it.

OK, I changed back so this is handled early, and the ComputeNumSignBits() changes are removed.

I got regressions on several targets when applying this. I could eliminate a few by adding more checks before transformation. Left are target tests that I can't really judge if things have improved for that target and if so the test should be updated, or if the patch is flawed. These are failing with the patch as it is:

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

To be honest, at the moment this method is working well basically under the assumptions of the SystemZ target, which for one thing only has vector registers of 128 bits. It also has its way of using a vector register as a bitmask to perform vector selects, and I am not sure if other targets do this the same way. So I would actually suggest that I move this to a custom lowering for SystemZ of VSELECT instead for now. Unless of course this is also a known issue on some other target, and somebody wants to jump in and help me finish the patch right away.

It would have been nice to just improve common code by improving DAGCombines of SEXT_INREG etc, but after trying all of that, it turns out that in order to handle all the cases, it is really preferred to do it early before it gets scalarized.

What do you think?


https://reviews.llvm.org/D29489

Files:
  lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
  lib/CodeGen/SelectionDAG/LegalizeTypes.h
  lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29489.89171.patch
Type: text/x-patch
Size: 5196 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170221/526c94d7/attachment.bin>


More information about the llvm-commits mailing list