xref: /llvm-project/llvm/test/Analysis/MemorySSA/pr43044.ll (revision 7f172e82be0fcb4f0ae66f7bb3662d88b479d994)
1; RUN: opt -passes='loop-mssa(loop-rotate,licm)' -verify-memoryssa %s -S | FileCheck %s
2; REQUIRES: asserts
3
4target datalayout = "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-a:8:16-n32:64"
5target triple = "s390x-ibm-linux"
6
7declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture)
8
9; CHECK-LABEL: @func_42()
10define void @func_42() {
11entry:
12  br label %for.cond1050
13
14for.cond1050.loopexit:                            ; preds = %for.cond1373
15  br label %for.cond1050
16
17for.cond1050:                                     ; preds = %for.cond1050.loopexit, %entry
18  %storemerge6 = phi i32 [ 2, %entry ], [ 0, %for.cond1050.loopexit ]
19  %cmp1051 = icmp sgt i32 %storemerge6, -1
20  br i1 %cmp1051, label %for.cond1055.preheader, label %cleanup1400.loopexit1
21
22for.cond1055.preheader:                           ; preds = %for.cond1050
23  store i64 0, ptr null, align 8
24  %0 = load i64, ptr null, align 8
25  %tobool1383 = icmp eq i64 %0, 0
26  br i1 %tobool1383, label %for.cond1055.preheader.cleanup1400.loopexit.split_crit_edge, label %for.cond1055.preheader.for.cond1055.preheader.split_crit_edge
27
28for.cond1055.preheader.for.cond1055.preheader.split_crit_edge: ; preds = %for.cond1055.preheader
29  br label %for.body1376
30
31for.cond1055.preheader.cleanup1400.loopexit.split_crit_edge: ; preds = %for.cond1055.preheader
32  br label %cleanup1400.loopexit.split
33
34for.cond1373:                                     ; preds = %for.body1376
35  br i1 true, label %for.body1376, label %for.cond1050.loopexit
36
37for.body1376:                                     ; preds = %for.cond1373, %for.cond1055.preheader.for.cond1055.preheader.split_crit_edge
38  br i1 false, label %cleanup1400.loopexit, label %for.cond1373
39
40cleanup1400.loopexit:                             ; preds = %for.body1376
41  br label %cleanup1400.loopexit.split
42
43cleanup1400.loopexit.split:                       ; preds = %cleanup1400.loopexit, %for.cond1055.preheader.cleanup1400.loopexit.split_crit_edge
44  br label %cleanup1400
45
46cleanup1400.loopexit1:                            ; preds = %for.cond1050
47  br label %cleanup1400
48
49cleanup1400:                                      ; preds = %cleanup1400.loopexit1, %cleanup1400.loopexit.split
50  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull undef)
51  unreachable
52}
53