brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · a3acef4 Raw
59 lines · plain
1; RUN: opt -mtriple=armv8m.main-none-none-eabi -mattr=+dsp < %s -arm-parallel-dsp -S | FileCheck %s2;3; Mul with operands that are not simple load and sext/zext chains: this is not4; yet supported so the rewrite shouldn't trigger (but we do want to support this5; soon).6;7; CHECK-NOT:  call i32 @llvm.arm.smlad8;9define dso_local i32 @test(i32 %arg, ptr nocapture readnone %arg1, ptr nocapture readonly %arg2, ptr nocapture readonly %arg3, ptr %arg4) {10entry:11  %cmp24 = icmp sgt i32 %arg, 012  br i1 %cmp24, label %for.body.preheader, label %for.cond.cleanup13 14for.body.preheader:15  %.pre = load i16, ptr %arg3, align 216  %.pre27 = load i16, ptr %arg2, align 217  %gep1 = getelementptr inbounds i16, ptr %arg4, i32 118  %.add4 = load i16, ptr %arg4, align 219  %.add5 = load i16, ptr %gep1, align 220  %.zext4 = zext i16 %.add4 to i3221  %.zext5 = zext i16 %.add5 to i3222  br label %for.body23 24for.cond.cleanup:25  %mac1.0.lcssa = phi i32 [ 0, %entry ], [ %add11, %for.body ]26  ret i32 %mac1.0.lcssa27 28for.body:29  %mac1.026 = phi i32 [ %add11, %for.body ], [ 0, %for.body.preheader ]30  %i.025 = phi i32 [ %add, %for.body ], [ 0, %for.body.preheader ]31  %arrayidx = getelementptr inbounds i16, ptr %arg3, i32 %i.02532  %0 = load i16, ptr %arrayidx, align 233  %add = add nuw nsw i32 %i.025, 134  %arrayidx1 = getelementptr inbounds i16, ptr %arg3, i32 %add35  %1 = load i16, ptr %arrayidx1, align 236  %arrayidx3 = getelementptr inbounds i16, ptr %arg2, i32 %i.02537  %2 = load i16, ptr %arrayidx3, align 238  %conv = sext i16 %2 to i3239  %conv4 = sext i16 %0 to i3240  %add1 = add i32 %conv, %.zext441 42; This mul has a more complicated pattern as an operand, %add143; is another add and load, which we don't support for now.44  %mul = mul nsw i32 %add1, %conv445  %arrayidx6 = getelementptr inbounds i16, ptr %arg2, i32 %add46  %3 = load i16, ptr %arrayidx6, align 247  %conv7 = sext i16 %3 to i3248  %conv8 = sext i16 %1 to i3249  %add2 = add i32 %conv7, %.zext550 51; Same here52  %mul9 = mul nsw i32 %add2, %conv853  %add10 = add i32 %mul, %mac1.02654 55  %add11 = add i32 %mul9, %add1056  %exitcond = icmp ne i32 %add, %arg57  br i1 %exitcond, label %for.body, label %for.cond.cleanup58}59