File: reduction_invalid_different_operators.ll

package info (click to toggle)
swiftlang 6.1.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,791,604 kB
  • sloc: cpp: 9,901,740; ansic: 2,201,431; asm: 1,091,827; python: 308,252; objc: 82,166; f90: 80,126; lisp: 38,358; pascal: 25,559; sh: 20,429; ml: 5,058; perl: 4,745; makefile: 4,484; awk: 3,535; javascript: 3,018; xml: 918; fortran: 664; cs: 573; ruby: 396
file content (50 lines) | stat: -rw-r--r-- 1,560 bytes parent folder | download | duplicates (9)
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 %loadNPMPolly -aa-pipeline=basic-aa '-passes=print<polly-function-scops>' -disable-output < %s 2>&1 | 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, ptr %sum.0
  store i32 0, ptr %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, ptr %sth.0
  %sum.0.reload = load i32, ptr %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, ptr %sum.0
  %sum.1.reload = load i32, ptr %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, ptr %sum.0
  store i32 %add2, ptr %sth.0
  br i1 %exitcond, label %for.cond, label %for.end

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