• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -S -slp-vectorizer < %s | FileCheck %s
2
3target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128"
4target triple = "aarch64--linux-gnu"
5
6; This test ensures that we do not regress due to PR26364. The vectorizer
7; should not compute a smaller size for %k.13 since it is in a use-def cycle
8; and cannot be demoted.
9;
10; CHECK-LABEL: @PR26364
11; CHECK: %k.13 = phi i32
12;
13define fastcc void @PR26364() {
14entry:
15  br i1 undef, label %for.end11, label %for.cond4
16
17for.cond4:
18  %k.13 = phi i32 [ undef, %entry ], [ %k.3, %for.cond4 ]
19  %e.02 = phi i32 [ 1, %entry ], [ 0, %for.cond4 ]
20  %e.1 = select i1 undef, i32 %e.02, i32 0
21  %k.3 = select i1 undef, i32 %k.13, i32 undef
22  br label %for.cond4
23
24for.end11:
25  ret void
26}
27
28; This test ensures that we do not regress due to PR26629. We must look at
29; every root in the vectorizable tree when computing minimum sizes since one
30; root may require fewer bits than another.
31;
32; CHECK-LABEL: @PR26629
33; CHECK-NOT: {{.*}} and <2 x i72>
34;
35define void @PR26629(i32* %c) {
36entry:
37  br i1 undef, label %for.ph, label %for.end
38
39for.ph:
40  %0 = load i32, i32* %c, align 4
41  br label %for.body
42
43for.body:
44  %d = phi i72 [ 576507472957710340, %for.ph ], [ %bf.set17, %for.body ]
45  %sub = sub i32 %0, undef
46  %bf.clear13 = and i72 %d, -576460748008464384
47  %1 = zext i32 %sub to i72
48  %bf.value15 = and i72 %1, 8191
49  %bf.clear16 = or i72 %bf.value15, %bf.clear13
50  %bf.set17 = or i72 %bf.clear16, undef
51  br label %for.body
52
53for.end:
54  ret void
55}
56