[llvm] bdb1ab9 - [LegalizeTypes][VP] Use LoVT/HiVT when splitting VP operations in SplitVecRes_UnaryOp.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 6 10:53:40 PDT 2022


Author: Craig Topper
Date: 2022-04-06T10:51:49-07:00
New Revision: bdb1ab98049b49dacda6b8c68013793b9db792f5

URL: https://github.com/llvm/llvm-project/commit/bdb1ab98049b49dacda6b8c68013793b9db792f5
DIFF: https://github.com/llvm/llvm-project/commit/bdb1ab98049b49dacda6b8c68013793b9db792f5.diff

LOG: [LegalizeTypes][VP] Use LoVT/HiVT when splitting VP operations in SplitVecRes_UnaryOp.

The VP path was using the split source VTs instead of the split
destination VTs. This may not be a problem today because the VP
nodes going through this have the same source and dest VTs.
It will be a problem when we start using this function for legalizing
VP cast operations.

Added: 
    

Modified: 
    llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
index 56e8c8b1d002a..ef1be4e53611f 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
@@ -2110,10 +2110,8 @@ void DAGTypeLegalizer::SplitVecRes_UnaryOp(SDNode *N, SDValue &Lo,
   std::tie(EVLLo, EVLHi) =
       DAG.SplitEVL(N->getOperand(2), N->getValueType(0), dl);
 
-  Lo = DAG.getNode(Opcode, dl, Lo.getValueType(),
-                   {Lo, MaskLo, EVLLo}, Flags);
-  Hi = DAG.getNode(Opcode, dl, Hi.getValueType(),
-                   {Hi, MaskHi, EVLHi}, Flags);
+  Lo = DAG.getNode(Opcode, dl, LoVT, {Lo, MaskLo, EVLLo}, Flags);
+  Hi = DAG.getNode(Opcode, dl, HiVT, {Hi, MaskHi, EVLHi}, Flags);
 }
 
 void DAGTypeLegalizer::SplitVecRes_ExtendOp(SDNode *N, SDValue &Lo,


        


More information about the llvm-commits mailing list