[PATCH] D80817: [CodeGen] Fix warning in SelectionDAG getNode for EXTRACT_VECTOR_ELT

Danilo Carvalho Grael via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 29 10:21:21 PDT 2020


dancgr created this revision.
dancgr added reviewers: sdesmalen, kmclaughlin, efriedma, andwar, rengolin.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
dancgr added a reviewer: bas.

Fix warning in SelectionDAG getNode for EXTRACT_VECTOR_ELT.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80817

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
@@ -5380,7 +5380,8 @@
       return getUNDEF(VT);
 
     // EXTRACT_VECTOR_ELT of out-of-bounds element is an UNDEF
-    if (N2C && N2C->getAPIntValue().uge(N1.getValueType().getVectorNumElements()))
+    if (!N1.getValueType().isScalableVector() &&
+      N2C && N2C->getAPIntValue().uge(N1.getValueType().getVectorNumElements()))
       return getUNDEF(VT);
 
     // EXTRACT_VECTOR_ELT of CONCAT_VECTORS is often formed while lowering is


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80817.267276.patch
Type: text/x-patch
Size: 665 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200529/910e4f8d/attachment.bin>


More information about the llvm-commits mailing list