1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -mtriple=x86_64-linux-gnu -run-pass=legalizer %s -o - | FileCheck %s
6 define void @test_sub_i1() { ret void}
8 define i32 @test_sub_i32(i32 %arg1, i32 %arg2) {
9 %ret = sub i32 %arg1, %arg2
18 regBankSelected: false
20 - { id: 0, class: _, preferred-register: '' }
21 - { id: 1, class: _, preferred-register: '' }
22 - { id: 2, class: _, preferred-register: '' }
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)
38 %1(s1) = G_TRUNC %0(s32)
40 %3:_(p0) = G_IMPLICIT_DEF
41 G_STORE %2, %3 :: (store 1)
48 regBankSelected: false
49 tracksRegLiveness: true
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
67 %2(s32) = G_SUB %0, %1