ir/tests/008.irt

127 lines
2.7 KiB
Plaintext
Raw Normal View History

2022-04-05 23:19:23 +02:00
--TEST--
008: CFG for a larger loop (Figure 8 from "Global Code Motion Global Value Numbering" by Cliff Click)
--ARGS--
--dump-cfg --dump-after-gcm
--CODE--
{
uintptr_t c_1 = 0;
bool c_2 = 0;
bool c_3 = 1;
int32_t c_4 = 1;
int32_t c_5 = 4;
l_1 = START(l_54);
int32_t d_2 = PARAM(l_1, "a", 0);
int32_t d_3 = PARAM(l_1, "b", 1);
int32_t d_4 = PARAM(l_1, "c", 2);
int32_t d_5 = PARAM(l_1, "d", 3);
int32_t d_6 = PARAM(l_1, "l", 4);
int32_t d_7 = PARAM(l_1, "m", 5);
int32_t d_8 = PARAM(l_1, "s", 6);
int32_t d_9 = PARAM(l_1, "t", 7);
int32_t d_10 = PARAM(l_1, "cond1", 8);
int32_t d_11 = PARAM(l_1, "cond2", 9);
l_12 = END(l_1);
l_13 = LOOP_BEGIN(l_12, l_42);
int32_t d_14 = PHI(l_13, d_2, d_32);
int32_t d_15 = PHI(l_13, d_5, d_33);
int32_t d_16 = PHI(l_13, d_7, d_35);
int32_t d_17 = PHI(l_13, d_8, d_36);
int32_t d_18 = PHI(l_13, d_9, d_37);
l_19 = IF(l_13, d_10);
l_20 = IF_TRUE(l_19);
int32_t d_21 = MUL(d_4, d_3);
int32_t d_22 = ADD(d_21, c_5);
int32_t d_23 = COPY(d_4);
l_24 = END(l_20);
l_25 = IF_FALSE(l_19);
int32_t d_26 = COPY(d_4);
int32_t d_27 = MUL(d_26, d_3);
int32_t d_28 = MUL(d_14, d_3);
int32_t d_29 = ADD(d_28, c_4);
l_30 = END(l_25);
l_31 = MERGE(l_24, l_30);
int32_t d_32 = PHI(l_31, d_23, d_14);
int32_t d_33 = PHI(l_31, d_15, d_26);
int32_t d_34 = PHI(l_31, d_21, d_27);
int32_t d_35 = PHI(l_31, d_22, d_16);
int32_t d_36 = PHI(l_31, d_17, d_28);
int32_t d_37 = PHI(l_31, d_18, d_29);
int32_t d_38 = MUL(d_32, d_3);
int32_t d_39 = ADD(d_38, c_4);
l_40 = IF(l_31, d_11);
l_41 = IF_TRUE(l_40);
l_42 = LOOP_END(l_41);
2022-04-05 23:19:23 +02:00
l_43 = IF_FALSE(l_40);
2022-06-15 16:27:31 +02:00
int32_t d_44 = ADD(d_32, d_3);
int32_t d_45 = ADD(d_44, d_4);
int32_t d_46 = ADD(d_45, d_33);
int32_t d_47 = ADD(d_46, d_34);
int32_t d_48 = ADD(d_47, d_35);
int32_t d_49 = ADD(d_48, d_36);
int32_t d_50 = ADD(d_49, d_37);
int32_t d_51 = ADD(d_50, d_39);
l_54 = RETURN(l_43, d_51);
2022-04-05 23:19:23 +02:00
}
--EXPECT--
{ # CFG
BB1:
start=1
end=12
successors(1) [BB2]
dom_depth=0
dom_children [BB2]
BB2:
start=13
end=19
successors(2) [BB3, BB4]
predecessors(2) [BB1, BB6]
dom_parent=BB1
dom_depth=1
dom_children [BB3, BB4, BB5]
LOOP_HEADER
loop_depth=1
BB3:
start=20
end=23
successors(1) [BB5]
predecessors(1) [BB2]
dom_parent=BB2
dom_depth=2
loop_header=BB2
loop_depth=1
BB4:
start=24
end=27
successors(1) [BB5]
predecessors(1) [BB2]
dom_parent=BB2
dom_depth=2
loop_header=BB2
loop_depth=1
BB5:
start=28
end=36
successors(2) [BB6, BB7]
predecessors(2) [BB3, BB4]
dom_parent=BB2
dom_depth=2
dom_children [BB6, BB7]
loop_header=BB2
loop_depth=1
BB6:
start=37
end=38
successors(1) [BB2]
predecessors(1) [BB5]
dom_parent=BB5
dom_depth=3
loop_header=BB2
loop_depth=1
BB7:
start=39
2022-06-15 16:27:31 +02:00
end=48
2022-04-05 23:19:23 +02:00
predecessors(1) [BB5]
dom_parent=BB5
dom_depth=3
}