[CodeGenPrepare] Update optimizeGatherScatterInst for scalable vectors.
authorPaul Walker <paul.walker@arm.com>
Thu, 3 Dec 2020 12:26:29 +0000 (12:26 +0000)
committerPaul Walker <paul.walker@arm.com>
Tue, 15 Dec 2020 10:57:51 +0000 (10:57 +0000)
commit6d35bd1d48e9fdde38483e6b22a900daa7e3d46a
treed83265ef11345f65ca0278165fe38ddf02512370
parentbd0709266911bce2f1e8a875f9ed49d56953f323
[CodeGenPrepare] Update optimizeGatherScatterInst for scalable vectors.

optimizeGatherScatterInst does nothing specific to fixed length vectors
but uses FixedVectorType to extract the number of elements.  This patch
simply updates the code to use VectorType and getElementCount instead.

For testing I just copied Transforms/CodeGenPrepare/X86/gather-scatter-opt.ll
replacing `<4 x ` with `<vscale x 4`.

Differential Revision: https://reviews.llvm.org/D92572
llvm/lib/CodeGen/CodeGenPrepare.cpp
llvm/test/Transforms/CodeGenPrepare/AArch64/gather-scatter-opt.ll [new file with mode: 0644]