diff --git a/ir_fold.h b/ir_fold.h index a2d49f4..976e889 100644 --- a/ir_fold.h +++ b/ir_fold.h @@ -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); } diff --git a/tests/010.irt b/tests/010.irt index f3162f2..028a669 100644 --- a/tests/010.irt +++ b/tests/010.irt @@ -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); diff --git a/tests/013.irt b/tests/013.irt index eb33661..4444526 100644 --- a/tests/013.irt +++ b/tests/013.irt @@ -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); diff --git a/tests/016.irt b/tests/016.irt index 4f6c171..711f0ee 100644 --- a/tests/016.irt +++ b/tests/016.irt @@ -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); diff --git a/tests/019.irt b/tests/019.irt index 0dc78ac..3646e10 100644 --- a/tests/019.irt +++ b/tests/019.irt @@ -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); diff --git a/tests/debug.Windows-x86_64/combo_002.irt b/tests/debug.Windows-x86_64/combo_002.irt index c25d3a7..37a9a5a 100755 --- a/tests/debug.Windows-x86_64/combo_002.irt +++ b/tests/debug.Windows-x86_64/combo_002.irt @@ -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); diff --git a/tests/debug.Windows-x86_64/combo_003.irt b/tests/debug.Windows-x86_64/combo_003.irt index 5298cb5..1db36bf 100755 --- a/tests/debug.Windows-x86_64/combo_003.irt +++ b/tests/debug.Windows-x86_64/combo_003.irt @@ -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); diff --git a/tests/debug.aarch64/combo_002.irt b/tests/debug.aarch64/combo_002.irt index 37c992e..4134f6a 100644 --- a/tests/debug.aarch64/combo_002.irt +++ b/tests/debug.aarch64/combo_002.irt @@ -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); diff --git a/tests/debug.aarch64/combo_003.irt b/tests/debug.aarch64/combo_003.irt index 55b1306..876e6f9 100644 --- a/tests/debug.aarch64/combo_003.irt +++ b/tests/debug.aarch64/combo_003.irt @@ -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); diff --git a/tests/debug.x86/combo_002.irt b/tests/debug.x86/combo_002.irt index 207fcf5..1d8ddc6 100644 --- a/tests/debug.x86/combo_002.irt +++ b/tests/debug.x86/combo_002.irt @@ -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); diff --git a/tests/debug.x86/combo_003.irt b/tests/debug.x86/combo_003.irt index ee48511..9b25c11 100644 --- a/tests/debug.x86/combo_003.irt +++ b/tests/debug.x86/combo_003.irt @@ -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); diff --git a/tests/debug/combo_002.irt b/tests/debug/combo_002.irt index 195cc19..36342f6 100644 --- a/tests/debug/combo_002.irt +++ b/tests/debug/combo_002.irt @@ -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); diff --git a/tests/debug/combo_003.irt b/tests/debug/combo_003.irt index c1c7791..faab2ee 100644 --- a/tests/debug/combo_003.irt +++ b/tests/debug/combo_003.irt @@ -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);