HomePhabricator

[GlobalISel] Map extractelt to G_EXTRACT_VECTOR_ELT

Authored by bjope on Jan 11 2021, 7:19 AM.

Description

[GlobalISel] Map extractelt to G_EXTRACT_VECTOR_ELT

Before this patch there was generic mapping from vector_extract
to G_EXTRACT_VECTOR_ELT added in SelectionDAGCompat.td. That
mapping is now replaced by a mapping from extractelt instead.

The reasoning is that vector_extract is marked as deprecated,
so it is assumed that a majority of targets will use extractelt
and not vector_extract (and that the long term solution for all
targets would be to use extractelt).

Targets like AArch64 that still use vector_extract can add an
additional mapping from the deprecated vector_extract as target
specific tablegen definitions. Such a mapping is added for AArch64
in this patch to avoid breaking tests.

When adding the extractelt => G_EXTRACT_VECTOR_ELT mapping we
triggered some new code paths in GlobalISelEmitter, ending up in
an assert when trying to import a pattern containing EXTRACT_SUBREG
for ARM. Therefore this patch also adds a "failedImport" warning
for that situation (instead of hitting the assert).

Differential Revision: https://reviews.llvm.org/D93416

Details

Committed
bjopeJan 11 2021, 12:53 PM
Differential Revision
D93416: [GlobalISel] Map extractelt to G_EXTRACT_VECTOR_ELT
Parents
rG288f3fc5dfee: [InstCombine] reduce icmp(ashr X, C1), C2 to sign-bit test
Branches
Unknown
Tags
Unknown