irbuilder-tests.uir 956 Bytes
Newer Older
Kunshan Wang's avatar
Kunshan Wang committed
1 2
.const @NULLIREFI8 <@irefi8> = NULL

3 4 5 6
.const @MYFIRSTCONST <@i64> = 49

.const @I32_64 <@i32> = 64

Kunshan Wang's avatar
Kunshan Wang committed
7 8 9
.typedef @myname_t = array<@i8 32>
.global @g_myname <@myname_t>

Kunshan Wang's avatar
Kunshan Wang committed
10 11 12 13
.funcdef @irbuilder_test VERSION %v1 <@v_v> {
    %entry():
        %irb = COMMINST @uvm.irbuilder.new_ir_builder
        %id1 = COMMINST @uvm.irbuilder.gen_sym (%irb @NULLIREFI8)
Kunshan Wang's avatar
Kunshan Wang committed
14 15
        %g_myname_0 = GETELEMIREF <@myname_t @i64> @g_myname @I64_0
        %id2 = COMMINST @uvm.irbuilder.gen_sym (%irb %g_myname_0)
16 17 18 19
        COMMINST @uvm.irbuilder.new_type_int(%irb %id1 @I32_64)

        %my_second_const = ADD <@i64> @MYFIRSTCONST @I64_1
        COMMINST @uvm.irbuilder.new_const_int(%irb %id2 %id1 %my_second_const)
Kunshan Wang's avatar
Kunshan Wang committed
20 21 22 23 24

        [%trap] TRAP <> KEEPALIVE (%irb %id1)

        COMMINST @uvm.irbuilder.load(%irb)

25 26
        %my_second_const_byid = COMMINST @uvm.meta.constant_by_id <@i32> (%id2)

Kunshan Wang's avatar
Kunshan Wang committed
27
        [%trap2] TRAP <> KEEPALIVE (%my_second_const_byid %id2)
28

Kunshan Wang's avatar
Kunshan Wang committed
29 30
        COMMINST @uvm.thread_exit
}