Update
This commit is contained in:
parent
b6b5090c4c
commit
8312cd92c6
13 changed files with 139 additions and 113 deletions
20
bytecode.md
20
bytecode.md
|
@ -53,18 +53,18 @@ entry:
|
|||
%tobool = icmp ne i32 %rem, 0
|
||||
br i1 %tobool, label %cond.true, label %cond.false
|
||||
|
||||
cond.true: ; preds = %entry
|
||||
cond.true: ; preds = %entry
|
||||
%1 = load i32, i32* %n.addr, align 4
|
||||
%mul = mul nsw i32 3, %1
|
||||
%add = add nsw i32 %mul, 1
|
||||
br label %cond.end
|
||||
|
||||
cond.false: ; preds = %entry
|
||||
cond.false: ; preds = %entry
|
||||
%2 = load i32, i32* %n.addr, align 4
|
||||
%div = sdiv i32 %2, 2
|
||||
br label %cond.end
|
||||
|
||||
cond.end: ; preds = %cond.false, %cond.true
|
||||
cond.end: ; preds = %cond.false, %cond.true
|
||||
%cond = phi i32 [ %add, %cond.true ], [ %div, %cond.false ]
|
||||
ret i32 %cond
|
||||
}
|
||||
|
@ -80,23 +80,23 @@ entry:
|
|||
store i32 %sub, i32* %n, align 4
|
||||
br label %while.body
|
||||
|
||||
while.body: ; preds = %entry, %if.end
|
||||
while.body: ; preds = %entry, %if.end
|
||||
%0 = load i32, i32* %n, align 4
|
||||
%call1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32 %0)
|
||||
%call1 = call i32 (i8*, ...) @printf(i8* ... )
|
||||
%1 = load i32, i32* %n, align 4
|
||||
%cmp = icmp eq i32 %1, 1
|
||||
br i1 %cmp, label %if.then, label %if.end
|
||||
|
||||
if.then: ; preds = %while.body
|
||||
if.then: ; preds = %while.body
|
||||
br label %while.end
|
||||
|
||||
if.end: ; preds = %while.body
|
||||
if.end: ; preds = %while.body
|
||||
%2 = load i32, i32* %n, align 4
|
||||
%call2 = call i32 @next(i32 %2)
|
||||
store i32 %call2, i32* %n, align 4
|
||||
br label %while.body
|
||||
|
||||
while.end: ; preds = %if.then
|
||||
while.end: ; preds = %if.then
|
||||
ret i32 0
|
||||
}
|
||||
|
||||
|
@ -104,8 +104,8 @@ declare i32 @getchar(...) #1
|
|||
|
||||
declare i32 @printf(i8*, ...) #1
|
||||
|
||||
attributes #0 = { noinline nounwind optnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-features"="+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
|
||||
attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-features"="+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
|
||||
attributes #0 = { ... }
|
||||
attributes #1 = { ... }
|
||||
|
||||
!llvm.module.flags = !{!0}
|
||||
!llvm.ident = !{!1}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue