brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · 390e96e Raw
47 lines · plain
1; RUN: opt -S -passes=correlated-propagation -debug-only=lazy-value-info <%s 2>&1 | FileCheck %s2; REQUIRES: asserts3;4; Shortcut in Correlated Value Propagation ensures not to take Lazy Value Info5; analysis for %a.i and %tmp because %a.i is defined by alloca and %tmp is6; defined by alloca + bitcast. We know the ret value of alloca is nonnull.7;8; CHECK-NOT: LVI Getting edge value   %a.i = alloca i64, align 8 at 'for.body'9target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"10target triple = "x86_64-unknown-linux-gnu"11 12@.str = private unnamed_addr constant [8 x i8] c"a = %l\0A\00", align 113 14; Function Attrs: argmemonly nounwind15declare void @llvm.lifetime.start.p0(ptr nocapture)16 17declare void @hoo(ptr)18 19declare i32 @printf(ptr nocapture readonly, ...)20 21; Function Attrs: argmemonly nounwind22declare void @llvm.lifetime.end.p0(ptr nocapture)23 24define void @goo(i32 %N, ptr %b) {25entry:26  %a.i = alloca i64, align 827  br label %for.cond28 29for.cond:                                         ; preds = %for.body, %entry30  %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.body ]31  %cmp = icmp slt i32 %i.0, %N32  br i1 %cmp, label %for.body, label %for.end33 34for.body:                                         ; preds = %for.cond35  call void @llvm.lifetime.start.p0(ptr %a.i)36  call void @hoo(ptr %a.i)37  call void @hoo(ptr %b)38  %tmp1 = load volatile i64, ptr %a.i, align 839  %call.i = call i32 (ptr, ...) @printf(ptr @.str, i64 %tmp1)40  call void @llvm.lifetime.end.p0(ptr %a.i)41  %inc = add nsw i32 %i.0, 142  br label %for.cond43 44for.end:                                          ; preds = %for.cond45  ret void46}47