1# RUN: llc -O0 -run-pass=legalizer %s -o - | FileCheck %s 2--- | 3 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" 4 target triple = "aarch64--" 5 6 define void @test_anyext_crash() { 7 entry: 8 br label %block2 9 10 block2: 11 %0 = trunc i16 0 to i8 12 %1 = uitofp i8 %0 to double 13 br label %block2 14 } 15 16 17... 18--- 19name: test_anyext_crash 20alignment: 2 21legalized: false 22registers: 23 - { id: 0, class: _, preferred-register: '' } 24 - { id: 1, class: _, preferred-register: '' } 25 - { id: 2, class: _, preferred-register: '' } 26body: | 27 bb.1: 28 ; Check we don't crash due to trying to legalize a dead instruction. 29 ; CHECK-LABEL: test_anyext_crash 30 ; CHECK-LABEL: bb.1: 31 successors: %bb.2 32 33 %0(s16) = G_CONSTANT i16 0 34 35 bb.2: 36 successors: %bb.2 37 38 %1(s8) = G_TRUNC %0(s16) 39 %2(s64) = G_UITOFP %1(s8) 40 G_BR %bb.2 41 42... 43