[CodeGen] Fix warnings in getCopyToPartsVector
authorDavid Sherwood <david.sherwood@arm.com>
Mon, 29 Jun 2020 06:48:23 +0000 (07:48 +0100)
committerDavid Sherwood <david.sherwood@arm.com>
Thu, 2 Jul 2020 08:08:20 +0000 (09:08 +0100)
commitc7df35d2b28eae824cded70663a2becf359a5402
treed5055b42515ba6db47cbd2a8d00684db4c0a5f9e
parentd3bf1f3af2f26a7c100c3aa6b8ae93feb7034cb8
[CodeGen] Fix warnings in getCopyToPartsVector

Whilst trying to assemble the following test:

  clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_set2.c

I discovered we were hitting some warnings about possible invalid
calls to getVectorNumElements() in getCopyToPartsVector(). I've
tried to fix these by using ElementCount types where possible and
I've made the assumption that we don't support using a fixed width
vector to copy parts of a scalable vector, and vice versa. Looking
at how the copy is implemented I think that's the right thing for
now.

Differential Revision: https://reviews.llvm.org/D82744
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp