annotate pyrect/translator/template/grep.ll @ 47:701beabd7d97

add input-rules, Range, CharacterClass, Anchor and MultiByte-Char(but not work)\nand more simplify NFA (is global improvement).
author Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
date Sun, 08 Aug 2010 04:13:14 +0900
parents pyrect/template/grep.ll@71fa409932bd
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
36
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 ; ModuleID = 'template/grep.ll.c'
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 target triple = "i386-apple-darwin9"
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 %struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 }
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 %struct.__sFILEX = type opaque
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 %struct.__sbuf = type { i8*, i32 }
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 @"\01LC" = internal constant [4 x i8] c"%s:\00" ; <[4 x i8]*> [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 @"\01LC1" = internal constant [2 x i8] c"r\00" ; <[2 x i8]*> [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 @__stderrp = external global %struct.FILE* ; <%struct.FILE**> [#uses=4]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 @"\01LC2" = internal constant [15 x i8] c"can't open %s:\00" ; <[15 x i8]*> [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 @readbuf = common global [1048576 x i8] zeroinitializer, align 32 ; <[1048576 x i8]*> [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 @"\01LC3" = internal constant [30 x i8] c"usage: grep regexp [file ...]\00" ; <[30 x i8]*> [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 @__stdinp = external global %struct.FILE* ; <%struct.FILE**> [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 define i32 @match(i8* %regexp, i8* %text) nounwind {
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 entry:
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 %regexp_addr = alloca i8* ; <i8**> [#uses=2]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 %text_addr = alloca i8* ; <i8**> [#uses=6]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 %retval = alloca i32 ; <i32*> [#uses=2]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 alloca i32 ; <i32*>:0 [#uses=4]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 store i8* %regexp, i8** %regexp_addr
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 store i8* %text, i8** %text_addr
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 load i8** %regexp_addr, align 4 ; <i8*>:1 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 getelementptr i8* %1, i32 0 ; <i8*>:2 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 load i8* %2, align 1 ; <i8>:3 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 icmp eq i8 %3, 94 ; <i1>:4 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 zext i1 %4 to i8 ; <i8>:5 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 %toBool = icmp ne i8 %5, 0 ; <i1> [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 br i1 %toBool, label %bb, label %bb1
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
31
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 bb: ; preds = %entry
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 load i8** %text_addr, align 4 ; <i8*>:6 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 call i32 @DFA( i8* %6 ) nounwind ; <i32>:7 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 store i32 %7, i32* %0, align 4
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 br label %bb7
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
37
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 bb1: ; preds = %bb4, %entry
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 load i8** %text_addr, align 4 ; <i8*>:8 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 call i32 @DFA( i8* %8 ) nounwind ; <i32>:9 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 icmp ne i32 %9, 0 ; <i1>:10 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 zext i1 %10 to i8 ; <i8>:11 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 %toBool2 = icmp ne i8 %11, 0 ; <i1> [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 br i1 %toBool2, label %bb3, label %bb4
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
45
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 bb3: ; preds = %bb1
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 store i32 1, i32* %0, align 4
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 br label %bb7
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
49
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 bb4: ; preds = %bb1
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 load i8** %text_addr, align 4 ; <i8*>:12 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 load i8* %12, align 1 ; <i8>:13 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 icmp ne i8 %13, 0 ; <i1>:14 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 zext i1 %14 to i8 ; <i8>:15 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 load i8** %text_addr, align 4 ; <i8*>:16 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 getelementptr i8* %16, i64 1 ; <i8*>:17 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 store i8* %17, i8** %text_addr, align 4
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 %toBool5 = icmp ne i8 %15, 0 ; <i1> [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 br i1 %toBool5, label %bb1, label %bb6
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
60
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
61 bb6: ; preds = %bb4
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
62 store i32 0, i32* %0, align 4
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
63 br label %bb7
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
64
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
65 bb7: ; preds = %bb6, %bb3, %bb
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
66 load i32* %0, align 4 ; <i32>:18 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
67 store i32 %18, i32* %retval, align 4
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
68 br label %return
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
69
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
70 return: ; preds = %bb7
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
71 %retval8 = load i32* %retval ; <i32> [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
72 ret i32 %retval8
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
73 }
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
74
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
75 declare i32 @DFA(i8*)
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
76
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
77 define void @grep(i8* %regexp, %struct.FILE* %f, i8* %name) nounwind {
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
78 entry:
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
79 %regexp_addr = alloca i8* ; <i8**> [#uses=2]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
80 %f_addr = alloca %struct.FILE* ; <%struct.FILE**> [#uses=2]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
81 %name_addr = alloca i8* ; <i8**> [#uses=3]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
82 %buf = alloca [1024 x i8] ; <[1024 x i8]*> [#uses=6]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
83 %n = alloca i32 ; <i32*> [#uses=4]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
84 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
85 store i8* %regexp, i8** %regexp_addr
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
86 store %struct.FILE* %f, %struct.FILE** %f_addr
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
87 store i8* %name, i8** %name_addr
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
88 br label %bb13
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
89
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
90 bb: ; preds = %bb13
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
91 %buf1 = bitcast [1024 x i8]* %buf to i8* ; <i8*> [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
92 call i32 @strlen( i8* %buf1 ) nounwind readonly ; <i32>:0 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
93 store i32 %0, i32* %n, align 4
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
94 load i32* %n, align 4 ; <i32>:1 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
95 icmp sgt i32 %1, 0 ; <i1>:2 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
96 zext i1 %2 to i8 ; <i8>:3 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
97 %toBool = icmp ne i8 %3, 0 ; <i1> [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
98 br i1 %toBool, label %bb2, label %bb5
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
99
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
100 bb2: ; preds = %bb
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
101 load i32* %n, align 4 ; <i32>:4 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
102 sub i32 %4, 1 ; <i32>:5 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
103 getelementptr [1024 x i8]* %buf, i32 0, i32 %5 ; <i8*>:6 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
104 load i8* %6, align 1 ; <i8>:7 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
105 icmp eq i8 %7, 10 ; <i1>:8 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
106 zext i1 %8 to i8 ; <i8>:9 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
107 %toBool3 = icmp ne i8 %9, 0 ; <i1> [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
108 br i1 %toBool3, label %bb4, label %bb5
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
109
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
110 bb4: ; preds = %bb2
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
111 load i32* %n, align 4 ; <i32>:10 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
112 sub i32 %10, 1 ; <i32>:11 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
113 getelementptr [1024 x i8]* %buf, i32 0, i32 %11 ; <i8*>:12 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
114 store i8 0, i8* %12, align 1
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
115 br label %bb5
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
116
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
117 bb5: ; preds = %bb4, %bb2, %bb
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
118 load i8** %regexp_addr, align 4 ; <i8*>:13 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
119 %buf6 = bitcast [1024 x i8]* %buf to i8* ; <i8*> [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
120 call i32 @match( i8* %13, i8* %buf6 ) nounwind ; <i32>:14 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
121 icmp ne i32 %14, 0 ; <i1>:15 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
122 zext i1 %15 to i8 ; <i8>:16 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
123 %toBool7 = icmp ne i8 %16, 0 ; <i1> [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
124 br i1 %toBool7, label %bb8, label %bb13
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
125
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
126 bb8: ; preds = %bb5
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
127 load i8** %name_addr, align 4 ; <i8*>:17 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
128 icmp ne i8* %17, null ; <i1>:18 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
129 zext i1 %18 to i8 ; <i8>:19 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
130 %toBool9 = icmp ne i8 %19, 0 ; <i1> [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
131 br i1 %toBool9, label %bb10, label %bb11
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
132
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
133 bb10: ; preds = %bb8
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
134 load i8** %name_addr, align 4 ; <i8*>:20 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
135 call i32 (i8*, ...)* @printf( i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), i8* %20 ) nounwind ; <i32>:21 [#uses=0]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
136 br label %bb11
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
137
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
138 bb11: ; preds = %bb10, %bb8
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
139 %buf12 = bitcast [1024 x i8]* %buf to i8* ; <i8*> [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
140 call i32 @puts( i8* %buf12 ) nounwind ; <i32>:22 [#uses=0]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
141 br label %bb13
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
142
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
143 bb13: ; preds = %bb11, %bb5, %entry
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
144 %buf14 = bitcast [1024 x i8]* %buf to i8* ; <i8*> [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
145 load %struct.FILE** %f_addr, align 4 ; <%struct.FILE*>:23 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
146 call i8* @fgets( i8* %buf14, i32 1024, %struct.FILE* %23 ) nounwind ; <i8*>:24 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
147 icmp ne i8* %24, null ; <i1>:25 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
148 zext i1 %25 to i8 ; <i8>:26 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
149 %toBool15 = icmp ne i8 %26, 0 ; <i1> [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
150 br i1 %toBool15, label %bb, label %bb16
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
151
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
152 bb16: ; preds = %bb13
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
153 br label %return
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
154
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
155 return: ; preds = %bb16
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
156 ret void
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
157 }
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
158
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
159 declare i32 @strlen(i8*) nounwind readonly
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
160
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
161 declare i32 @printf(i8*, ...) nounwind
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
162
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
163 declare i32 @puts(i8*)
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
164
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
165 declare i8* @fgets(i8*, i32, %struct.FILE*)
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
166
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
167 define void @llgrep(i8* %regexp, i8* %filename) nounwind {
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
168 entry:
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
169 %regexp_addr = alloca i8* ; <i8**> [#uses=2]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
170 %filename_addr = alloca i8* ; <i8**> [#uses=3]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
171 %f = alloca %struct.FILE* ; <%struct.FILE**> [#uses=5]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
172 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
173 store i8* %regexp, i8** %regexp_addr
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
174 store i8* %filename, i8** %filename_addr
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
175 load i8** %filename_addr, align 4 ; <i8*>:0 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
176 call %struct.FILE* @fopen( i8* %0, i8* getelementptr ([2 x i8]* @"\01LC1", i32 0, i32 0) ) nounwind ; <%struct.FILE*>:1 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
177 store %struct.FILE* %1, %struct.FILE** %f, align 4
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
178 load %struct.FILE** %f, align 4 ; <%struct.FILE*>:2 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
179 icmp eq %struct.FILE* %2, null ; <i1>:3 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
180 zext i1 %3 to i8 ; <i8>:4 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
181 %toBool = icmp ne i8 %4, 0 ; <i1> [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
182 br i1 %toBool, label %bb, label %bb1
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
183
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
184 bb: ; preds = %entry
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
185 load %struct.FILE** @__stderrp, align 4 ; <%struct.FILE*>:5 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
186 load i8** %filename_addr, align 4 ; <i8*>:6 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
187 call i32 (%struct.FILE*, i8*, ...)* @fprintf( %struct.FILE* %5, i8* getelementptr ([15 x i8]* @"\01LC2", i32 0, i32 0), i8* %6 ) nounwind ; <i32>:7 [#uses=0]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
188 br label %bb1
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
189
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
190 bb1: ; preds = %bb, %entry
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
191 load %struct.FILE** %f, align 4 ; <%struct.FILE*>:8 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
192 call i32 @setvbuf( %struct.FILE* %8, i8* getelementptr ([1048576 x i8]* @readbuf, i32 0, i32 0), i32 0, i32 1048576 ) nounwind ; <i32>:9 [#uses=0]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
193 load i8** %regexp_addr, align 4 ; <i8*>:10 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
194 load %struct.FILE** %f, align 4 ; <%struct.FILE*>:11 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
195 call void @grep( i8* %10, %struct.FILE* %11, i8* null ) nounwind
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
196 load %struct.FILE** %f, align 4 ; <%struct.FILE*>:12 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
197 call i32 @fclose( %struct.FILE* %12 ) nounwind ; <i32>:13 [#uses=0]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
198 br label %return
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
199
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
200 return: ; preds = %bb1
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
201 ret void
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
202 }
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
203
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
204 declare %struct.FILE* @fopen(i8*, i8*)
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
205
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
206 declare i32 @fprintf(%struct.FILE*, i8*, ...) nounwind
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
207
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
208 declare i32 @setvbuf(%struct.FILE*, i8*, i32, i32)
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
209
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
210 declare i32 @fclose(%struct.FILE*)
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
211
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
212 define void @llgrep_with_name(i8* %regexp, i8* %filename) nounwind {
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
213 entry:
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
214 %regexp_addr = alloca i8* ; <i8**> [#uses=2]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
215 %filename_addr = alloca i8* ; <i8**> [#uses=4]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
216 %f = alloca %struct.FILE* ; <%struct.FILE**> [#uses=5]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
217 %nmatch = alloca i32 ; <i32*> [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
218 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
219 store i8* %regexp, i8** %regexp_addr
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
220 store i8* %filename, i8** %filename_addr
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
221 store i32 0, i32* %nmatch, align 4
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
222 load i8** %filename_addr, align 4 ; <i8*>:0 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
223 call %struct.FILE* @fopen( i8* %0, i8* getelementptr ([2 x i8]* @"\01LC1", i32 0, i32 0) ) nounwind ; <%struct.FILE*>:1 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
224 store %struct.FILE* %1, %struct.FILE** %f, align 4
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
225 load %struct.FILE** %f, align 4 ; <%struct.FILE*>:2 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
226 icmp eq %struct.FILE* %2, null ; <i1>:3 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
227 zext i1 %3 to i8 ; <i8>:4 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
228 %toBool = icmp ne i8 %4, 0 ; <i1> [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
229 br i1 %toBool, label %bb, label %bb1
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
230
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
231 bb: ; preds = %entry
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
232 load %struct.FILE** @__stderrp, align 4 ; <%struct.FILE*>:5 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
233 load i8** %filename_addr, align 4 ; <i8*>:6 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
234 call i32 (%struct.FILE*, i8*, ...)* @fprintf( %struct.FILE* %5, i8* getelementptr ([15 x i8]* @"\01LC2", i32 0, i32 0), i8* %6 ) nounwind ; <i32>:7 [#uses=0]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
235 br label %bb1
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
236
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
237 bb1: ; preds = %bb, %entry
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
238 load %struct.FILE** %f, align 4 ; <%struct.FILE*>:8 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
239 call i32 @setvbuf( %struct.FILE* %8, i8* getelementptr ([1048576 x i8]* @readbuf, i32 0, i32 0), i32 0, i32 1048576 ) nounwind ; <i32>:9 [#uses=0]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
240 load i8** %regexp_addr, align 4 ; <i8*>:10 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
241 load %struct.FILE** %f, align 4 ; <%struct.FILE*>:11 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
242 load i8** %filename_addr, align 4 ; <i8*>:12 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
243 call void @grep( i8* %10, %struct.FILE* %11, i8* %12 ) nounwind
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
244 load %struct.FILE** %f, align 4 ; <%struct.FILE*>:13 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
245 call i32 @fclose( %struct.FILE* %13 ) nounwind ; <i32>:14 [#uses=0]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
246 br label %return
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
247
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
248 return: ; preds = %bb1
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
249 ret void
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
250 }
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
251
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
252 define i32 @main(i32 %argc, i8** %argv) nounwind {
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
253 entry:
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
254 %argc_addr = alloca i32 ; <i32*> [#uses=5]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
255 %argv_addr = alloca i8** ; <i8***> [#uses=6]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
256 %retval = alloca i32 ; <i32*> [#uses=2]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
257 %f = alloca %struct.FILE* ; <%struct.FILE**> [#uses=5]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
258 %i = alloca i32 ; <i32*> [#uses=7]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
259 alloca i32 ; <i32*>:0 [#uses=2]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
260 %iftmp.5 = alloca i8* ; <i8**> [#uses=3]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
261 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
262 store i32 %argc, i32* %argc_addr
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
263 store i8** %argv, i8*** %argv_addr
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
264 load i32* %argc_addr, align 4 ; <i32>:1 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
265 icmp sle i32 %1, 1 ; <i1>:2 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
266 zext i1 %2 to i8 ; <i8>:3 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
267 %toBool = icmp ne i8 %3, 0 ; <i1> [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
268 br i1 %toBool, label %bb, label %bb1
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
269
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
270 bb: ; preds = %entry
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
271 load %struct.FILE** @__stderrp, align 4 ; <%struct.FILE*>:4 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
272 bitcast %struct.FILE* %4 to i8* ; <i8*>:5 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
273 call i32 @"\01_fwrite$UNIX2003"( i8* getelementptr ([30 x i8]* @"\01LC3", i32 0, i32 0), i32 1, i32 29, i8* %5 ) nounwind ; <i32>:6 [#uses=0]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
274 call void @exit( i32 0 ) noreturn nounwind
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
275 unreachable
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
276
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
277 bb1: ; preds = %entry
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
278 load i32* %argc_addr, align 4 ; <i32>:7 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
279 icmp eq i32 %7, 2 ; <i1>:8 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
280 zext i1 %8 to i8 ; <i8>:9 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
281 %toBool2 = icmp ne i8 %9, 0 ; <i1> [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
282 br i1 %toBool2, label %bb3, label %bb4
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
283
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
284 bb3: ; preds = %bb1
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
285 load %struct.FILE** @__stdinp, align 4 ; <%struct.FILE*>:10 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
286 load i8*** %argv_addr, align 4 ; <i8**>:11 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
287 getelementptr i8** %11, i32 1 ; <i8**>:12 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
288 load i8** %12, align 4 ; <i8*>:13 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
289 call void @grep( i8* %13, %struct.FILE* %10, i8* null ) nounwind
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
290 br label %bb16
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
291
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
292 bb4: ; preds = %bb1
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
293 store i32 2, i32* %i, align 4
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
294 br label %bb14
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
295
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
296 bb5: ; preds = %bb14
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
297 load i8*** %argv_addr, align 4 ; <i8**>:14 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
298 load i32* %i, align 4 ; <i32>:15 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
299 getelementptr i8** %14, i32 %15 ; <i8**>:16 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
300 load i8** %16, align 4 ; <i8*>:17 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
301 call %struct.FILE* @fopen( i8* %17, i8* getelementptr ([2 x i8]* @"\01LC1", i32 0, i32 0) ) nounwind ; <%struct.FILE*>:18 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
302 store %struct.FILE* %18, %struct.FILE** %f, align 4
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
303 load %struct.FILE** %f, align 4 ; <%struct.FILE*>:19 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
304 icmp eq %struct.FILE* %19, null ; <i1>:20 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
305 zext i1 %20 to i8 ; <i8>:21 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
306 %toBool6 = icmp ne i8 %21, 0 ; <i1> [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
307 br i1 %toBool6, label %bb7, label %bb8
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
308
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
309 bb7: ; preds = %bb5
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
310 load i8*** %argv_addr, align 4 ; <i8**>:22 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
311 load i32* %i, align 4 ; <i32>:23 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
312 getelementptr i8** %22, i32 %23 ; <i8**>:24 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
313 load i8** %24, align 4 ; <i8*>:25 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
314 load %struct.FILE** @__stderrp, align 4 ; <%struct.FILE*>:26 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
315 call i32 (%struct.FILE*, i8*, ...)* @fprintf( %struct.FILE* %26, i8* getelementptr ([15 x i8]* @"\01LC2", i32 0, i32 0), i8* %25 ) nounwind ; <i32>:27 [#uses=0]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
316 br label %bb13
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
317
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
318 bb8: ; preds = %bb5
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
319 load %struct.FILE** %f, align 4 ; <%struct.FILE*>:28 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
320 call i32 @setvbuf( %struct.FILE* %28, i8* getelementptr ([1048576 x i8]* @readbuf, i32 0, i32 0), i32 0, i32 1048576 ) nounwind ; <i32>:29 [#uses=0]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
321 load i32* %argc_addr, align 4 ; <i32>:30 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
322 icmp sgt i32 %30, 3 ; <i1>:31 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
323 zext i1 %31 to i8 ; <i8>:32 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
324 %toBool9 = icmp ne i8 %32, 0 ; <i1> [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
325 br i1 %toBool9, label %bb10, label %bb11
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
326
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
327 bb10: ; preds = %bb8
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
328 load i8*** %argv_addr, align 4 ; <i8**>:33 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
329 load i32* %i, align 4 ; <i32>:34 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
330 getelementptr i8** %33, i32 %34 ; <i8**>:35 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
331 load i8** %35, align 4 ; <i8*>:36 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
332 store i8* %36, i8** %iftmp.5, align 4
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
333 br label %bb12
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
334
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
335 bb11: ; preds = %bb8
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
336 store i8* null, i8** %iftmp.5, align 4
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
337 br label %bb12
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
338
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
339 bb12: ; preds = %bb11, %bb10
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
340 load i8*** %argv_addr, align 4 ; <i8**>:37 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
341 getelementptr i8** %37, i32 1 ; <i8**>:38 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
342 load i8** %38, align 4 ; <i8*>:39 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
343 load %struct.FILE** %f, align 4 ; <%struct.FILE*>:40 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
344 load i8** %iftmp.5, align 4 ; <i8*>:41 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
345 call void @grep( i8* %39, %struct.FILE* %40, i8* %41 ) nounwind
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
346 load %struct.FILE** %f, align 4 ; <%struct.FILE*>:42 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
347 call i32 @fclose( %struct.FILE* %42 ) nounwind ; <i32>:43 [#uses=0]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
348 br label %bb13
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
349
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
350 bb13: ; preds = %bb12, %bb7
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
351 load i32* %i, align 4 ; <i32>:44 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
352 add i32 %44, 1 ; <i32>:45 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
353 store i32 %45, i32* %i, align 4
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
354 br label %bb14
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
355
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
356 bb14: ; preds = %bb13, %bb4
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
357 load i32* %i, align 4 ; <i32>:46 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
358 load i32* %argc_addr, align 4 ; <i32>:47 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
359 icmp slt i32 %46, %47 ; <i1>:48 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
360 zext i1 %48 to i8 ; <i8>:49 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
361 %toBool15 = icmp ne i8 %49, 0 ; <i1> [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
362 br i1 %toBool15, label %bb5, label %bb16
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
363
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
364 bb16: ; preds = %bb14, %bb3
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
365 store i32 0, i32* %0, align 4
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
366 load i32* %0, align 4 ; <i32>:50 [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
367 store i32 %50, i32* %retval, align 4
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
368 br label %return
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
369
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
370 return: ; preds = %bb16
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
371 %retval17 = load i32* %retval ; <i32> [#uses=1]
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
372 ret i32 %retval17
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
373 }
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
374
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
375 declare i32 @"\01_fwrite$UNIX2003"(i8*, i32, i32, i8*)
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
376
71fa409932bd add llgrep.py, llvm_grep_translataor.py. these module requre llvm-py(and of course LLVM) to translate/execute.
Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
377 declare void @exit(i32) noreturn nounwind