@@ -61,8 +61,7 @@ static void clean_up_one_instruction(struct basic_block *bb, struct instruction
case OP_AND: case OP_OR:
/* Binary logical */
- case OP_XOR: case OP_AND_BOOL:
- case OP_OR_BOOL:
+ case OP_XOR:
/* Binary comparison */
case OP_SET_EQ: case OP_SET_NE:
@@ -192,7 +191,6 @@ static int insn_compare(const void *_i1, const void *_i2)
/* commutative binop */
case OP_ADD:
case OP_MULU: case OP_MULS:
- case OP_AND_BOOL: case OP_OR_BOOL:
case OP_AND: case OP_OR:
case OP_XOR:
case OP_SET_EQ: case OP_SET_NE:
@@ -46,8 +46,6 @@ static const char *opcodes[] = {
[OP_AND] = "and",
[OP_OR] = "or",
[OP_XOR] = "xor",
- [OP_AND_BOOL] = "and-bool",
- [OP_OR_BOOL] = "or-bool",
/* Binary comparison */
[OP_SET_EQ] = "seteq",
@@ -1406,7 +1404,6 @@ static void generate_one_insn(struct instruction *insn, struct bb_state *state)
case OP_ADD: case OP_MULU: case OP_MULS:
case OP_AND: case OP_OR: case OP_XOR:
- case OP_AND_BOOL: case OP_OR_BOOL:
generate_commutative_binop(state, insn);
break;
@@ -199,8 +199,6 @@ static const char *opcodes[] = {
[OP_AND] = "and",
[OP_OR] = "or",
[OP_XOR] = "xor",
- [OP_AND_BOOL] = "and-bool",
- [OP_OR_BOOL] = "or-bool",
/* Binary comparison */
[OP_SET_EQ] = "seteq",
@@ -175,9 +175,7 @@ enum opcode {
OP_AND,
OP_OR,
OP_XOR,
- OP_AND_BOOL,
- OP_OR_BOOL,
- OP_BINARY_END = OP_OR_BOOL,
+ OP_BINARY_END = OP_XOR,
/* floating-point comparison */
OP_FPCMP,
@@ -475,11 +475,6 @@ static int simplify_constant_rightside(struct instruction *insn)
long long bits = sbit | (sbit - 1);
switch (insn->opcode) {
- case OP_OR_BOOL:
- if (value == 1)
- return replace_with_pseudo(insn, insn->src2);
- goto case_neutral_zero;
-
case OP_OR:
if ((value & bits) == bits)
return replace_with_pseudo(insn, insn->src2);
@@ -518,10 +513,6 @@ static int simplify_constant_rightside(struct instruction *insn)
case OP_MULU: case OP_MULS:
return simplify_mul_div(insn, value);
- case OP_AND_BOOL:
- if (value == 1)
- return replace_with_pseudo(insn, insn->src1);
- /* Fall through */
case OP_AND:
if ((value & bits) == bits)
return replace_with_pseudo(insn, insn->src1);
@@ -631,13 +622,6 @@ static int simplify_constant_binop(struct instruction *insn)
case OP_XOR:
res = left ^ right;
break;
- case OP_AND_BOOL:
- res = left && right;
- break;
- case OP_OR_BOOL:
- res = left || right;
- break;
-
/* Binary comparison */
case OP_SET_EQ:
res = left == right;
@@ -701,13 +685,6 @@ static int simplify_binop_same_args(struct instruction *insn, pseudo_t arg)
case OP_OR:
return replace_with_pseudo(insn, arg);
- case OP_AND_BOOL:
- case OP_OR_BOOL:
- remove_usage(arg, &insn->src2);
- insn->src2 = value_pseudo(0);
- insn->opcode = OP_SET_NE;
- return REPEAT_CSE;
-
default:
break;
}
@@ -1190,7 +1167,6 @@ int simplify_instruction(struct instruction *insn)
switch (insn->opcode) {
case OP_ADD: case OP_MULS:
case OP_AND: case OP_OR: case OP_XOR:
- case OP_AND_BOOL: case OP_OR_BOOL:
canonicalize_commutative(insn);
if (simplify_binop(insn))
return REPEAT_CSE;
Now that OP_AND_BOOL and OP_OR_BOOL are not generated anymore we can remove all related code & defines. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> --- cse.c | 4 +--- example.c | 3 --- linearize.c | 2 -- linearize.h | 4 +--- simplify.c | 24 ------------------------ 5 files changed, 2 insertions(+), 35 deletions(-)