Files
cs420/examples/ir3/foo3.ir
Chunmyong Park d64e9f622e Update grader
2020-07-02 06:54:19 +00:00

30 lines
464 B
Plaintext

var i32 @g = 10
var i32 @nonce = default
fun i32 @foo (i32, i32) {
init:
bid: b0
allocations:
block b0:
%b0:p0:i32:i
%b0:p1:i32:j
%b0:i0:i32 = add %b0:p0:i32 %b0:p1:i32
%b0:i1:i32 = load @nonce:i32*
%b0:i2:i32 = add %b0:i0:i32 %b0:i1:i32
ret %b0:i2:i32
}
fun i32 @main () {
init:
bid: b0
allocations:
block b0:
%b0:i0:i32 = load @g:i32*
%b0:i1:i32 = call @foo:[ret:i32 params:(i32, i32)]*(%b0:i0:i32, %b0:i0:i32)
ret %b0:i1:i32
}