185 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py2; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu -global-isel -verify-machineinstrs -stop-after=irtranslator < %s | FileCheck %s3 4%struct.A = type { i8, float, i32, i32, i32 }5 6define void @f() {7 ; CHECK-LABEL: name: f8 ; CHECK: bb.1 (%ir-block.0):9 ; CHECK: BLR8 implicit $lr8, implicit $rm10 ret void11}12 13define void @foo1(i32 %x){14 ; CHECK-LABEL: name: foo115 ; CHECK: bb.1 (%ir-block.0):16 ; CHECK: liveins: $x317 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x318 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)19 ; CHECK: BLR8 implicit $lr8, implicit $rm20 ret void21}22 23define void @foo2(i64 %x){24 ; CHECK-LABEL: name: foo225 ; CHECK: bb.1 (%ir-block.0):26 ; CHECK: liveins: $x327 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x328 ; CHECK: BLR8 implicit $lr8, implicit $rm29 ret void30}31 32define void @foo3(<7 x i8> %x) {33 ; CHECK-LABEL: name: foo334 ; CHECK: bb.1 (%ir-block.0):35 ; CHECK: liveins: $x3, $x4, $x5, $x6, $x7, $x8, $x936 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x337 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x438 ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $x539 ; CHECK: [[COPY3:%[0-9]+]]:_(s64) = COPY $x640 ; CHECK: [[COPY4:%[0-9]+]]:_(s64) = COPY $x741 ; CHECK: [[COPY5:%[0-9]+]]:_(s64) = COPY $x842 ; CHECK: [[COPY6:%[0-9]+]]:_(s64) = COPY $x943 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<7 x s64>) = G_BUILD_VECTOR [[COPY]](s64), [[COPY1]](s64), [[COPY2]](s64), [[COPY3]](s64), [[COPY4]](s64), [[COPY5]](s64), [[COPY6]](s64)44 ; CHECK: [[TRUNC7:%[0-9]+]]:_(<7 x s8>) = G_TRUNC [[BUILD_VECTOR]](<7 x s64>)45 ; CHECK: BLR8 implicit $lr8, implicit $rm46 ret void47}48 49 50 51define void @foo_notrunc(<7 x i64> %x) {52 ; CHECK-LABEL: name: foo_notrunc53 ; CHECK: bb.1 (%ir-block.0):54 ; CHECK: liveins: $x3, $x4, $x5, $x6, $x7, $x8, $x955 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x356 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x457 ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $x558 ; CHECK: [[COPY3:%[0-9]+]]:_(s64) = COPY $x659 ; CHECK: [[COPY4:%[0-9]+]]:_(s64) = COPY $x760 ; CHECK: [[COPY5:%[0-9]+]]:_(s64) = COPY $x861 ; CHECK: [[COPY6:%[0-9]+]]:_(s64) = COPY $x962 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<7 x s64>) = G_BUILD_VECTOR [[COPY]](s64), [[COPY1]](s64), [[COPY2]](s64), [[COPY3]](s64), [[COPY4]](s64), [[COPY5]](s64), [[COPY6]](s64)63 ; CHECK: BLR8 implicit $lr8, implicit $rm64 ret void65}66 67define void @foo_pt(ptr %x) {68 ; CHECK-LABEL: name: foo_pt69 ; CHECK: bb.1 (%ir-block.0):70 ; CHECK: liveins: $x371 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x372 ; CHECK: BLR8 implicit $lr8, implicit $rm73 ret void74}75 76; TODO: The correct registers used to pass struct arguments in this example77; are R3, R4 and R5. Currently, the calling convention used for GlobalISel78; does not handle passing structs and will need to implemented at a later time.79define dso_local void @foo_struct(%struct.A %a) #0 {80 ; CHECK-LABEL: name: foo_struct81 ; CHECK: bb.1.entry:82 ; CHECK: liveins: $f1, $x3, $x5, $x6, $x783 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x384 ; CHECK: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s64)85 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $f186 ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $x587 ; CHECK: [[TRUNC2:%[0-9]+]]:_(s32) = G_TRUNC [[COPY2]](s64)88 ; CHECK: [[COPY3:%[0-9]+]]:_(s64) = COPY $x689 ; CHECK: [[TRUNC3:%[0-9]+]]:_(s32) = G_TRUNC [[COPY3]](s64)90 ; CHECK: [[COPY4:%[0-9]+]]:_(s64) = COPY $x791 ; CHECK: [[TRUNC4:%[0-9]+]]:_(s32) = G_TRUNC [[COPY4]](s64)92 ; CHECK: BLR8 implicit $lr8, implicit $rm93entry:94 ret void95}96 97define void @foo_int(ptr %x) {98 ; CHECK-LABEL: name: foo_int99 ; CHECK: bb.1 (%ir-block.0):100 ; CHECK: liveins: $x3101 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x3102 ; CHECK: BLR8 implicit $lr8, implicit $rm103 ret void104}105 106define void @foo(ptr %x) {107 ; CHECK-LABEL: name: foo108 ; CHECK: bb.1 (%ir-block.0):109 ; CHECK: liveins: $x3110 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x3111 ; CHECK: BLR8 implicit $lr8, implicit $rm112 ret void113}114 115define void @foo_multiple(i1 %a, i8 %b, i16 %c, i32 %d, i64 %e, i128 %f){116 ; CHECK-LABEL: name: foo_multiple117 ; CHECK: bb.1 (%ir-block.0):118 ; CHECK: liveins: $x3, $x4, $x5, $x6, $x7, $x8, $x9119 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x3120 ; CHECK: [[TRUNC:%[0-9]+]]:_(s1) = G_TRUNC [[COPY]](s64)121 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x4122 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[COPY1]](s64)123 ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $x5124 ; CHECK: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[COPY2]](s64)125 ; CHECK: [[COPY3:%[0-9]+]]:_(s64) = COPY $x6126 ; CHECK: [[TRUNC3:%[0-9]+]]:_(s32) = G_TRUNC [[COPY3]](s64)127 ; CHECK: [[COPY4:%[0-9]+]]:_(s64) = COPY $x7128 ; CHECK: [[COPY5:%[0-9]+]]:_(s64) = COPY $x8129 ; CHECK: [[COPY6:%[0-9]+]]:_(s64) = COPY $x9130 ; CHECK: [[MV:%[0-9]+]]:_(s128) = G_MERGE_VALUES [[COPY5]](s64), [[COPY6]](s64)131 ; CHECK: BLR8 implicit $lr8, implicit $rm132 ret void133}134 135define void @foo_multiple_same_ty(i64 %x, i64 %y, i64 %z){136 ; CHECK-LABEL: name: foo_multiple_same_ty137 ; CHECK: bb.1 (%ir-block.0):138 ; CHECK: liveins: $x3, $x4, $x5139 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x3140 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x4141 ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $x5142 ; CHECK: BLR8 implicit $lr8, implicit $rm143 ret void144}145 146define void @foo_float(float %x) {147 ; CHECK-LABEL: name: foo_float148 ; CHECK: bb.1 (%ir-block.0):149 ; CHECK: liveins: $f1150 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $f1151 ; CHECK: BLR8 implicit $lr8, implicit $rm152 ret void153}154 155define void @foo_dbl(double %x) {156 ; CHECK-LABEL: name: foo_dbl157 ; CHECK: bb.1 (%ir-block.0):158 ; CHECK: liveins: $f1159 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $f1160 ; CHECK: BLR8 implicit $lr8, implicit $rm161 ret void162}163 164define void @foo_array([7 x i8] %x) {165 ; CHECK-LABEL: name: foo_array166 ; CHECK: bb.1 (%ir-block.0):167 ; CHECK: liveins: $x3, $x4, $x5, $x6, $x7, $x8, $x9168 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x3169 ; CHECK: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s64)170 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x4171 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[COPY1]](s64)172 ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $x5173 ; CHECK: [[TRUNC2:%[0-9]+]]:_(s8) = G_TRUNC [[COPY2]](s64)174 ; CHECK: [[COPY3:%[0-9]+]]:_(s64) = COPY $x6175 ; CHECK: [[TRUNC3:%[0-9]+]]:_(s8) = G_TRUNC [[COPY3]](s64)176 ; CHECK: [[COPY4:%[0-9]+]]:_(s64) = COPY $x7177 ; CHECK: [[TRUNC4:%[0-9]+]]:_(s8) = G_TRUNC [[COPY4]](s64)178 ; CHECK: [[COPY5:%[0-9]+]]:_(s64) = COPY $x8179 ; CHECK: [[TRUNC5:%[0-9]+]]:_(s8) = G_TRUNC [[COPY5]](s64)180 ; CHECK: [[COPY6:%[0-9]+]]:_(s64) = COPY $x9181 ; CHECK: [[TRUNC6:%[0-9]+]]:_(s8) = G_TRUNC [[COPY6]](s64)182 ; CHECK: BLR8 implicit $lr8, implicit $rm183 ret void184}185