Added type compatibility assertion and fixed mistakes in tests

This commit is contained in:
Dmitry Stogov 2023-05-22 20:48:07 +03:00
parent d1fcaa3e63
commit 75edc8fec5
13 changed files with 19 additions and 18 deletions

View File

@ -1152,6 +1152,7 @@ IR_FOLD(FP2FP(C_DOUBLE))
/* Copy Propagation */
IR_FOLD(COPY(_))
{
IR_ASSERT(IR_OPT_TYPE(opt) == op1_insn->type);
if (!op2) {
IR_FOLD_COPY(op1);
}

View File

@ -11,7 +11,7 @@
int32_t c_5 = 2;
l_1 = START(l_20);
bool d_2 = PARAM(l_1, "cond", 0);
bool d_3 = COPY(c_4);
int32_t d_3 = COPY(c_4);
l_4 = END(l_1);
l_5 = LOOP_BEGIN(l_4, l_18);
int32_t d_6 = PHI(l_5, d_3, d_15);

View File

@ -12,8 +12,8 @@
l_1 = START(l_33);
bool d_2 = PARAM(l_1, "cond", 0);
int32_t d_3 = PARAM(l_1, "z", 1);
bool d_4 = COPY(c_4);
bool d_5 = COPY(d_3);
int32_t d_4 = COPY(c_4);
int32_t d_5 = COPY(d_3);
l_6 = END(l_1);
l_7 = LOOP_BEGIN(l_6, l_31);
int32_t d_8 = PHI(l_7, d_4, d_19);

View File

@ -11,7 +11,7 @@
int32_t c_5 = 2;
l_1 = START(l_20);
bool d_2 = PARAM(l_1, "cond", 0);
bool d_3 = COPY(c_4);
int32_t d_3 = COPY(c_4);
l_4 = END(l_1);
l_5 = LOOP_BEGIN(l_4, l_18);
int32_t d_6 = PHI(l_5, d_3, d_15);

View File

@ -10,8 +10,8 @@
l_1 = START(l_33);
bool d_2 = PARAM(l_1, "cond", 0);
int32_t d_3 = PARAM(l_1, "z", 1);
bool d_4 = COPY(c_4);
bool d_5 = COPY(d_3);
int32_t d_4 = COPY(c_4);
int32_t d_5 = COPY(d_3);
l_6 = END(l_1);
l_7 = LOOP_BEGIN(l_6, l_31);
int32_t d_8 = PHI(l_7, d_4, d_19);

View File

@ -15,8 +15,8 @@ Windows-x86_64
l_1 = START(l_33);
bool d_2 = PARAM(l_1, "cond", 0);
int32_t d_3 = PARAM(l_1, "z", 1);
bool d_4 = COPY(c_4);
bool d_5 = COPY(d_3);
int32_t d_4 = COPY(c_4);
int32_t d_5 = COPY(d_3);
l_6 = END(l_1);
l_7 = LOOP_BEGIN(l_6, l_31);
int32_t d_8 = PHI(l_7, d_4, d_19);

View File

@ -14,7 +14,7 @@ Windows-x86_64
l_1 = START(l_34);
bool d_2 = PARAM(l_1, "cond", 0);
int32_t d_3 = PARAM(l_1, "z", 1);
bool d_4 = COPY(c_4);
int32_t d_4 = COPY(c_4);
int32_t d_5 = COPY(d_3);
l_6 = END(l_1);
l_7 = LOOP_BEGIN(l_6, l_31);

View File

@ -15,8 +15,8 @@ aarch64
l_1 = START(l_34);
bool d_2 = PARAM(l_1, "cond", 0);
int32_t d_3 = PARAM(l_1, "z", 1);
bool d_4 = COPY(c_4);
bool d_5 = COPY(d_3);
int32_t d_4 = COPY(c_4);
int32_t d_5 = COPY(d_3);
l_6 = END(l_1);
l_7 = LOOP_BEGIN(l_6, l_31);
int32_t d_8 = PHI(l_7, d_4, d_19);

View File

@ -14,7 +14,7 @@ aarch64
l_1 = START(l_34);
bool d_2 = PARAM(l_1, "cond", 0);
int32_t d_3 = PARAM(l_1, "z", 1);
bool d_4 = COPY(c_4);
int32_t d_4 = COPY(c_4);
int32_t d_5 = COPY(d_3);
l_6 = END(l_1);
l_7 = LOOP_BEGIN(l_6, l_31);

View File

@ -15,8 +15,8 @@ x86
l_1 = START(l_34);
bool d_2 = PARAM(l_1, "cond", 0);
int32_t d_3 = PARAM(l_1, "z", 1);
bool d_4 = COPY(c_4);
bool d_5 = COPY(d_3);
int32_t d_4 = COPY(c_4);
int32_t d_5 = COPY(d_3);
l_6 = END(l_1);
l_7 = LOOP_BEGIN(l_6, l_31);
int32_t d_8 = PHI(l_7, d_4, d_19);

View File

@ -14,7 +14,7 @@ x86
l_1 = START(l_34);
bool d_2 = PARAM(l_1, "cond", 0);
int32_t d_3 = PARAM(l_1, "z", 1);
bool d_4 = COPY(c_4);
int32_t d_4 = COPY(c_4);
int32_t d_5 = COPY(d_3);
l_6 = END(l_1);
l_7 = LOOP_BEGIN(l_6, l_31);

View File

@ -15,8 +15,8 @@ x86_64
l_1 = START(l_33);
bool d_2 = PARAM(l_1, "cond", 0);
int32_t d_3 = PARAM(l_1, "z", 1);
bool d_4 = COPY(c_4);
bool d_5 = COPY(d_3);
int32_t d_4 = COPY(c_4);
int32_t d_5 = COPY(d_3);
l_6 = END(l_1);
l_7 = LOOP_BEGIN(l_6, l_31);
int32_t d_8 = PHI(l_7, d_4, d_19);

View File

@ -14,7 +14,7 @@ x86_64
l_1 = START(l_34);
bool d_2 = PARAM(l_1, "cond", 0);
int32_t d_3 = PARAM(l_1, "z", 1);
bool d_4 = COPY(c_4);
int32_t d_4 = COPY(c_4);
int32_t d_5 = COPY(d_3);
l_6 = END(l_1);
l_7 = LOOP_BEGIN(l_6, l_31);