1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes="ipsccp<func-spec>" -S < %s | FileCheck %s
4 %mystruct = type { i32, [2 x i64] }
6 define internal ptr @myfunc(ptr %arg) {
7 ; CHECK-LABEL: @myfunc(
9 ; CHECK-NEXT: br label [[FOR_COND:%.*]]
11 ; CHECK-NEXT: br label [[FOR_COND2:%.*]]
13 ; CHECK-NEXT: br label [[FOR_BODY2:%.*]]
15 ; CHECK-NEXT: br label [[FOR_COND2]]
20 for.cond: ; preds = %for.body, %entry
21 %phi = phi ptr [ undef, %for.body ], [ null, %entry ]
22 %cond = icmp eq ptr %phi, null
23 br i1 %cond, label %for.cond2, label %for.body
25 for.body: ; preds = %for.cond
26 call void @callee(ptr nonnull %phi)
29 for.cond2: ; preds = %for.body2, %for.cond
30 %phi2 = phi ptr [ undef, %for.body2 ], [ null, %for.cond ]
31 br i1 false, label %for.end, label %for.body2
33 for.body2: ; preds = %for.cond2
34 %arrayidx = getelementptr inbounds %mystruct, ptr %phi2, i64 0, i32 1, i64 3
37 for.end: ; preds = %for.cond2
41 define ptr @caller() {
42 ; CHECK-LABEL: @caller(
44 ; CHECK-NEXT: [[CALL:%.*]] = call ptr @myfunc(ptr undef)
45 ; CHECK-NEXT: ret ptr undef
48 %call = call ptr @myfunc(ptr undef)
52 declare void @callee(ptr)