[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / polly / test / IstAstInfo / reduction_different_reduction_clauses.ll
blob5104f716d8109342a64ee496734e27d6a14b7c5d
1 ; RUN: opt %loadPolly -basic-aa -polly-print-ast -polly-ast-detect-parallel -disable-output < %s | FileCheck %s
3 ; CHECK: #pragma simd reduction (+ : MemRef_sum{{[1,2]}}, MemRef_sum{{[1,2]}}) reduction (* : MemRef_prod) reduction (| : MemRef_or) reduction (& : MemRef_and)
4 ; CHECK: #pragma known-parallel reduction (+ : MemRef_sum{{[1,2]}}, MemRef_sum{{[1,2]}}) reduction (* : MemRef_prod) reduction (| : MemRef_or) reduction (& : MemRef_and)
5 ; CHECK: for (int c0 = 0; c0 < N; c0 += 1)
6 ; CHECK:   Stmt_for_body(c0);
8 ;    void f(int N, int *restrict sum1, int *restrict sum2, int *restrict prod,
9 ;           int *restrict and, int *restrict or ) {
10 ;      for (int i = 0; i < N; i++) {
11 ;        *sum1 += i;
12 ;        *sum2 += i + 1;
13 ;        *prod *= i;
14 ;        *and &= i;
15 ;        * or |= i;
16 ;      }
17 ;    }
19 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
21 define void @f(i32 %N, ptr noalias %sum1, ptr noalias %sum2, ptr noalias %prod, ptr noalias %and, ptr noalias %or) {
22 entry:
23   br label %for.cond
25 for.cond:                                         ; preds = %for.inc, %entry
26   %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
27   %cmp = icmp slt i32 %i.0, %N
28   br i1 %cmp, label %for.body, label %for.end
30 for.body:                                         ; preds = %for.cond
31   %tmp = load i32, ptr %sum1, align 4
32   %add = add nsw i32 %tmp, %i.0
33   store i32 %add, ptr %sum1, align 4
34   %add1 = add nsw i32 %i.0, 1
35   %tmp1 = load i32, ptr %sum2, align 4
36   %add2 = add nsw i32 %tmp1, %add1
37   store i32 %add2, ptr %sum2, align 4
38   %tmp2 = load i32, ptr %prod, align 4
39   %mul = mul nsw i32 %tmp2, %i.0
40   store i32 %mul, ptr %prod, align 4
41   %tmp3 = load i32, ptr %and, align 4
42   %and3 = and i32 %tmp3, %i.0
43   store i32 %and3, ptr %and, align 4
44   %tmp4 = load i32, ptr %or, align 4
45   %or4 = or i32 %tmp4, %i.0
46   store i32 %or4, ptr %or, align 4
47   br label %for.inc
49 for.inc:                                          ; preds = %for.body
50   %inc = add nsw i32 %i.0, 1
51   br label %for.cond
53 for.end:                                          ; preds = %for.cond
54   ret void