1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -mtriple=i386-linux-gnu -run-pass=legalizer %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X32
3 # RUN: llc -O0 -mtriple=x86_64-linux-gnu -run-pass=legalizer %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X64
5 define void @trunc_check() {
19 ; X32-LABEL: name: trunc_check
20 ; X32: [[DEF:%[0-9]+]]:_(s32) = IMPLICIT_DEF
21 ; X32: [[DEF1:%[0-9]+]]:_(p0) = G_IMPLICIT_DEF
22 ; X32: [[C:%[0-9]+]]:_(s8) = G_CONSTANT i8 1
23 ; X32: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[DEF]](s32)
24 ; X32: [[AND:%[0-9]+]]:_(s8) = G_AND [[TRUNC]], [[C]]
25 ; X32: G_STORE [[AND]](s8), [[DEF1]](p0) :: (store 1)
26 ; X32: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[DEF]](s32)
27 ; X32: G_STORE [[TRUNC1]](s8), [[DEF1]](p0) :: (store 1)
28 ; X32: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[DEF]](s32)
29 ; X32: G_STORE [[TRUNC2]](s16), [[DEF1]](p0) :: (store 2)
31 ; X64-LABEL: name: trunc_check
32 ; X64: [[DEF:%[0-9]+]]:_(s32) = IMPLICIT_DEF
33 ; X64: [[DEF1:%[0-9]+]]:_(p0) = G_IMPLICIT_DEF
34 ; X64: [[C:%[0-9]+]]:_(s8) = G_CONSTANT i8 1
35 ; X64: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[DEF]](s32)
36 ; X64: [[AND:%[0-9]+]]:_(s8) = G_AND [[TRUNC]], [[C]]
37 ; X64: G_STORE [[AND]](s8), [[DEF1]](p0) :: (store 1)
38 ; X64: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[DEF]](s32)
39 ; X64: G_STORE [[TRUNC1]](s8), [[DEF1]](p0) :: (store 1)
40 ; X64: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[DEF]](s32)
41 ; X64: G_STORE [[TRUNC2]](s16), [[DEF1]](p0) :: (store 2)
43 %0(s32) = IMPLICIT_DEF
44 %1(s1) = G_TRUNC %0(s32)
45 %4:_(p0) = G_IMPLICIT_DEF
46 G_STORE %1, %4 :: (store 1)
48 %2(s8) = G_TRUNC %0(s32)
49 G_STORE %2, %4 :: (store 1)
51 %3(s16) = G_TRUNC %0(s32)
52 G_STORE %3, %4 :: (store 2)