[PATCH] D82746: [CodeGen] Fix warning in getNode for EXTRACT_SUBVECTOR

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 29 02:39:31 PDT 2020


david-arm created this revision.
david-arm added reviewers: sdesmalen, fpetrogalli, efriedma.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.

Fix a warning in getNode() when extracting a subvector from a
concat vector. We can simply replace the call to getVectorNumElements
with getVectorMinNumElements as this follows the defined behaviour
for EXTRACT_SUBVECTOR.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D82746

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


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
===================================================================
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -5566,7 +5566,7 @@
     // the concat have the same type as the extract.
     if (N2C && N1.getOpcode() == ISD::CONCAT_VECTORS &&
         N1.getNumOperands() > 0 && VT == N1.getOperand(0).getValueType()) {
-      unsigned Factor = VT.getVectorNumElements();
+      unsigned Factor = VT.getVectorMinNumElements();
       return N1.getOperand(N2C->getZExtValue() / Factor);
     }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82746.274022.patch
Type: text/x-patch
Size: 609 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200629/7c9fae3a/attachment-0001.bin>


More information about the llvm-commits mailing list