[CodeGen] Fix up warnings in visitEXTRACT_SUBVECTOR
authorDavid Sherwood <david.sherwood@arm.com>
Fri, 26 Jun 2020 12:54:55 +0000 (13:54 +0100)
committerDavid Sherwood <david.sherwood@arm.com>
Wed, 1 Jul 2020 14:10:53 +0000 (15:10 +0100)
commit97a7a9abb25d86fd831b403a1d13de6d62e7a8b5
tree69d419bec10f2cba93becbd0e38407cf61f85d7f
parentf3b5bf3eb7029238cead637be2e285b443b2e141
[CodeGen] Fix up warnings in visitEXTRACT_SUBVECTOR

It's perfectly valid to do certain DAG combines where we extract
subvectors from a concat vector when we have scalable vector types.
However, we can do this in a way that avoids generating compiler
warnings by replacing calls to getVectorNumElements() with
getVectorMinNumElements(). Due to the way subvector extracts are
designed to work with scalable vector types this is ok.

This eliminates some warnings from existing tests in this file:

  llvm/test/CodeGen/AArch64/sve-intrinsics-loads.ll

Differential Revision: https://reviews.llvm.org/D82655
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp