Clang] Fix expansion of response files in -Wp after integrated-cc1 change
[llvm-project.git] / polly / test / GPGPU / loops-outside-scop.ll
blob2159485e4b837d8ecf26002e50f64a190d34cc2f
1 ; RUN: opt %loadPolly -analyze -polly-scops < %s | FileCheck %s -check-prefix=SCOP
3 ; There is no FileCheck because we want to make sure that this doesn't crash.
4 ; RUN: opt %loadPolly -polly-codegen-ppcg -polly-acc-fail-on-verify-module-failure \
5 ; RUN: -disable-output < %s
7 ; REQUIRES: pollyacc
9 ; Due to the existence of the `fence` call, We can only detect the inner loop
10 ; and not the outer loop. PPCGCodeGeneration had not implemented this case.
11 ; The fix was to pull the implementation from `IslNodeBuilder.
13 ; Make sure that we only capture the inner loop
14 ; SCOP:      Function: f
15 ; SCOP-NEXT: Region: %for2.body---%for2.body.fence
16 ; SCOP-NEXT: Max Loop Depth:  1
18 target datalayout = "e-p:64:64:64-S128-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f16:16:16-f32:32:32-f64:64:64-f128:128:128-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
19 target triple = "x86_64-unknown-linux-gnu"
21 declare void @fn_to_fence(i32 *%val)
23 ; void f(int *arr, bool shouldcont) {
24 ;     for(int i = 0; ; i++) {
25 ;         for(int j = 0; j < 10; j++) {
26 ;             arr[j] = i;
27 ;         }
28 ;         fence(arr);
29 ;         if (!shouldcont) break;
30 ;     }
31 ; }
34 ; Function Attrs: nounwind uwtable
35 define void @f(i32 *%arr, i1 %shouldcont) #1 {
36 entry:
37   br label %for.init
39 for.init:                                             ; preds = %for.end, %entry.split
40   %i = phi i32 [ %i.next, %for.end ], [ 0, %entry ]
41   br label %for2.body
43 for2.body:                                             ; preds = %"65", %"64"
44   %j = phi i32 [ %j.next, %for2.body ], [ 0, %for.init ]
45   %j.sext = sext i32 %j to i64
46   %arr.slot = getelementptr i32, i32* %arr, i64 %j.sext
47   store i32 %i, i32* %arr.slot, align 4
48   %exitcond = icmp eq i32 %j, 10
49   %j.next = add i32 %j, 1
50   br i1 %exitcond, label %for2.body.fence, label %for2.body
52 for2.body.fence:                                             ; preds = %"65"
53   call void @fn_to_fence(i32* %arr) #2
54   br i1 %shouldcont, label %for.end, label %exit
55 for.end:                                             ; preds = %"69"
56   %i.next = add i32 %i, 1
57   br label %for.init
59 exit:                                             ; preds = %"69"
60   ret void
65 attributes #0 = { argmemonly nounwind }
66 attributes #1 = { nounwind uwtable }
67 attributes #2 = { nounwind }