[CodeGen] Fix warnings in sve-vector-splat.ll and sve-trunc.ll
authorDavid Sherwood <david.sherwood@arm.com>
Mon, 29 Jun 2020 08:39:22 +0000 (09:39 +0100)
committerDavid Sherwood <david.sherwood@arm.com>
Tue, 7 Jul 2020 08:21:47 +0000 (09:21 +0100)
commitc061e56e880a20488e0f7e6cf9975aa24b83067c
tree40e7306af4bb3d9f95335426ed75d9e65e029f68
parent44ea81acb696592281157656ea7d81ecb41ca161
[CodeGen] Fix warnings in sve-vector-splat.ll and sve-trunc.ll

This patch fixes all remaining warnings in:

  llvm/test/CodeGen/AArch64/sve-trunc.ll
  llvm/test/CodeGen/AArch64/sve-vector-splat.ll

I hit some warnings related to getCopyPartsToVector. I fixed two
issues:

1. In widenVectorToPartType() we assumed that we'd always be
using BUILD_VECTOR nodes to expand from one vector type to another,
which is incorrect for scalable vector types. I've fixed this for now
by simply bailing out immediately for scalable vectors.
2. In getCopyToPartsVector() I've changed the code to compare
the element counts of different types.

Differential Revision: https://reviews.llvm.org/D83028
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/test/CodeGen/AArch64/sve-trunc.ll
llvm/test/CodeGen/AArch64/sve-vector-splat.ll