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

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 8 00:54:15 PST 2017


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

Fixing ComputeNumSignBits() per your suggestion eliminates the unnecessary SIGN_EXTEND_VECTOR_INREG in several cases, but not in all.

In cases where the SETCC gets split, a VECTOR_SHUFFLE or BUILD_VECTOR is generated. I experimented with handling these cases by extending ComputeNumSignBits() for several more nodes, which seems to work. It resembles a bit the situation from before, where we also handled scalarized code after type legalization.

I also recall that the new method kind of depends on the fact that VSELECTs get split in DAGCombiner (line 6218). If that is not done, the mask adjustments in the end (extension / truncate) would not make sense. Should perhaps a check be added for this in the new method that this is indeed correct (or alternatively, update the comment in DAGCombiner)?


https://reviews.llvm.org/D29489

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29489.87602.patch
Type: text/x-patch
Size: 5414 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170208/7a7a13a3/attachment.bin>


More information about the llvm-commits mailing list