[SVE] Remove getNumElements() warnings in InstCombiner::visitBitCast
authorDavid Sherwood <david.sherwood@arm.com>
Tue, 26 May 2020 15:07:46 +0000 (16:07 +0100)
committerDavid Sherwood <david.sherwood@arm.com>
Fri, 29 May 2020 07:00:08 +0000 (08:00 +0100)
commitf254f1d94e8d0070b2d006a3d1e7ee6eeae0aaa7
treede17f15ecf8faf97ad6e6a8e8d1303909df0e951
parent9c0ef044beb4850ad9626cb81a1ede4f3bbda4a7
[SVE] Remove getNumElements() warnings in InstCombiner::visitBitCast

Whilst trying to compile this test to assembly:

  CodeGen/aarch64-sve-intrinsics/acle_sve_reinterpret.c

I discovered some warnings were firing in InstCombiner::visitBitCast
due to calls to getNumElements() for scalable vector types. These
calls only really made sense for fixed width vectors so I have fixed
up the code appropriately.

Differential Revision: https://reviews.llvm.org/D80559
llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
llvm/test/Transforms/InstCombine/AArch64/sve-bitcast.ll [new file with mode: 0644]