• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -mtriple=arm-arm-eabi -mcpu=cortex-m33 < %s -arm-parallel-dsp -S | FileCheck %s
2;
3; The loop header is not the loop latch.
4;
5; CHECK-NOT:  call i32 @llvm.arm.smlad
6;
7define dso_local i32 @test(i32 %arg, i32* nocapture readnone %arg1, i16* nocapture readonly %arg2, i16* nocapture readonly %arg3) {
8entry:
9  %cmp24 = icmp sgt i32 %arg, 0
10  br i1 %cmp24, label %for.body.preheader, label %for.cond.cleanup
11
12for.body.preheader:
13  %.pre = load i16, i16* %arg3, align 2
14  %.pre27 = load i16, i16* %arg2, align 2
15  br label %for.body
16
17for.cond.cleanup:
18  %mac1.0.lcssa = phi i32 [ 0, %entry ], [ %add11, %for.body ]
19  ret i32 %mac1.0.lcssa
20
21; This is the loop header:
22for.body:
23  %mac1.026 = phi i32 [ %add11, %for.body2 ], [ 0, %for.body.preheader ]
24  %i.025 = phi i32 [ %add, %for.body2 ], [ 0, %for.body.preheader ]
25  %arrayidx = getelementptr inbounds i16, i16* %arg3, i32 %i.025
26  %0 = load i16, i16* %arrayidx, align 2
27  %add = add nuw nsw i32 %i.025, 1
28  %arrayidx1 = getelementptr inbounds i16, i16* %arg3, i32 %add
29  %1 = load i16, i16* %arrayidx1, align 2
30  %arrayidx3 = getelementptr inbounds i16, i16* %arg2, i32 %i.025
31  %2 = load i16, i16* %arrayidx3, align 2
32  %conv = sext i16 %2 to i32
33  %conv4 = sext i16 %0 to i32
34  %mul = mul nsw i32 %conv, %conv4
35  %arrayidx6 = getelementptr inbounds i16, i16* %arg2, i32 %add
36  %3 = load i16, i16* %arrayidx6, align 2
37  %conv7 = sext i16 %3 to i32
38  %conv8 = sext i16 %1 to i32
39  %mul9 = mul nsw i32 %conv7, %conv8
40  %add10 = add i32 %mul, %mac1.026
41  %add11 = add i32 %mul9, %add10
42  %exitcond = icmp ne i32 %add, %arg
43  br i1 %exitcond, label %for.body2, label %for.cond.cleanup
44
45; And this is the loop latch:
46for.body2:
47  br label %for.body
48}
49