[CodeGen] Fix incorrect uses of getVectorNumElements()
authorDavid Sherwood <david.sherwood@arm.com>
Tue, 5 May 2020 08:58:24 +0000 (09:58 +0100)
committerDavid Sherwood <david.sherwood@arm.com>
Tue, 12 May 2020 06:50:37 +0000 (07:50 +0100)
commit42c7a6d52ba052a195825e81668d88487b3f26cc
treef0828b9b83d8bb5f5dfe516f48d5269a1d1a00c8
parent054ed1fd0b8dfbd996299f11dfe2311f428297da
[CodeGen] Fix incorrect uses of getVectorNumElements()

I have fixed up some places in SelectionDAG::getNode() where we
used to assert that the number of vector elements for two types
are the same. I have changed such cases to assert that the
element counts are the same instead. I've added new tests that
exercise the code paths for all the truncations. All the extend
operations are covered by this existing test:

  CodeGen/AArch64/sve-sext-zext.ll

For the ISD::SETCC case I fixed this code path is exercised by
these existing tests:

  CodeGen/AArch64/sve-fcmp.ll
  CodeGen/AArch64/sve-intrinsics-int-compares-with-imm.ll

Differential Revision: https://reviews.llvm.org/D79399
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/test/CodeGen/AArch64/sve-trunc.ll [new file with mode: 0644]