18ebb3eacSBjorn Pettersson; RUN: opt -S -passes=correlated-propagation -debug-only=lazy-value-info <%s 2>&1 | FileCheck %s 2cee313d2SEric Christopher; REQUIRES: asserts 3cee313d2SEric Christopher; 4cee313d2SEric Christopher; Shortcut in Correlated Value Propagation ensures not to take Lazy Value Info 5cee313d2SEric Christopher; analysis for %a.i and %tmp because %a.i is defined by alloca and %tmp is 6cee313d2SEric Christopher; defined by alloca + bitcast. We know the ret value of alloca is nonnull. 7cee313d2SEric Christopher; 8cee313d2SEric Christopher; CHECK-NOT: LVI Getting edge value %a.i = alloca i64, align 8 at 'for.body' 9cee313d2SEric Christophertarget datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 10cee313d2SEric Christophertarget triple = "x86_64-unknown-linux-gnu" 11cee313d2SEric Christopher 12cee313d2SEric Christopher@.str = private unnamed_addr constant [8 x i8] c"a = %l\0A\00", align 1 13cee313d2SEric Christopher 14cee313d2SEric Christopher; Function Attrs: argmemonly nounwind 15*7ac6b2fdSNikita Popovdeclare void @llvm.lifetime.start.p0(i64, ptr nocapture) 16cee313d2SEric Christopher 17*7ac6b2fdSNikita Popovdeclare void @hoo(ptr) 18cee313d2SEric Christopher 19*7ac6b2fdSNikita Popovdeclare i32 @printf(ptr nocapture readonly, ...) 20cee313d2SEric Christopher 21cee313d2SEric Christopher; Function Attrs: argmemonly nounwind 22*7ac6b2fdSNikita Popovdeclare void @llvm.lifetime.end.p0(i64, ptr nocapture) 23cee313d2SEric Christopher 24*7ac6b2fdSNikita Popovdefine void @goo(i32 %N, ptr %b) { 25cee313d2SEric Christopherentry: 26cee313d2SEric Christopher %a.i = alloca i64, align 8 27cee313d2SEric Christopher br label %for.cond 28cee313d2SEric Christopher 29cee313d2SEric Christopherfor.cond: ; preds = %for.body, %entry 30cee313d2SEric Christopher %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.body ] 31cee313d2SEric Christopher %cmp = icmp slt i32 %i.0, %N 32cee313d2SEric Christopher br i1 %cmp, label %for.body, label %for.end 33cee313d2SEric Christopher 34cee313d2SEric Christopherfor.body: ; preds = %for.cond 35*7ac6b2fdSNikita Popov call void @llvm.lifetime.start.p0(i64 8, ptr %a.i) 36*7ac6b2fdSNikita Popov call void @hoo(ptr %a.i) 37*7ac6b2fdSNikita Popov call void @hoo(ptr %b) 38*7ac6b2fdSNikita Popov %tmp1 = load volatile i64, ptr %a.i, align 8 39*7ac6b2fdSNikita Popov %call.i = call i32 (ptr, ...) @printf(ptr @.str, i64 %tmp1) 40*7ac6b2fdSNikita Popov call void @llvm.lifetime.end.p0(i64 8, ptr %a.i) 41cee313d2SEric Christopher %inc = add nsw i32 %i.0, 1 42cee313d2SEric Christopher br label %for.cond 43cee313d2SEric Christopher 44cee313d2SEric Christopherfor.end: ; preds = %for.cond 45cee313d2SEric Christopher ret void 46cee313d2SEric Christopher} 47