[AArch64] Fix scalar imm variants of SIMD shift left instructions
authorAndrew Savonichev <andrew.savonichev@gmail.com>
Thu, 29 Apr 2021 16:34:39 +0000 (19:34 +0300)
committerAndrew Savonichev <andrew.savonichev@gmail.com>
Wed, 5 May 2021 13:26:29 +0000 (16:26 +0300)
commit1ee50b473168735752a2f80ae9b356cfa70a76d0
tree5e60beb3f57324691dccdbb7f786003dde89c9bb
parent3ee826594a9ed4119dd1fdfdd3f5f9175991e688
[AArch64] Fix scalar imm variants of SIMD shift left instructions

This issue was reported in PR50057: Cannot select:
t10: i64 = AArch64ISD::VSHL t2, Constant:i32<2>

Shift intrinsics (llvm.aarch64.neon.ushl.i64 and sshl) with a constant
shift operand are lowered into AArch64ISD::VSHL in tryCombineShiftImm.
VSHL has i64 and v1i64 patterns for a right shift, but only v1i64 for
a left shift.

This patch adds the missing i64 pattern for AArch64ISD::VSHL, and LIT
tests to cover scalar variants (i64 and v1i64) of all shift
intrinsics (only ushl and sshl cases fail without the patch, others
were just not covered).

Differential Revision: https://reviews.llvm.org/D101580
llvm/lib/Target/AArch64/AArch64InstrFormats.td
llvm/test/CodeGen/AArch64/arm64-vshift.ll