File: strict-fadd-vf1.ll

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-proposed-updates
  • size: 1,998,492 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (42 lines) | stat: -rw-r--r-- 1,762 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
; REQUIRES: asserts
; RUN: opt -passes=loop-vectorize -force-ordered-reductions=true -force-vector-width=1 -S < %s -debug 2> %t.debug | FileCheck %s
; RUN: cat %t.debug | FileCheck %s --check-prefix=CHECK-DEBUG

target triple = "aarch64-unknown-linux-gnu"

; CHECK-DEBUG: LV: Not interleaving scalar ordered reductions.

define void @foo(ptr noalias nocapture %dst, ptr noalias nocapture readonly %src, i64 %M, i64 %N) {
; CHECK-LABEL: @foo(
; CHECK-NOT: vector.body

entry:
  br label %for.body.us

for.body.us:                                      ; preds = %entry, %for.cond3
  %i.023.us = phi i64 [ %inc8.us, %for.cond3 ], [ 0, %entry ]
  %arrayidx.us = getelementptr inbounds float, ptr %dst, i64 %i.023.us
  %mul.us = mul nsw i64 %i.023.us, %N
  br label %for.body3.us

for.body3.us:                                     ; preds = %for.body.us, %for.body3.us
  %0 = phi float [ 0.000000e+00, %for.body.us ], [ %add6.us, %for.body3.us ]
  %j.021.us = phi i64 [ 0, %for.body.us ], [ %inc.us, %for.body3.us ]
  %add.us = add nsw i64 %j.021.us, %mul.us
  %arrayidx4.us = getelementptr inbounds float, ptr %src, i64 %add.us
  %1 = load float, ptr %arrayidx4.us, align 4
  %add6.us = fadd float %1, %0
  %inc.us = add nuw nsw i64 %j.021.us, 1
  %exitcond.not = icmp eq i64 %inc.us, %N
  br i1 %exitcond.not, label %for.cond3, label %for.body3.us

for.cond3:                                        ; preds = %for.body3.us
  %add6.us.lcssa = phi float [ %add6.us, %for.body3.us ]
  store float %add6.us.lcssa, ptr %arrayidx.us, align 4
  %inc8.us = add nuw nsw i64 %i.023.us, 1
  %exitcond26.not = icmp eq i64 %inc8.us, %M
  br i1 %exitcond26.not, label %exit, label %for.body.us

exit:                                             ; preds = %for.cond3
  ret void
}