File: reduction_invalid_different_operators.ll

package info (click to toggle)
llvm-toolchain-13 1%3A13.0.1-11
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,418,840 kB
  • sloc: cpp: 5,290,826; ansic: 996,570; asm: 544,593; python: 188,212; objc: 72,027; lisp: 30,291; f90: 25,395; sh: 24,898; javascript: 9,780; pascal: 9,398; perl: 7,484; ml: 5,432; awk: 3,523; makefile: 2,913; xml: 953; cs: 573; fortran: 539
file content (50 lines) | stat: -rw-r--r-- 1,518 bytes parent folder | download | duplicates (7)
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
43
44
45
46
47
48
49
50
; RUN: opt %loadPolly -basic-aa -polly-scops -analyze < %s | FileCheck %s
;
; int f() {
;   int i, sum = 0, sth = 0;
;   for (i = 0; i < 1024; i++) {
;     sum += 5;
;     sth = sth + sth * sth + sth;
;     sum *= 5;
;   }
;   return sum + sth;
; }
;
; CHECK-NOT: Reduction Type: +
; CHECK-NOT: Reduction Type: *
target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"

define i32 @f() {
entry:
  %sum.0 = alloca i32
  %sth.0 = alloca i32
  br label %entry.split

entry.split:                                      ; preds = %entry
  store i32 0, i32* %sum.0
  store i32 0, i32* %sth.0
  br label %for.cond

for.cond:                                         ; preds = %for.cond, %entry.split
  %i.0 = phi i32 [ 0, %entry.split ], [ %inc, %for.cond ]
  %sth.0.reload = load i32, i32* %sth.0
  %sum.0.reload = load i32, i32* %sum.0
  %exitcond = icmp ne i32 %i.0, 1024
  %mul = mul nsw i32 %sth.0.reload, %sth.0.reload
  %add1 = add nsw i32 %sth.0.reload, %mul
  %tmp = mul i32 %sum.0.reload, 5
  store i32 %tmp, i32* %sum.0
  %sum.1.reload = load i32, i32* %sum.0
  %mul3 = add i32 %sum.1.reload, 25
  %add2 = add nsw i32 %add1, %sth.0.reload
  %inc = add nsw i32 %i.0, 1
  store i32 %mul3, i32* %sum.0
  store i32 %add2, i32* %sth.0
  br i1 %exitcond, label %for.cond, label %for.end

for.end:                                          ; preds = %for.cond
  %sum.0.reload.2 = load i32, i32* %sum.0
  %sth.0.reload.2 = load i32, i32* %sth.0
  %add4 = add nsw i32 %sum.0.reload.2, %sth.0.reload.2
  ret i32 %add4
}