[llvm] da73189 - [CodeGen] Replace calls to getVectorNumElements() in DAGTypeLegalizer::SetSplitVector

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 10 00:29:36 PDT 2020


Author: David Sherwood
Date: 2020-07-10T08:29:17+01:00
New Revision: da731894a2fe45fd5bec9698f3206c1fdee2829a

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

LOG: [CodeGen] Replace calls to getVectorNumElements() in DAGTypeLegalizer::SetSplitVector

In DAGTypeLegalizer::SetSplitVector I have changed calls in the assert
from getVectorNumElements() to getVectorElementCount(), since this
code path works for both fixed and scalable vectors.

This fixes up one warning in the test:

  sve-sext-zext.ll

Differential Revision: https://reviews.llvm.org/D83196

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
index 2e1377c2c173..ae087d3bbd8c 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
@@ -835,9 +835,9 @@ void DAGTypeLegalizer::GetSplitVector(SDValue Op, SDValue &Lo,
 void DAGTypeLegalizer::SetSplitVector(SDValue Op, SDValue Lo,
                                       SDValue Hi) {
   assert(Lo.getValueType().getVectorElementType() ==
-         Op.getValueType().getVectorElementType() &&
-         2*Lo.getValueType().getVectorNumElements() ==
-         Op.getValueType().getVectorNumElements() &&
+             Op.getValueType().getVectorElementType() &&
+         Lo.getValueType().getVectorElementCount() * 2 ==
+             Op.getValueType().getVectorElementCount() &&
          Hi.getValueType() == Lo.getValueType() &&
          "Invalid type for split vector");
   // Lo/Hi may have been newly allocated, if so, add nodeid's as relevant.


        


More information about the llvm-commits mailing list