618 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -mtriple=thumbv8.1m.main-none-none-eabi -mattr=+mve.fp -verify-machineinstrs -tail-predication=enabled %s -o - | FileCheck %s3 4define arm_aapcs_vfpcc void @fmas1(ptr nocapture readonly %x, ptr nocapture readonly %y, ptr noalias nocapture %z, float %a, i32 %n) {5; CHECK-LABEL: fmas1:6; CHECK: @ %bb.0: @ %entry7; CHECK-NEXT: .save {r4, lr}8; CHECK-NEXT: push {r4, lr}9; CHECK-NEXT: cmp r3, #110; CHECK-NEXT: it lt11; CHECK-NEXT: poplt {r4, pc}12; CHECK-NEXT: .LBB0_1: @ %vector.ph13; CHECK-NEXT: vmov r12, s014; CHECK-NEXT: dlstp.32 lr, r315; CHECK-NEXT: .LBB0_2: @ %vector.body16; CHECK-NEXT: @ =>This Inner Loop Header: Depth=117; CHECK-NEXT: vldrw.u32 q0, [r1], #1618; CHECK-NEXT: vldrw.u32 q1, [r0], #1619; CHECK-NEXT: vfmas.f32 q1, q0, r1220; CHECK-NEXT: vstrw.32 q1, [r2], #1621; CHECK-NEXT: letp lr, .LBB0_222; CHECK-NEXT: @ %bb.3: @ %for.cond.cleanup23; CHECK-NEXT: pop {r4, pc}24entry:25 %cmp8 = icmp sgt i32 %n, 026 br i1 %cmp8, label %vector.ph, label %for.cond.cleanup27 28vector.ph: ; preds = %entry29 %n.rnd.up = add i32 %n, 330 %n.vec = and i32 %n.rnd.up, -431 %broadcast.splatinsert13 = insertelement <4 x float> undef, float %a, i32 032 %broadcast.splat14 = shufflevector <4 x float> %broadcast.splatinsert13, <4 x float> undef, <4 x i32> zeroinitializer33 br label %vector.body34 35vector.body: ; preds = %vector.body, %vector.ph36 %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]37 %0 = getelementptr inbounds float, ptr %x, i32 %index38 %1 = call <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32 %index, i32 %n)39 %wide.masked.load = call <4 x float> @llvm.masked.load.v4f32.p0(ptr %0, i32 4, <4 x i1> %1, <4 x float> undef)40 %2 = getelementptr inbounds float, ptr %y, i32 %index41 %wide.masked.load12 = call <4 x float> @llvm.masked.load.v4f32.p0(ptr %2, i32 4, <4 x i1> %1, <4 x float> undef)42 %3 = call fast <4 x float> @llvm.fma.v4f32(<4 x float> %wide.masked.load, <4 x float> %wide.masked.load12, <4 x float> %broadcast.splat14)43 %4 = getelementptr inbounds float, ptr %z, i32 %index44 call void @llvm.masked.store.v4f32.p0(<4 x float> %3, ptr %4, i32 4, <4 x i1> %1)45 %index.next = add i32 %index, 446 %5 = icmp eq i32 %index.next, %n.vec47 br i1 %5, label %for.cond.cleanup, label %vector.body48 49for.cond.cleanup: ; preds = %vector.body, %entry50 ret void51}52 53define arm_aapcs_vfpcc void @fmas2(ptr nocapture readonly %x, ptr nocapture readonly %y, ptr noalias nocapture %z, float %a, i32 %n) {54; CHECK-LABEL: fmas2:55; CHECK: @ %bb.0: @ %entry56; CHECK-NEXT: .save {r4, lr}57; CHECK-NEXT: push {r4, lr}58; CHECK-NEXT: cmp r3, #159; CHECK-NEXT: it lt60; CHECK-NEXT: poplt {r4, pc}61; CHECK-NEXT: .LBB1_1: @ %vector.ph62; CHECK-NEXT: vmov r12, s063; CHECK-NEXT: dlstp.32 lr, r364; CHECK-NEXT: .LBB1_2: @ %vector.body65; CHECK-NEXT: @ =>This Inner Loop Header: Depth=166; CHECK-NEXT: vldrw.u32 q0, [r0], #1667; CHECK-NEXT: vldrw.u32 q1, [r1], #1668; CHECK-NEXT: vfmas.f32 q1, q0, r1269; CHECK-NEXT: vstrw.32 q1, [r2], #1670; CHECK-NEXT: letp lr, .LBB1_271; CHECK-NEXT: @ %bb.3: @ %for.cond.cleanup72; CHECK-NEXT: pop {r4, pc}73entry:74 %cmp8 = icmp sgt i32 %n, 075 br i1 %cmp8, label %vector.ph, label %for.cond.cleanup76 77vector.ph: ; preds = %entry78 %n.rnd.up = add i32 %n, 379 %n.vec = and i32 %n.rnd.up, -480 %broadcast.splatinsert13 = insertelement <4 x float> undef, float %a, i32 081 %broadcast.splat14 = shufflevector <4 x float> %broadcast.splatinsert13, <4 x float> undef, <4 x i32> zeroinitializer82 br label %vector.body83 84vector.body: ; preds = %vector.body, %vector.ph85 %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]86 %0 = getelementptr inbounds float, ptr %x, i32 %index87 %1 = call <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32 %index, i32 %n)88 %wide.masked.load = call <4 x float> @llvm.masked.load.v4f32.p0(ptr %0, i32 4, <4 x i1> %1, <4 x float> undef)89 %2 = getelementptr inbounds float, ptr %y, i32 %index90 %wide.masked.load12 = call <4 x float> @llvm.masked.load.v4f32.p0(ptr %2, i32 4, <4 x i1> %1, <4 x float> undef)91 %3 = fmul fast <4 x float> %wide.masked.load12, %wide.masked.load92 %4 = fadd fast <4 x float> %3, %broadcast.splat1493 %5 = getelementptr inbounds float, ptr %z, i32 %index94 call void @llvm.masked.store.v4f32.p0(<4 x float> %4, ptr %5, i32 4, <4 x i1> %1)95 %index.next = add i32 %index, 496 %6 = icmp eq i32 %index.next, %n.vec97 br i1 %6, label %for.cond.cleanup, label %vector.body98 99for.cond.cleanup: ; preds = %vector.body, %entry100 ret void101}102 103define arm_aapcs_vfpcc void @fma1(ptr nocapture readonly %x, ptr nocapture readonly %y, ptr noalias nocapture %z, float %a, i32 %n) {104; CHECK-LABEL: fma1:105; CHECK: @ %bb.0: @ %entry106; CHECK-NEXT: .save {r4, lr}107; CHECK-NEXT: push {r4, lr}108; CHECK-NEXT: cmp r3, #1109; CHECK-NEXT: it lt110; CHECK-NEXT: poplt {r4, pc}111; CHECK-NEXT: .LBB2_1: @ %vector.ph112; CHECK-NEXT: vmov r12, s0113; CHECK-NEXT: dlstp.32 lr, r3114; CHECK-NEXT: .LBB2_2: @ %vector.body115; CHECK-NEXT: @ =>This Inner Loop Header: Depth=1116; CHECK-NEXT: vldrw.u32 q0, [r0], #16117; CHECK-NEXT: vldrw.u32 q1, [r1], #16118; CHECK-NEXT: vfma.f32 q1, q0, r12119; CHECK-NEXT: vstrw.32 q1, [r2], #16120; CHECK-NEXT: letp lr, .LBB2_2121; CHECK-NEXT: @ %bb.3: @ %for.cond.cleanup122; CHECK-NEXT: pop {r4, pc}123entry:124 %cmp8 = icmp sgt i32 %n, 0125 br i1 %cmp8, label %vector.ph, label %for.cond.cleanup126 127vector.ph: ; preds = %entry128 %n.rnd.up = add i32 %n, 3129 %n.vec = and i32 %n.rnd.up, -4130 %broadcast.splatinsert13 = insertelement <4 x float> undef, float %a, i32 0131 %broadcast.splat14 = shufflevector <4 x float> %broadcast.splatinsert13, <4 x float> undef, <4 x i32> zeroinitializer132 br label %vector.body133 134vector.body: ; preds = %vector.body, %vector.ph135 %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]136 %0 = getelementptr inbounds float, ptr %x, i32 %index137 %1 = call <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32 %index, i32 %n)138 %wide.masked.load = call <4 x float> @llvm.masked.load.v4f32.p0(ptr %0, i32 4, <4 x i1> %1, <4 x float> undef)139 %2 = getelementptr inbounds float, ptr %y, i32 %index140 %wide.masked.load12 = call <4 x float> @llvm.masked.load.v4f32.p0(ptr %2, i32 4, <4 x i1> %1, <4 x float> undef)141 %3 = call fast <4 x float> @llvm.fma.v4f32(<4 x float> %wide.masked.load, <4 x float> %broadcast.splat14, <4 x float> %wide.masked.load12)142 %4 = getelementptr inbounds float, ptr %z, i32 %index143 call void @llvm.masked.store.v4f32.p0(<4 x float> %3, ptr %4, i32 4, <4 x i1> %1)144 %index.next = add i32 %index, 4145 %5 = icmp eq i32 %index.next, %n.vec146 br i1 %5, label %for.cond.cleanup, label %vector.body147 148for.cond.cleanup: ; preds = %vector.body, %entry149 ret void150}151 152define arm_aapcs_vfpcc void @fma2(ptr nocapture readonly %x, ptr nocapture readonly %y, ptr noalias nocapture %z, float %a, i32 %n) {153; CHECK-LABEL: fma2:154; CHECK: @ %bb.0: @ %entry155; CHECK-NEXT: .save {r4, lr}156; CHECK-NEXT: push {r4, lr}157; CHECK-NEXT: cmp r3, #1158; CHECK-NEXT: it lt159; CHECK-NEXT: poplt {r4, pc}160; CHECK-NEXT: .LBB3_1: @ %vector.ph161; CHECK-NEXT: vmov r12, s0162; CHECK-NEXT: dlstp.32 lr, r3163; CHECK-NEXT: .LBB3_2: @ %vector.body164; CHECK-NEXT: @ =>This Inner Loop Header: Depth=1165; CHECK-NEXT: vldrw.u32 q0, [r0], #16166; CHECK-NEXT: vldrw.u32 q1, [r1], #16167; CHECK-NEXT: vfma.f32 q1, q0, r12168; CHECK-NEXT: vstrw.32 q1, [r2], #16169; CHECK-NEXT: letp lr, .LBB3_2170; CHECK-NEXT: @ %bb.3: @ %for.cond.cleanup171; CHECK-NEXT: pop {r4, pc}172entry:173 %cmp8 = icmp sgt i32 %n, 0174 br i1 %cmp8, label %vector.ph, label %for.cond.cleanup175 176vector.ph: ; preds = %entry177 %n.rnd.up = add i32 %n, 3178 %n.vec = and i32 %n.rnd.up, -4179 %broadcast.splatinsert12 = insertelement <4 x float> undef, float %a, i32 0180 %broadcast.splat13 = shufflevector <4 x float> %broadcast.splatinsert12, <4 x float> undef, <4 x i32> zeroinitializer181 br label %vector.body182 183vector.body: ; preds = %vector.body, %vector.ph184 %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]185 %0 = getelementptr inbounds float, ptr %x, i32 %index186 %1 = call <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32 %index, i32 %n)187 %wide.masked.load = call <4 x float> @llvm.masked.load.v4f32.p0(ptr %0, i32 4, <4 x i1> %1, <4 x float> undef)188 %2 = fmul fast <4 x float> %wide.masked.load, %broadcast.splat13189 %3 = getelementptr inbounds float, ptr %y, i32 %index190 %wide.masked.load14 = call <4 x float> @llvm.masked.load.v4f32.p0(ptr %3, i32 4, <4 x i1> %1, <4 x float> undef)191 %4 = fadd fast <4 x float> %2, %wide.masked.load14192 %5 = getelementptr inbounds float, ptr %z, i32 %index193 call void @llvm.masked.store.v4f32.p0(<4 x float> %4, ptr %5, i32 4, <4 x i1> %1)194 %index.next = add i32 %index, 4195 %6 = icmp eq i32 %index.next, %n.vec196 br i1 %6, label %for.cond.cleanup, label %vector.body197 198for.cond.cleanup: ; preds = %vector.body, %entry199 ret void200}201 202define arm_aapcs_vfpcc void @fmss1(ptr nocapture readonly %x, ptr nocapture readonly %y, ptr noalias nocapture %z, float %a, i32 %n) {203; CHECK-LABEL: fmss1:204; CHECK: @ %bb.0: @ %entry205; CHECK-NEXT: .save {r4, lr}206; CHECK-NEXT: push {r4, lr}207; CHECK-NEXT: cmp r3, #1208; CHECK-NEXT: it lt209; CHECK-NEXT: poplt {r4, pc}210; CHECK-NEXT: .LBB4_1: @ %vector.ph211; CHECK-NEXT: vmov r12, s0212; CHECK-NEXT: eor r12, r12, #-2147483648213; CHECK-NEXT: dlstp.32 lr, r3214; CHECK-NEXT: .LBB4_2: @ %vector.body215; CHECK-NEXT: @ =>This Inner Loop Header: Depth=1216; CHECK-NEXT: vldrw.u32 q0, [r1], #16217; CHECK-NEXT: vldrw.u32 q1, [r0], #16218; CHECK-NEXT: vfmas.f32 q1, q0, r12219; CHECK-NEXT: vstrw.32 q1, [r2], #16220; CHECK-NEXT: letp lr, .LBB4_2221; CHECK-NEXT: @ %bb.3: @ %for.cond.cleanup222; CHECK-NEXT: pop {r4, pc}223entry:224 %cmp8 = icmp sgt i32 %n, 0225 br i1 %cmp8, label %vector.ph, label %for.cond.cleanup226 227vector.ph: ; preds = %entry228 %fneg = fneg fast float %a229 %n.rnd.up = add i32 %n, 3230 %n.vec = and i32 %n.rnd.up, -4231 %broadcast.splatinsert13 = insertelement <4 x float> undef, float %fneg, i32 0232 %broadcast.splat14 = shufflevector <4 x float> %broadcast.splatinsert13, <4 x float> undef, <4 x i32> zeroinitializer233 br label %vector.body234 235vector.body: ; preds = %vector.body, %vector.ph236 %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]237 %0 = getelementptr inbounds float, ptr %x, i32 %index238 %1 = call <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32 %index, i32 %n)239 %wide.masked.load = call <4 x float> @llvm.masked.load.v4f32.p0(ptr %0, i32 4, <4 x i1> %1, <4 x float> undef)240 %2 = getelementptr inbounds float, ptr %y, i32 %index241 %wide.masked.load12 = call <4 x float> @llvm.masked.load.v4f32.p0(ptr %2, i32 4, <4 x i1> %1, <4 x float> undef)242 %3 = call fast <4 x float> @llvm.fma.v4f32(<4 x float> %wide.masked.load, <4 x float> %wide.masked.load12, <4 x float> %broadcast.splat14)243 %4 = getelementptr inbounds float, ptr %z, i32 %index244 call void @llvm.masked.store.v4f32.p0(<4 x float> %3, ptr %4, i32 4, <4 x i1> %1)245 %index.next = add i32 %index, 4246 %5 = icmp eq i32 %index.next, %n.vec247 br i1 %5, label %for.cond.cleanup, label %vector.body248 249for.cond.cleanup: ; preds = %vector.body, %entry250 ret void251}252 253define arm_aapcs_vfpcc void @fmss2(ptr nocapture readonly %x, ptr nocapture readonly %y, ptr noalias nocapture %z, float %a, i32 %n) {254; CHECK-LABEL: fmss2:255; CHECK: @ %bb.0: @ %entry256; CHECK-NEXT: .save {r4, lr}257; CHECK-NEXT: push {r4, lr}258; CHECK-NEXT: cmp r3, #1259; CHECK-NEXT: it lt260; CHECK-NEXT: poplt {r4, pc}261; CHECK-NEXT: .LBB5_1: @ %vector.ph262; CHECK-NEXT: vmov r12, s0263; CHECK-NEXT: vdup.32 q0, r12264; CHECK-NEXT: vneg.f32 q0, q0265; CHECK-NEXT: dlstp.32 lr, r3266; CHECK-NEXT: .LBB5_2: @ %vector.body267; CHECK-NEXT: @ =>This Inner Loop Header: Depth=1268; CHECK-NEXT: vmov q3, q0269; CHECK-NEXT: vldrw.u32 q1, [r0], #16270; CHECK-NEXT: vldrw.u32 q2, [r1], #16271; CHECK-NEXT: vfma.f32 q3, q2, q1272; CHECK-NEXT: vstrw.32 q3, [r2], #16273; CHECK-NEXT: letp lr, .LBB5_2274; CHECK-NEXT: @ %bb.3: @ %for.cond.cleanup275; CHECK-NEXT: pop {r4, pc}276entry:277 %cmp8 = icmp sgt i32 %n, 0278 br i1 %cmp8, label %vector.ph, label %for.cond.cleanup279 280vector.ph: ; preds = %entry281 %n.rnd.up = add i32 %n, 3282 %n.vec = and i32 %n.rnd.up, -4283 %broadcast.splatinsert13 = insertelement <4 x float> undef, float %a, i32 0284 %broadcast.splat14 = shufflevector <4 x float> %broadcast.splatinsert13, <4 x float> undef, <4 x i32> zeroinitializer285 br label %vector.body286 287vector.body: ; preds = %vector.body, %vector.ph288 %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]289 %0 = getelementptr inbounds float, ptr %x, i32 %index290 %1 = call <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32 %index, i32 %n)291 %wide.masked.load = call <4 x float> @llvm.masked.load.v4f32.p0(ptr %0, i32 4, <4 x i1> %1, <4 x float> undef)292 %2 = getelementptr inbounds float, ptr %y, i32 %index293 %wide.masked.load12 = call <4 x float> @llvm.masked.load.v4f32.p0(ptr %2, i32 4, <4 x i1> %1, <4 x float> undef)294 %3 = fmul fast <4 x float> %wide.masked.load12, %wide.masked.load295 %4 = fsub fast <4 x float> %3, %broadcast.splat14296 %5 = getelementptr inbounds float, ptr %z, i32 %index297 call void @llvm.masked.store.v4f32.p0(<4 x float> %4, ptr %5, i32 4, <4 x i1> %1)298 %index.next = add i32 %index, 4299 %6 = icmp eq i32 %index.next, %n.vec300 br i1 %6, label %for.cond.cleanup, label %vector.body301 302for.cond.cleanup: ; preds = %vector.body, %entry303 ret void304}305 306define arm_aapcs_vfpcc void @fmss3(ptr nocapture readonly %x, ptr nocapture readonly %y, ptr noalias nocapture %z, float %a, i32 %n) {307; CHECK-LABEL: fmss3:308; CHECK: @ %bb.0: @ %entry309; CHECK-NEXT: .save {r4, lr}310; CHECK-NEXT: push {r4, lr}311; CHECK-NEXT: cmp r3, #1312; CHECK-NEXT: it lt313; CHECK-NEXT: poplt {r4, pc}314; CHECK-NEXT: .LBB6_1: @ %vector.ph315; CHECK-NEXT: vmov r4, s0316; CHECK-NEXT: vdup.32 q0, r4317; CHECK-NEXT: dlstp.32 lr, r3318; CHECK-NEXT: .LBB6_2: @ %vector.body319; CHECK-NEXT: @ =>This Inner Loop Header: Depth=1320; CHECK-NEXT: vmov q3, q0321; CHECK-NEXT: vldrw.u32 q1, [r0], #16322; CHECK-NEXT: vldrw.u32 q2, [r1], #16323; CHECK-NEXT: vfms.f32 q3, q2, q1324; CHECK-NEXT: vstrw.32 q3, [r2], #16325; CHECK-NEXT: letp lr, .LBB6_2326; CHECK-NEXT: @ %bb.3: @ %for.cond.cleanup327; CHECK-NEXT: pop {r4, pc}328entry:329 %cmp8 = icmp sgt i32 %n, 0330 br i1 %cmp8, label %vector.ph, label %for.cond.cleanup331 332vector.ph: ; preds = %entry333 %n.rnd.up = add i32 %n, 3334 %n.vec = and i32 %n.rnd.up, -4335 %broadcast.splatinsert13 = insertelement <4 x float> undef, float %a, i32 0336 %broadcast.splat14 = shufflevector <4 x float> %broadcast.splatinsert13, <4 x float> undef, <4 x i32> zeroinitializer337 br label %vector.body338 339vector.body: ; preds = %vector.body, %vector.ph340 %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]341 %0 = getelementptr inbounds float, ptr %x, i32 %index342 %1 = call <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32 %index, i32 %n)343 %wide.masked.load = call <4 x float> @llvm.masked.load.v4f32.p0(ptr %0, i32 4, <4 x i1> %1, <4 x float> undef)344 %2 = getelementptr inbounds float, ptr %y, i32 %index345 %wide.masked.load12 = call <4 x float> @llvm.masked.load.v4f32.p0(ptr %2, i32 4, <4 x i1> %1, <4 x float> undef)346 %3 = fneg fast <4 x float> %wide.masked.load12347 %4 = call fast <4 x float> @llvm.fma.v4f32(<4 x float> %wide.masked.load, <4 x float> %3, <4 x float> %broadcast.splat14)348 %5 = getelementptr inbounds float, ptr %z, i32 %index349 call void @llvm.masked.store.v4f32.p0(<4 x float> %4, ptr %5, i32 4, <4 x i1> %1)350 %index.next = add i32 %index, 4351 %6 = icmp eq i32 %index.next, %n.vec352 br i1 %6, label %for.cond.cleanup, label %vector.body353 354for.cond.cleanup: ; preds = %vector.body, %entry355 ret void356}357 358define arm_aapcs_vfpcc void @fmss4(ptr nocapture readonly %x, ptr nocapture readonly %y, ptr noalias nocapture %z, float %a, i32 %n) {359; CHECK-LABEL: fmss4:360; CHECK: @ %bb.0: @ %entry361; CHECK-NEXT: .save {r4, lr}362; CHECK-NEXT: push {r4, lr}363; CHECK-NEXT: cmp r3, #1364; CHECK-NEXT: it lt365; CHECK-NEXT: poplt {r4, pc}366; CHECK-NEXT: .LBB7_1: @ %vector.ph367; CHECK-NEXT: vmov r4, s0368; CHECK-NEXT: vdup.32 q0, r4369; CHECK-NEXT: dlstp.32 lr, r3370; CHECK-NEXT: .LBB7_2: @ %vector.body371; CHECK-NEXT: @ =>This Inner Loop Header: Depth=1372; CHECK-NEXT: vmov q3, q0373; CHECK-NEXT: vldrw.u32 q1, [r0], #16374; CHECK-NEXT: vldrw.u32 q2, [r1], #16375; CHECK-NEXT: vfms.f32 q3, q2, q1376; CHECK-NEXT: vstrw.32 q3, [r2], #16377; CHECK-NEXT: letp lr, .LBB7_2378; CHECK-NEXT: @ %bb.3: @ %for.cond.cleanup379; CHECK-NEXT: pop {r4, pc}380entry:381 %cmp8 = icmp sgt i32 %n, 0382 br i1 %cmp8, label %vector.ph, label %for.cond.cleanup383 384vector.ph: ; preds = %entry385 %n.rnd.up = add i32 %n, 3386 %n.vec = and i32 %n.rnd.up, -4387 %broadcast.splatinsert13 = insertelement <4 x float> undef, float %a, i32 0388 %broadcast.splat14 = shufflevector <4 x float> %broadcast.splatinsert13, <4 x float> undef, <4 x i32> zeroinitializer389 br label %vector.body390 391vector.body: ; preds = %vector.body, %vector.ph392 %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]393 %0 = getelementptr inbounds float, ptr %x, i32 %index394 %1 = call <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32 %index, i32 %n)395 %wide.masked.load = call <4 x float> @llvm.masked.load.v4f32.p0(ptr %0, i32 4, <4 x i1> %1, <4 x float> undef)396 %2 = getelementptr inbounds float, ptr %y, i32 %index397 %wide.masked.load12 = call <4 x float> @llvm.masked.load.v4f32.p0(ptr %2, i32 4, <4 x i1> %1, <4 x float> undef)398 %3 = fmul fast <4 x float> %wide.masked.load12, %wide.masked.load399 %4 = fsub fast <4 x float> %broadcast.splat14, %3400 %5 = getelementptr inbounds float, ptr %z, i32 %index401 call void @llvm.masked.store.v4f32.p0(<4 x float> %4, ptr %5, i32 4, <4 x i1> %1)402 %index.next = add i32 %index, 4403 %6 = icmp eq i32 %index.next, %n.vec404 br i1 %6, label %for.cond.cleanup, label %vector.body405 406for.cond.cleanup: ; preds = %vector.body, %entry407 ret void408}409 410define arm_aapcs_vfpcc void @fms1(ptr nocapture readonly %x, ptr nocapture readonly %y, ptr noalias nocapture %z, float %a, i32 %n) {411; CHECK-LABEL: fms1:412; CHECK: @ %bb.0: @ %entry413; CHECK-NEXT: .save {r4, lr}414; CHECK-NEXT: push {r4, lr}415; CHECK-NEXT: cmp r3, #1416; CHECK-NEXT: it lt417; CHECK-NEXT: poplt {r4, pc}418; CHECK-NEXT: .LBB8_1: @ %vector.ph419; CHECK-NEXT: vmov r12, s0420; CHECK-NEXT: eor r12, r12, #-2147483648421; CHECK-NEXT: dlstp.32 lr, r3422; CHECK-NEXT: .LBB8_2: @ %vector.body423; CHECK-NEXT: @ =>This Inner Loop Header: Depth=1424; CHECK-NEXT: vldrw.u32 q0, [r0], #16425; CHECK-NEXT: vldrw.u32 q1, [r1], #16426; CHECK-NEXT: vfma.f32 q1, q0, r12427; CHECK-NEXT: vstrw.32 q1, [r2], #16428; CHECK-NEXT: letp lr, .LBB8_2429; CHECK-NEXT: @ %bb.3: @ %for.cond.cleanup430; CHECK-NEXT: pop {r4, pc}431entry:432 %cmp8 = icmp sgt i32 %n, 0433 br i1 %cmp8, label %vector.ph, label %for.cond.cleanup434 435vector.ph: ; preds = %entry436 %fneg = fneg fast float %a437 %n.rnd.up = add i32 %n, 3438 %n.vec = and i32 %n.rnd.up, -4439 %broadcast.splatinsert13 = insertelement <4 x float> undef, float %fneg, i32 0440 %broadcast.splat14 = shufflevector <4 x float> %broadcast.splatinsert13, <4 x float> undef, <4 x i32> zeroinitializer441 br label %vector.body442 443vector.body: ; preds = %vector.body, %vector.ph444 %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]445 %0 = getelementptr inbounds float, ptr %x, i32 %index446 %1 = call <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32 %index, i32 %n)447 %wide.masked.load = call <4 x float> @llvm.masked.load.v4f32.p0(ptr %0, i32 4, <4 x i1> %1, <4 x float> undef)448 %2 = getelementptr inbounds float, ptr %y, i32 %index449 %wide.masked.load12 = call <4 x float> @llvm.masked.load.v4f32.p0(ptr %2, i32 4, <4 x i1> %1, <4 x float> undef)450 %3 = call fast <4 x float> @llvm.fma.v4f32(<4 x float> %wide.masked.load, <4 x float> %broadcast.splat14, <4 x float> %wide.masked.load12)451 %4 = getelementptr inbounds float, ptr %z, i32 %index452 call void @llvm.masked.store.v4f32.p0(<4 x float> %3, ptr %4, i32 4, <4 x i1> %1)453 %index.next = add i32 %index, 4454 %5 = icmp eq i32 %index.next, %n.vec455 br i1 %5, label %for.cond.cleanup, label %vector.body456 457for.cond.cleanup: ; preds = %vector.body, %entry458 ret void459}460 461define arm_aapcs_vfpcc void @fms2(ptr nocapture readonly %x, ptr nocapture readonly %y, ptr noalias nocapture %z, float %a, i32 %n) {462; CHECK-LABEL: fms2:463; CHECK: @ %bb.0: @ %entry464; CHECK-NEXT: .save {r4, lr}465; CHECK-NEXT: push {r4, lr}466; CHECK-NEXT: cmp r3, #1467; CHECK-NEXT: it lt468; CHECK-NEXT: poplt {r4, pc}469; CHECK-NEXT: .LBB9_1: @ %vector.ph470; CHECK-NEXT: vmov r4, s0471; CHECK-NEXT: vdup.32 q0, r4472; CHECK-NEXT: dlstp.32 lr, r3473; CHECK-NEXT: .LBB9_2: @ %vector.body474; CHECK-NEXT: @ =>This Inner Loop Header: Depth=1475; CHECK-NEXT: vldrw.u32 q1, [r0], #16476; CHECK-NEXT: vldrw.u32 q2, [r1], #16477; CHECK-NEXT: vfms.f32 q2, q1, q0478; CHECK-NEXT: vstrw.32 q2, [r2], #16479; CHECK-NEXT: letp lr, .LBB9_2480; CHECK-NEXT: @ %bb.3: @ %for.cond.cleanup481; CHECK-NEXT: pop {r4, pc}482entry:483 %cmp8 = icmp sgt i32 %n, 0484 br i1 %cmp8, label %vector.ph, label %for.cond.cleanup485 486vector.ph: ; preds = %entry487 %n.rnd.up = add i32 %n, 3488 %n.vec = and i32 %n.rnd.up, -4489 %broadcast.splatinsert13 = insertelement <4 x float> undef, float %a, i32 0490 %broadcast.splat14 = shufflevector <4 x float> %broadcast.splatinsert13, <4 x float> undef, <4 x i32> zeroinitializer491 br label %vector.body492 493vector.body: ; preds = %vector.body, %vector.ph494 %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]495 %0 = getelementptr inbounds float, ptr %x, i32 %index496 %1 = call <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32 %index, i32 %n)497 %wide.masked.load = call <4 x float> @llvm.masked.load.v4f32.p0(ptr %0, i32 4, <4 x i1> %1, <4 x float> undef)498 %2 = getelementptr inbounds float, ptr %y, i32 %index499 %wide.masked.load12 = call <4 x float> @llvm.masked.load.v4f32.p0(ptr %2, i32 4, <4 x i1> %1, <4 x float> undef)500 %3 = fmul fast <4 x float> %wide.masked.load, %broadcast.splat14501 %4 = fsub fast <4 x float> %wide.masked.load12, %3502 %5 = getelementptr inbounds float, ptr %z, i32 %index503 call void @llvm.masked.store.v4f32.p0(<4 x float> %4, ptr %5, i32 4, <4 x i1> %1)504 %index.next = add i32 %index, 4505 %6 = icmp eq i32 %index.next, %n.vec506 br i1 %6, label %for.cond.cleanup, label %vector.body507 508for.cond.cleanup: ; preds = %vector.body, %entry509 ret void510}511 512define arm_aapcs_vfpcc void @fms3(ptr nocapture readonly %x, ptr nocapture readonly %y, ptr noalias nocapture %z, float %a, i32 %n) {513; CHECK-LABEL: fms3:514; CHECK: @ %bb.0: @ %entry515; CHECK-NEXT: .save {r4, lr}516; CHECK-NEXT: push {r4, lr}517; CHECK-NEXT: cmp r3, #1518; CHECK-NEXT: it lt519; CHECK-NEXT: poplt {r4, pc}520; CHECK-NEXT: .LBB10_1: @ %vector.ph521; CHECK-NEXT: vmov r12, s0522; CHECK-NEXT: dlstp.32 lr, r3523; CHECK-NEXT: .LBB10_2: @ %vector.body524; CHECK-NEXT: @ =>This Inner Loop Header: Depth=1525; CHECK-NEXT: vldrw.u32 q0, [r1], #16526; CHECK-NEXT: vldrw.u32 q1, [r0], #16527; CHECK-NEXT: vneg.f32 q0, q0528; CHECK-NEXT: vfma.f32 q0, q1, r12529; CHECK-NEXT: vstrw.32 q0, [r2], #16530; CHECK-NEXT: letp lr, .LBB10_2531; CHECK-NEXT: @ %bb.3: @ %for.cond.cleanup532; CHECK-NEXT: pop {r4, pc}533entry:534 %cmp8 = icmp sgt i32 %n, 0535 br i1 %cmp8, label %vector.ph, label %for.cond.cleanup536 537vector.ph: ; preds = %entry538 %n.rnd.up = add i32 %n, 3539 %n.vec = and i32 %n.rnd.up, -4540 %broadcast.splatinsert13 = insertelement <4 x float> undef, float %a, i32 0541 %broadcast.splat14 = shufflevector <4 x float> %broadcast.splatinsert13, <4 x float> undef, <4 x i32> zeroinitializer542 br label %vector.body543 544vector.body: ; preds = %vector.body, %vector.ph545 %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]546 %0 = getelementptr inbounds float, ptr %x, i32 %index547 %1 = call <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32 %index, i32 %n)548 %wide.masked.load = call <4 x float> @llvm.masked.load.v4f32.p0(ptr %0, i32 4, <4 x i1> %1, <4 x float> undef)549 %2 = getelementptr inbounds float, ptr %y, i32 %index550 %wide.masked.load12 = call <4 x float> @llvm.masked.load.v4f32.p0(ptr %2, i32 4, <4 x i1> %1, <4 x float> undef)551 %3 = fneg fast <4 x float> %wide.masked.load12552 %4 = call fast <4 x float> @llvm.fma.v4f32(<4 x float> %wide.masked.load, <4 x float> %broadcast.splat14, <4 x float> %3)553 %5 = getelementptr inbounds float, ptr %z, i32 %index554 call void @llvm.masked.store.v4f32.p0(<4 x float> %4, ptr %5, i32 4, <4 x i1> %1)555 %index.next = add i32 %index, 4556 %6 = icmp eq i32 %index.next, %n.vec557 br i1 %6, label %for.cond.cleanup, label %vector.body558 559for.cond.cleanup: ; preds = %vector.body, %entry560 ret void561}562 563define arm_aapcs_vfpcc void @fms4(ptr nocapture readonly %x, ptr nocapture readonly %y, ptr noalias nocapture %z, float %a, i32 %n) {564; CHECK-LABEL: fms4:565; CHECK: @ %bb.0: @ %entry566; CHECK-NEXT: .save {r4, lr}567; CHECK-NEXT: push {r4, lr}568; CHECK-NEXT: cmp r3, #1569; CHECK-NEXT: it lt570; CHECK-NEXT: poplt {r4, pc}571; CHECK-NEXT: .LBB11_1: @ %vector.ph572; CHECK-NEXT: vmov r12, s0573; CHECK-NEXT: dlstp.32 lr, r3574; CHECK-NEXT: .LBB11_2: @ %vector.body575; CHECK-NEXT: @ =>This Inner Loop Header: Depth=1576; CHECK-NEXT: vldrw.u32 q0, [r1], #16577; CHECK-NEXT: vldrw.u32 q1, [r0], #16578; CHECK-NEXT: vneg.f32 q0, q0579; CHECK-NEXT: vfma.f32 q0, q1, r12580; CHECK-NEXT: vstrw.32 q0, [r2], #16581; CHECK-NEXT: letp lr, .LBB11_2582; CHECK-NEXT: @ %bb.3: @ %for.cond.cleanup583; CHECK-NEXT: pop {r4, pc}584entry:585 %cmp8 = icmp sgt i32 %n, 0586 br i1 %cmp8, label %vector.ph, label %for.cond.cleanup587 588vector.ph: ; preds = %entry589 %n.rnd.up = add i32 %n, 3590 %n.vec = and i32 %n.rnd.up, -4591 %broadcast.splatinsert12 = insertelement <4 x float> undef, float %a, i32 0592 %broadcast.splat13 = shufflevector <4 x float> %broadcast.splatinsert12, <4 x float> undef, <4 x i32> zeroinitializer593 br label %vector.body594 595vector.body: ; preds = %vector.body, %vector.ph596 %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]597 %0 = getelementptr inbounds float, ptr %x, i32 %index598 %1 = call <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32 %index, i32 %n)599 %wide.masked.load = call <4 x float> @llvm.masked.load.v4f32.p0(ptr %0, i32 4, <4 x i1> %1, <4 x float> undef)600 %2 = fmul fast <4 x float> %wide.masked.load, %broadcast.splat13601 %3 = getelementptr inbounds float, ptr %y, i32 %index602 %wide.masked.load14 = call <4 x float> @llvm.masked.load.v4f32.p0(ptr %3, i32 4, <4 x i1> %1, <4 x float> undef)603 %4 = fsub fast <4 x float> %2, %wide.masked.load14604 %5 = getelementptr inbounds float, ptr %z, i32 %index605 call void @llvm.masked.store.v4f32.p0(<4 x float> %4, ptr %5, i32 4, <4 x i1> %1)606 %index.next = add i32 %index, 4607 %6 = icmp eq i32 %index.next, %n.vec608 br i1 %6, label %for.cond.cleanup, label %vector.body609 610for.cond.cleanup: ; preds = %vector.body, %entry611 ret void612}613 614declare <4 x float> @llvm.masked.load.v4f32.p0(ptr, i32 immarg, <4 x i1>, <4 x float>)615declare <4 x float> @llvm.fma.v4f32(<4 x float>, <4 x float>, <4 x float>)616declare void @llvm.masked.store.v4f32.p0(<4 x float>, ptr, i32 immarg, <4 x i1>)617declare <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32, i32)618