annotate polly/test/CodeGen/non-affine-region-exit-phi-incoming-synthesize.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:
diff changeset
1 ; RUN: opt %loadPolly -polly-codegen -S < %s | FileCheck %s
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
2 ;
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
3 ; This caused the code generation to generate invalid code as the same BBMap was
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
4 ; used for the whole non-affine region. When %add is synthesized for the
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
5 ; incoming value of subregion_if first, the code for it was generated into
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
6 ; subregion_if, but reused for the incoming value of subregion_exit, although it
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
7 ; is not dominated by subregion_if.
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
8 ;
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
9 ; CHECK-LABEL: polly.stmt.subregion_entry:
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
10 ; CHECK: %[[R0:[0-9]*]] = add i32 %n, -2
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
11 ;
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
12 ; CHECK-LABEL: polly.stmt.subregion_if:
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
13 ; CHECK: %[[R1:[0-9]*]] = add i32 %n, -2
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
14 ;
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
15 ; CHECK-LABEL: polly.stmt.subregion_exit.region_exiting:
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
16 ; CHECK: %polly.retval = phi i32 [ %[[R1]], %polly.stmt.subregion_if ], [ %[[R0]], %polly.stmt.subregion_entry ]
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
17
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
18 define i32 @func(i32 %n){
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
19 entry:
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
20 br label %subregion_entry
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
21
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
22 subregion_entry:
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
23 %add = add nsw i32 %n, -2
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
24 %cmp = fcmp ogt float undef, undef
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
25 br i1 %cmp, label %subregion_if, label %subregion_exit
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
26
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
27 subregion_if:
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
28 br label %subregion_exit
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
29
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
30 subregion_exit:
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
31 %retval = phi i32 [ %add, %subregion_if ], [ %add, %subregion_entry ]
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
32 ret i32 %retval
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
33 }