[PATCH] D83197: [CodeGen] Fix warning in DAGTypeLegalizer::SplitVecRes_ExtendOp

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 6 12:53:25 PDT 2020


david-arm created this revision.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a reviewer: rengolin.
Herald added a project: LLVM.

This fixes up a warning in the following test:

  sve-sext-zext.ll


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D83197

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


Index: llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
===================================================================
--- llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
@@ -1767,8 +1767,7 @@
   // more effectively move in the right direction and prevent falling down
   // to scalarization in many cases due to the input vector being split too
   // far.
-  unsigned NumElements = SrcVT.getVectorNumElements();
-  if ((NumElements & 1) == 0 &&
+  if ((SrcVT.getVectorMinNumElements() & 1) == 0 &&
       SrcVT.getSizeInBits() * 2 < DestVT.getSizeInBits()) {
     LLVMContext &Ctx = *DAG.getContext();
     EVT NewSrcVT = SrcVT.widenIntegerVectorElementType(Ctx);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83197.275607.patch
Type: text/x-patch
Size: 739 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200706/b27df41f/attachment.bin>


More information about the llvm-commits mailing list