annotate polly/test/ScopDetect/base_pointer_load_setNewAccessRelation.ll @ 252:1f2b6ac9f198 llvm-original

LLVM16-1
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Fri, 18 Aug 2023 09:04:13 +0900
parents c4bab56944e8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
236
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
1 ; RUN: opt %loadPolly -polly-ignore-aliasing -polly-invariant-load-hoisting=true -polly-scops -polly-print-import-jscop -polly-codegen -disable-output < %s | FileCheck %s
150
anatofuz
parents:
diff changeset
2 ;
anatofuz
parents:
diff changeset
3 ; This violated an assertion in setNewAccessRelation that assumed base pointers
anatofuz
parents:
diff changeset
4 ; to be load-hoisted. Without this assertion, it codegen would generate invalid
anatofuz
parents:
diff changeset
5 ; code.
anatofuz
parents:
diff changeset
6 ;
anatofuz
parents:
diff changeset
7 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
anatofuz
parents:
diff changeset
8
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
9 define void @base_pointer_load_is_inst_inside_invariant_1(i64 %n, ptr %A) {
150
anatofuz
parents:
diff changeset
10 entry:
anatofuz
parents:
diff changeset
11 br label %for.i
anatofuz
parents:
diff changeset
12
anatofuz
parents:
diff changeset
13 for.i:
anatofuz
parents:
diff changeset
14 %indvar.i = phi i64 [ %indvar.i.next, %for.i.inc ], [ 0, %entry ]
anatofuz
parents:
diff changeset
15 br label %S1
anatofuz
parents:
diff changeset
16
anatofuz
parents:
diff changeset
17 S1:
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
18 %ptr = load ptr, ptr %A
150
anatofuz
parents:
diff changeset
19 %conv = sitofp i64 %indvar.i to float
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
20 %arrayidx5 = getelementptr float, ptr %ptr, i64 %indvar.i
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
21 store float %conv, ptr %arrayidx5, align 4
150
anatofuz
parents:
diff changeset
22 br label %for.i.inc
anatofuz
parents:
diff changeset
23
anatofuz
parents:
diff changeset
24 for.i.inc:
anatofuz
parents:
diff changeset
25 %indvar.i.next = add i64 %indvar.i, 1
anatofuz
parents:
diff changeset
26 %exitcond.i = icmp ne i64 %indvar.i.next, %n
anatofuz
parents:
diff changeset
27 br i1 %exitcond.i, label %for.i, label %exit
anatofuz
parents:
diff changeset
28
anatofuz
parents:
diff changeset
29 exit:
anatofuz
parents:
diff changeset
30 ret void
anatofuz
parents:
diff changeset
31 }
anatofuz
parents:
diff changeset
32
anatofuz
parents:
diff changeset
33
anatofuz
parents:
diff changeset
34 ; Detected by -polly-detect with required load hoist.
anatofuz
parents:
diff changeset
35 ; CHECK-NOT: Valid Region for Scop: for.i => exit
anatofuz
parents:
diff changeset
36 ;
anatofuz
parents:
diff changeset
37 ; Load hoist if %ptr by -polly-scops.
anatofuz
parents:
diff changeset
38 ; CHECK: Invariant Accesses: {
anatofuz
parents:
diff changeset
39 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
anatofuz
parents:
diff changeset
40 ; CHECK-NEXT: [n] -> { Stmt_S1[i0] -> MemRef_A[0] };
anatofuz
parents:
diff changeset
41 ; CHECK-NEXT: Execution Context: [n] -> { : n > 0 }
anatofuz
parents:
diff changeset
42 ; CHECK-NEXT: }