llvm-project
36 строк · 818.0 Байт
1; RUN: opt %loadNPMPolly -passes=polly-codegen -S < %s \
2; RUN: -polly-invariant-load-hoisting \
3; RUN: | FileCheck %s
4
5; CHECK: %polly.access.A = getelementptr ptr, ptr %A, i64 0
6; CHECK: %polly.access.A.load = load ptr, ptr %polly.access.A
7; CHECK: store float 4.200000e+01, ptr %polly.access.A.load
8; CHECK: store float 4.800000e+01, ptr %polly.access.A.load
9
10define void @foo(ptr %A) {
11start:
12br label %loop
13
14loop:
15%indvar = phi i64 [0, %start], [%indvar.next, %latch]
16%indvar.next = add nsw i64 %indvar, 1
17%icmp = icmp slt i64 %indvar.next, 1024
18br i1 %icmp, label %body1, label %exit
19
20body1:
21%baseA = load ptr, ptr %A
22store float 42.0, ptr %baseA
23br label %body2
24
25body2:
26%baseB = load ptr, ptr %A
27store float 48.0, ptr %baseB
28br label %latch
29
30latch:
31br label %loop
32
33exit:
34ret void
35
36}
37