1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py 2 # RUN: llc -mtriple=x86_64-linux-gnu -run-pass=legalizer %s -o - | FileCheck %s 3 4 --- | 5 6 define void @test_sub_i1() { ret void} 7 8 define i32 @test_sub_i32(i32 %arg1, i32 %arg2) { 9 %ret = sub i32 %arg1, %arg2 10 ret i32 %ret 11 } 12 13 ... 14 --- 15 name: test_sub_i1 16 alignment: 4 17 legalized: false 18 regBankSelected: false 19 registers: 20 - { id: 0, class: _, preferred-register: '' } 21 - { id: 1, class: _, preferred-register: '' } 22 - { id: 2, class: _, preferred-register: '' } 23 body: | 24 bb.1 (%ir-block.0): 25 26 ; CHECK-LABEL: name: test_sub_i1 27 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $edx 28 ; CHECK: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32) 29 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32) 30 ; CHECK: [[SUB:%[0-9]+]]:_(s8) = G_SUB [[TRUNC]], [[TRUNC1]] 31 ; CHECK: [[DEF:%[0-9]+]]:_(p0) = G_IMPLICIT_DEF 32 ; CHECK: [[C:%[0-9]+]]:_(s8) = G_CONSTANT i8 1 33 ; CHECK: [[COPY1:%[0-9]+]]:_(s8) = COPY [[SUB]](s8) 34 ; CHECK: [[AND:%[0-9]+]]:_(s8) = G_AND [[COPY1]], [[C]] 35 ; CHECK: G_STORE [[AND]](s8), [[DEF]](p0) :: (store 1) 36 ; CHECK: RET 0 37 %0(s32) = COPY $edx 38 %1(s1) = G_TRUNC %0(s32) 39 %2(s1) = G_SUB %1, %1 40 %3:_(p0) = G_IMPLICIT_DEF 41 G_STORE %2, %3 :: (store 1) 42 RET 0 43 ... 44 --- 45 name: test_sub_i32 46 alignment: 4 47 legalized: false 48 regBankSelected: false 49 tracksRegLiveness: true 50 registers: 51 - { id: 0, class: _ } 52 - { id: 1, class: _ } 53 - { id: 2, class: _ } 54 body: | 55 bb.1 (%ir-block.0): 56 liveins: $edi, $esi 57 58 ; CHECK-LABEL: name: test_sub_i32 59 ; CHECK: liveins: $edi, $esi 60 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $edi 61 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $esi 62 ; CHECK: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[COPY]], [[COPY1]] 63 ; CHECK: $eax = COPY [[SUB]](s32) 64 ; CHECK: RET 0, implicit $eax 65 %0(s32) = COPY $edi 66 %1(s32) = COPY $esi 67 %2(s32) = G_SUB %0, %1 68 $eax = COPY %2(s32) 69 RET 0, implicit $eax 70 71 ... 72