1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc < %s -mtriple=x86_64-- | FileCheck %s
4 @p = dso_local local_unnamed_addr global i64 0, align 8
5 @l = dso_local local_unnamed_addr global ptr null, align 8
6 @c = dso_local local_unnamed_addr global i32 0, align 4
8 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
9 declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture)
11 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
12 declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture)
14 ; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
15 define i32 @main() #1 {
17 ; CHECK: # %bb.0: # %entry
18 ; CHECK-NEXT: movl $0, c(%rip)
19 ; CHECK-NEXT: movq $64, p(%rip)
20 ; CHECK-NEXT: movabsq $214787019555673, %rax # imm = 0xC3590000C359
21 ; CHECK-NEXT: movq %rax, -{{[0-9]+}}(%rsp)
22 ; CHECK-NEXT: cmpl $42828, -{{[0-9]+}}(%rsp) # imm = 0xA74C
23 ; CHECK-NEXT: jg .LBB0_2
24 ; CHECK-NEXT: # %bb.1: # %if.then.1.i
25 ; CHECK-NEXT: movq l(%rip), %rax
26 ; CHECK-NEXT: movb $0, (%rax)
27 ; CHECK-NEXT: .LBB0_2: # %t.exit
28 ; CHECK-NEXT: xorl %eax, %eax
31 %a.i = alloca [2 x i32], align 4
32 store i32 0, ptr @c, align 4
33 %arrayidx15.i = getelementptr inbounds [2 x i32], ptr %a.i, i64 0, i64 1
34 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a.i)
35 store i32 50009, ptr %a.i, align 4
36 %arrayidx.i.1 = getelementptr inbounds [2 x i32], ptr %a.i, i64 0, i64 1
37 store i32 50009, ptr %arrayidx.i.1, align 4
38 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a.i)
39 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a.i)
40 store i64 64, ptr @p, align 8
41 %0 = load i32, ptr @c, align 4
42 %idxprom.1.i = zext i32 %0 to i64
43 %arrayidx.1.i = getelementptr inbounds [2 x i32], ptr %a.i, i64 0, i64 %idxprom.1.i
44 store i32 50009, ptr %arrayidx.1.i, align 4
45 %add14.1.i.1 = add i32 %0, 1
46 %idxprom.1.i.1 = zext i32 %add14.1.i.1 to i64
47 %arrayidx.1.i.1 = getelementptr inbounds [2 x i32], ptr %a.i, i64 0, i64 %idxprom.1.i.1
48 store i32 50009, ptr %arrayidx.1.i.1, align 4
49 %1 = load i32, ptr %arrayidx15.i, align 4
50 %cmp16.1.i = icmp slt i32 %1, 42829
51 br i1 %cmp16.1.i, label %if.then.1.i, label %t.exit
53 if.then.1.i: ; preds = %entry
54 %2 = load ptr, ptr @l, align 8
55 store i8 0, ptr %2, align 1
58 t.exit: ; preds = %entry, %if.then.1.i
59 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a.i)