• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt < %s -licm -stats -S |& grep "1 licm"
2
3@"\01L_OBJC_METH_VAR_NAME_" = internal global [4 x i8] c"foo\00", section "__TEXT,__objc_methname,cstring_literals", align 1
4@"\01L_OBJC_SELECTOR_REFERENCES_" = internal global i8* getelementptr inbounds ([4 x i8]* @"\01L_OBJC_METH_VAR_NAME_", i32 0, i32 0), section "__DATA, __objc_selrefs, literal_pointers, no_dead_strip"
5@"\01L_OBJC_IMAGE_INFO" = internal constant [2 x i32] [i32 0, i32 16], section "__DATA, __objc_imageinfo, regular, no_dead_strip"
6@llvm.used = appending global [3 x i8*] [i8* getelementptr inbounds ([4 x i8]* @"\01L_OBJC_METH_VAR_NAME_", i32 0, i32 0), i8* bitcast (i8** @"\01L_OBJC_SELECTOR_REFERENCES_" to i8*), i8* bitcast ([2 x i32]* @"\01L_OBJC_IMAGE_INFO" to i8*)], section "llvm.metadata"
7
8define void @test(i8* %x) uwtable ssp {
9entry:
10  %x.addr = alloca i8*, align 8
11  %i = alloca i32, align 4
12  store i8* %x, i8** %x.addr, align 8
13  store i32 0, i32* %i, align 4
14  br label %for.cond
15
16for.cond:                                         ; preds = %for.inc, %entry
17  %0 = load i32* %i, align 4
18  %cmp = icmp ult i32 %0, 10000
19  br i1 %cmp, label %for.body, label %for.end
20
21for.body:                                         ; preds = %for.cond
22  %1 = load i8** %x.addr, align 8
23  %2 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_", !invariant.load !0
24  %call = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*)*)(i8* %1, i8* %2)
25  br label %for.inc
26
27for.inc:                                          ; preds = %for.body
28  %3 = load i32* %i, align 4
29  %inc = add i32 %3, 1
30  store i32 %inc, i32* %i, align 4
31  br label %for.cond
32
33for.end:                                          ; preds = %for.cond
34  ret void
35}
36
37declare i8* @objc_msgSend(i8*, i8*, ...) nonlazybind
38
39!0 = metadata !{}
40