54 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -passes="ipsccp<func-spec>" -S < %s | FileCheck %s3 4%mystruct = type { i32, [2 x i64] }5 6define internal ptr @myfunc(ptr %arg) {7; CHECK-LABEL: @myfunc(8; CHECK-NEXT: entry:9; CHECK-NEXT: br label [[FOR_COND:%.*]]10; CHECK: for.cond:11; CHECK-NEXT: br label [[FOR_COND2:%.*]]12; CHECK: for.cond2:13; CHECK-NEXT: br label [[FOR_BODY2:%.*]]14; CHECK: for.body2:15; CHECK-NEXT: br label [[FOR_COND2]]16;17entry:18 br label %for.cond19 20for.cond: ; preds = %for.body, %entry21 %phi = phi ptr [ undef, %for.body ], [ null, %entry ]22 %cond = icmp eq ptr %phi, null23 br i1 %cond, label %for.cond2, label %for.body24 25for.body: ; preds = %for.cond26 call void @callee(ptr nonnull %phi)27 br label %for.cond28 29for.cond2: ; preds = %for.body2, %for.cond30 %phi2 = phi ptr [ undef, %for.body2 ], [ null, %for.cond ]31 br i1 false, label %for.end, label %for.body232 33for.body2: ; preds = %for.cond234 %arrayidx = getelementptr inbounds %mystruct, ptr %phi2, i64 0, i32 1, i64 335 br label %for.cond236 37for.end: ; preds = %for.cond238 ret ptr %arg39}40 41define ptr @caller() {42; CHECK-LABEL: @caller(43; CHECK-NEXT: entry:44; CHECK-NEXT: [[CALL:%.*]] = call ptr @myfunc(ptr undef)45; CHECK-NEXT: ret ptr undef46;47entry:48 %call = call ptr @myfunc(ptr undef)49 ret ptr %call50}51 52declare void @callee(ptr)53 54