[CodeGen][SVE] Don't drop scalable flag in DAGCombiner::visitEXTRACT_SUBVECTOR
authorSander de Smalen <sander.desmalen@arm.com>
Thu, 2 Jul 2020 09:06:41 +0000 (10:06 +0100)
committerSander de Smalen <sander.desmalen@arm.com>
Thu, 2 Jul 2020 09:16:43 +0000 (10:16 +0100)
commit143e324e7501e127ae1275c93c743cf06e9e18b1
treedbb3748baa8f28d1e2cdfda29c17e9508af2af5a
parent07bda98b6afdef7bed0bf7d47f5a8f6cfc64d973
[CodeGen][SVE] Don't drop scalable flag in DAGCombiner::visitEXTRACT_SUBVECTOR

There was a rogue 'assert' in AArch64ISelLowering for the tuple.get intrinsics,
that shouldn't really have been there (I suspect this was a remnant from when
we expected the wider vector always to have come from a vector CONCAT).

When I tried to create a more minimal reproducer, I found a bug in
DAGCombiner where it drops the scalable flag when trying to fold:

      extract_subv (bitcast X), Index --> bitcast (extract_subv X, Index')

This patch fixes both issues.

Reviewers: david-arm, efriedma, spatel

Reviewed By: efriedma

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82910
llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/test/CodeGen/AArch64/sve-extract-subvector.ll [new file with mode: 0644]