1 ; RUN: opt -passes=alignment-from-assumptions -S < %s | FileCheck %s
2 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
3 target triple = "x86_64-unknown-linux-gnu"
5 %type1 = type { %type2 }
6 %type2 = type { [4 x i8] }
8 ; Function Attrs: nounwind
9 declare void @llvm.assume(i1) #0
11 ; Function Attrs: nounwind readnone
12 declare i32 @llvm.bswap.i32(i32) #1
14 ; Function Attrs: nounwind uwtable
15 define void @test1() unnamed_addr #2 align 2 {
20 br i1 undef, label %if.then, label %if.end
22 if.then: ; preds = %entry
25 if.end: ; preds = %entry
26 br i1 undef, label %return, label %if.end8
28 if.end8: ; preds = %if.end
29 br i1 undef, label %if.then13, label %if.end14
31 if.then13: ; preds = %if.end8
34 if.end14: ; preds = %if.end8
35 br i1 undef, label %cond.false.i129, label %cond.end.i136
37 cond.false.i129: ; preds = %if.end14
40 cond.end.i136: ; preds = %if.end14
41 br i1 undef, label %land.lhs.true.i, label %if.end.i145
43 land.lhs.true.i: ; preds = %cond.end.i136
44 br i1 undef, label %if.end.i145, label %if.then.i137
46 if.then.i137: ; preds = %land.lhs.true.i
47 br i1 undef, label %cond.false8.i, label %cond.end9.i
49 cond.false8.i: ; preds = %if.then.i137
52 cond.end9.i: ; preds = %if.then.i137
53 br i1 undef, label %if.then23, label %if.end24
55 if.end.i145: ; preds = %land.lhs.true.i, %cond.end.i136
58 if.then23: ; preds = %cond.end9.i
61 if.end24: ; preds = %cond.end9.i
62 br i1 undef, label %for.end, label %for.body.lr.ph
64 for.body.lr.ph: ; preds = %if.end24
67 for.end: ; preds = %if.end24
68 br i1 undef, label %if.end123, label %if.then121
70 if.then121: ; preds = %for.end
73 if.end123: ; preds = %for.end
74 br i1 undef, label %if.end150, label %if.then126
76 if.then126: ; preds = %if.end123
77 %ptrint.i.i185 = ptrtoint ptr undef to i64
78 %maskedptr.i.i186 = and i64 %ptrint.i.i185, 1
79 %maskcond.i.i187 = icmp eq i64 %maskedptr.i.i186, 0
80 tail call void @llvm.assume(i1 %maskcond.i.i187) #0
81 %ret.0.copyload.i.i189 = load i32, ptr undef, align 2
83 ; CHECK: load {{.*}} align 2
85 %0 = tail call i32 @llvm.bswap.i32(i32 %ret.0.copyload.i.i189) #0
86 %conv131 = zext i32 %0 to i64
87 %add.ptr132 = getelementptr inbounds i8, ptr undef, i64 %conv131
88 br i1 undef, label %if.end150, label %if.end.i173
90 if.end.i173: ; preds = %if.then126
91 br i1 undef, label %test1.exit, label %cond.false.i.i.i.i174
93 cond.false.i.i.i.i174: ; preds = %if.end.i173
96 test1.exit: ; preds = %if.end.i173
97 br i1 undef, label %test1a.exit, label %if.end.i124
99 if.end.i124: ; preds = %test1.exit
102 test1a.exit: ; preds = %test1.exit
103 br i1 undef, label %if.end150, label %for.body137.lr.ph
105 for.body137.lr.ph: ; preds = %test1a.exit
106 br label %for.body137
108 for.body137: ; preds = %test1b.exit, %for.body137.lr.ph
109 %ShndxTable.0309 = phi ptr [ %add.ptr132, %for.body137.lr.ph ], [ %incdec.ptr, %test1b.exit ]
110 br i1 undef, label %for.body137.if.end146_crit_edge, label %if.then140
112 for.body137.if.end146_crit_edge: ; preds = %for.body137
113 %incdec.ptr = getelementptr inbounds %type1, ptr %ShndxTable.0309, i64 1
114 br i1 undef, label %cond.false.i70, label %cond.end.i
116 if.then140: ; preds = %for.body137
117 %ret.0.copyload.i.i102 = load i32, ptr %ShndxTable.0309, align 2
119 ; CHECK: load {{.*}} align 2
123 cond.false.i70: ; preds = %for.body137.if.end146_crit_edge
126 cond.end.i: ; preds = %for.body137.if.end146_crit_edge
127 br i1 undef, label %test1b.exit, label %cond.false.i.i
129 cond.false.i.i: ; preds = %cond.end.i
132 test1b.exit: ; preds = %cond.end.i
133 br i1 undef, label %if.end150, label %for.body137
135 if.end150: ; preds = %test1b.exit, %test1a.exit, %if.then126, %if.end123
136 br i1 undef, label %for.end176, label %for.body155.lr.ph
138 for.body155.lr.ph: ; preds = %if.end150
141 for.end176: ; preds = %if.end150
144 return: ; preds = %if.end
148 attributes #0 = { nounwind }
149 attributes #1 = { nounwind readnone }
150 attributes #2 = { nounwind uwtable }