• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt %loadPolly -polly-stmt-granularity=bb           -polly-use-llvm-names=0 -polly-scops -analyze < %s | FileCheck %s -match-full-lines -check-prefix=IDX
2; RUN: opt %loadPolly -polly-stmt-granularity=bb           -polly-use-llvm-names=1 -polly-scops -analyze < %s | FileCheck %s -match-full-lines -check-prefix=BB
3; RUN: opt %loadPolly -polly-stmt-granularity=scalar-indep -polly-use-llvm-names=0 -polly-scops -analyze < %s | FileCheck %s -match-full-lines -check-prefix=IDX
4; RUN: opt %loadPolly -polly-stmt-granularity=scalar-indep -polly-use-llvm-names=1 -polly-scops -analyze < %s | FileCheck %s -match-full-lines -check-prefix=BB
5;
6; Check that the statement has the same name, regardless of how the
7; basic block is split into multiple statements.
8; Note that %unrelatedA and %unrelatedB can be put into separate
9; statements, but are removed because those have no side-effects.
10;
11; for (int j = 0; j < n; j += 1) {
12; body:
13;   double unrelatedA = 21.0 + 21.0;
14;   A[0] = 0.0;
15;   double unrelatedB = 21.0 + 21.0;
16; }
17;
18define void @func(i32 %n, double* noalias nonnull %A) {
19entry:
20  br label %for
21
22for:
23  %j = phi i32 [0, %entry], [%j.inc, %inc]
24  %j.cmp = icmp slt i32 %j, %n
25  br i1 %j.cmp, label %body, label %exit
26
27    body:
28      %unrelatedA = fadd double 21.0, 21.0
29      store double 0.0, double* %A
30      %unrelatedB = fadd double 21.0, 21.0
31      br label %inc
32
33inc:
34  %j.inc = add nuw nsw i32 %j, 1
35  br label %for
36
37exit:
38  br label %return
39
40return:
41  ret void
42}
43
44
45; IDX:      Statements {
46; IDX-NEXT:     Stmt1
47
48; BB:       Statements {
49; BB-NEXT:      Stmt_body
50