Mercurial > hg > CbC > CbC_llvm
comparison polly/test/ForwardOpTree/noforward_load_conditional.ll @ 150:1d019706d866
LLVM10
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 15:10:13 +0900 |
parents | |
children | c4bab56944e8 |
comparison
equal
deleted
inserted
replaced
147:c2174574ed3a | 150:1d019706d866 |
---|---|
1 ; RUN: opt %loadPolly -polly-optree -analyze < %s | FileCheck %s -match-full-lines | |
2 ; | |
3 ; B[j] is overwritten by at least one statement between the | |
4 ; definition of %val and its use. Hence, it cannot be forwarded. | |
5 ; | |
6 ; for (int j = 0; j < n; j += 1) { | |
7 ; bodyA: | |
8 ; double val = B[j]; | |
9 ; if (j < 1) { | |
10 ; bodyA_true: | |
11 ; B[j] = 0.0; | |
12 ; } | |
13 ; | |
14 ; bodyB: | |
15 ; A[j] = val; | |
16 ; } | |
17 ; | |
18 define void @func(i32 %n, double* noalias nonnull %A, double* noalias nonnull %B) { | |
19 entry: | |
20 br label %for | |
21 | |
22 for: | |
23 %j = phi i32 [0, %entry], [%j.inc, %inc] | |
24 %j.cmp = icmp slt i32 %j, %n | |
25 br i1 %j.cmp, label %bodyA, label %exit | |
26 | |
27 bodyA: | |
28 %B_idx = getelementptr inbounds double, double* %B, i32 %j | |
29 %val = load double, double* %B_idx | |
30 %cond = icmp slt i32 %j, 1 | |
31 br i1 %cond, label %bodyA_true, label %bodyB | |
32 | |
33 bodyA_true: | |
34 store double 0.0, double* %B_idx | |
35 br label %bodyB | |
36 | |
37 bodyB: | |
38 %A_idx = getelementptr inbounds double, double* %A, i32 %j | |
39 store double %val, double* %A_idx | |
40 br label %inc | |
41 | |
42 inc: | |
43 %j.inc = add nuw nsw i32 %j, 1 | |
44 br label %for | |
45 | |
46 exit: | |
47 br label %return | |
48 | |
49 return: | |
50 ret void | |
51 } | |
52 | |
53 | |
54 ; CHECK: ForwardOpTree executed, but did not modify anything |