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

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 9 05:57:29 PST 2017


jonpa added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp:547
+    else if (Cond.getOpcode() == ISD::SETCC)
+      std::tie(CL, CH) = SplitVSETCC(Cond.getNode(), DAG);
     // Check if there are already splitted versions of the vector available and
----------------
efriedma wrote:
> Does SplitVSETCC do something different from just calling SplitVector?  Your patch doesn't show any changes to avx512-mask-op.ll.
Yes, it creates two SETCCs of half the size, instead of splitting the result vector of the wide SETCC. There is now change to that test anymore. See my comment from March 1st above.



================
Comment at: lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp:2932
+    // then) a CONCAT_VECTORS with undef(s).
+    ConvertOpc = ISD::TRUNCATE;
+  
----------------
efriedma wrote:
> Could you just perform the SIGN_EXTEND/TRUNCATE to match the scalar size, then EXTRACT_SUBVECTOR/CONCAT_SUBVECTORS to match the number of elements?  The invariants involving the relationship between the number of elements and the scalar sizes of MaskVT and ToMaskVT are confusing at best.
Yes, this seems better, thanks :-)



https://reviews.llvm.org/D29489





More information about the llvm-commits mailing list