File: multi-use-reduction-bug.ll

package info (click to toggle)
llvm-toolchain-11 1%3A11.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 995,808 kB
  • sloc: cpp: 4,767,656; ansic: 760,916; asm: 477,436; python: 170,940; objc: 69,804; lisp: 29,914; sh: 23,855; f90: 18,173; pascal: 7,551; perl: 7,471; ml: 5,603; awk: 3,489; makefile: 2,573; xml: 915; cs: 573; fortran: 503; javascript: 452
file content (41 lines) | stat: -rw-r--r-- 1,216 bytes parent folder | download | duplicates (16)
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
; RUN: opt -indvars -loop-vectorize -force-vector-width=2 -force-vector-interleave=1 -S < %s | FileCheck %s

target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"

; We must not vectorize this loop. %add55 is not reduction. Its value is used
; multiple times.

; PR18526

; CHECK: multiple_use_of_value
; CHECK-NOT: <2 x i32>

define void @multiple_use_of_value() {
entry:
  %n = alloca i32, align 4
  %k7 = alloca i32, align 4
  %nf = alloca i32, align 4
  %0 = load i32, i32* %k7, align 4
  %.neg1 = sub i32 0, %0
  %n.promoted = load i32, i32* %n, align 4
  %nf.promoted = load i32, i32* %nf, align 4
  br label %for.body

for.body:
  %inc107 = phi i32 [ undef, %entry ], [ %inc10, %for.body ]
  %inc6 = phi i32 [ %nf.promoted, %entry ], [ undef, %for.body ]
  %add55 = phi i32 [ %n.promoted, %entry ], [ %add5, %for.body ]
  %.neg2 = sub i32 0, %inc6
  %add.neg = add i32 0, %add55
  %add4.neg = add i32 %add.neg, %.neg1
  %sub = add i32 %add4.neg, %.neg2
  %add5 = add i32 %sub, %add55
  %inc10 = add i32 %inc107, 1
  %cmp = icmp ult i32 %inc10, 61
  br i1 %cmp, label %for.body, label %for.end

for.end:
  %add5.lcssa = phi i32 [ %add5, %for.body ]
  store i32 %add5.lcssa, i32* %n, align 4
  ret void
}