41 lines · plain
1# RUN: not --crash llc -mtriple=aarch64-- -run-pass=legalizer %s -o - 2>&1 | FileCheck %s2 3# This is to demonstrate what kind of bugs we're missing w/o some kind4# of validation for LegalizerInfo: G_INTTOPTR could only be legal /5# could be legalized if its destination operand has a pointer type and6# its source - a scalar type of an appropriate size. This test meets7# the requirements for type index 0 (the pointer) and LLT-size8# requirements for type index 1 (64 bits for AArch64), but has a9# non-scalar (vector) type for type index 1. The Legalizer is expected10# to fail on it with an appropriate error message. Prior to11# LegalizerInfo::verify AArch64 legalizer had a subtle bug in its12# definition that caused it to accept the following MIR as legal.13# Namely, it checked that type index 0 is either s64 or p0 and14# implicitly declared any type for type index 1 as legal (as soon as15# its size is 64 bits). As LegalizerInfo::verify asserts on such a16# definition due to type index 1 not being covered by a specific17# action (not just `unsupportedIf`) it forces to review the definition18# and fix the mistake: check that type index 0 is p0 and type index 119# is s64.20 21# CHECK: Bad machine code: operand types must be all-vector or all-scalar22# CHECK: LLVM ERROR: Found 1 machine code errors.23 24---25name: broken26alignment: 427tracksRegLiveness: true28registers:29 - { id: 0, class: _ }30 - { id: 1, class: _ }31body: |32 bb.1:33 liveins: $d034 35 %0:_(<4 x s16>) = COPY $d036 %1:_(p0) = G_INTTOPTR %0(<4 x s16>)37 $x0 = COPY %1(p0)38 RET_ReallyLR implicit $x039 40...41