2 * Simplify - do instruction simplification before CSE
4 * Copyright (C) 2004 Linus Torvalds
10 #include "expression.h"
11 #include "linearize.h"
15 /* Find the trivial parent for a phi-source */
16 static struct basic_block
*phi_parent(struct basic_block
*source
, pseudo_t pseudo
)
18 /* Can't go upwards if the pseudo is defined in the bb it came from.. */
19 if (pseudo
->type
== PSEUDO_REG
) {
20 struct instruction
*def
= pseudo
->def
;
21 if (def
->bb
== source
)
24 if (bb_list_size(source
->children
) != 1 || bb_list_size(source
->parents
) != 1)
26 return first_basic_block(source
->parents
);
29 static int if_convert_phi(struct instruction
*insn
)
32 struct basic_block
*parents
[3];
33 struct basic_block
*bb
, *bb1
, *bb2
, *source
;
34 struct instruction
*br
;
38 if (linearize_ptr_list((struct ptr_list
*)insn
->phi_list
, (void **)array
, 3) != 2)
40 if (linearize_ptr_list((struct ptr_list
*)bb
->parents
, (void **)parents
, 3) != 2)
42 p1
= array
[0]->def
->src1
;
43 bb1
= array
[0]->def
->bb
;
44 p2
= array
[1]->def
->src1
;
45 bb2
= array
[1]->def
->bb
;
47 /* Only try the simple "direct parents" case */
48 if ((bb1
!= parents
[0] || bb2
!= parents
[1]) &&
49 (bb1
!= parents
[1] || bb2
!= parents
[0]))
53 * See if we can find a common source for this..
55 source
= phi_parent(bb1
, p1
);
56 if (source
!= phi_parent(bb2
, p2
))
60 * Cool. We now know that 'source' is the exclusive
61 * parent of both phi-nodes, so the exit at the
62 * end of it fully determines which one it is, and
63 * we can turn it into a select.
65 * HOWEVER, right now we only handle regular
66 * conditional branches. No multijumps or computed
67 * stuff. Verify that here.
69 br
= last_instruction(source
->insns
);
70 if (!br
|| br
->opcode
!= OP_BR
)
77 * We're in business. Match up true/false with p1/p2.
79 if (br
->bb_true
== bb2
|| br
->bb_false
== bb1
) {
86 * OK, we can now replace that last
93 * select pseudo, p1, p2
96 * and remove the phi-node. If it then
97 * turns out that 'a' or 'b' is entirely
98 * empty (common case), and now no longer
99 * a phi-source, we'll be able to simplify
100 * the conditional branch too.
102 insert_select(source
, br
, insn
, p1
, p2
);
103 kill_instruction(insn
);
107 static int clean_up_phi(struct instruction
*insn
)
110 struct instruction
*last
;
115 FOR_EACH_PTR(insn
->phi_list
, phi
) {
116 struct instruction
*def
;
120 if (def
->src1
== VOID
|| !def
->bb
)
123 if (last
->src1
!= def
->src1
)
128 } END_FOR_EACH_PTR(phi
);
131 pseudo_t pseudo
= last
? last
->src1
: VOID
;
132 convert_instruction_target(insn
, pseudo
);
133 kill_instruction(insn
);
137 return if_convert_phi(insn
);
140 static int delete_pseudo_user_list_entry(struct pseudo_user_list
**list
, pseudo_t
*entry
, int count
)
142 struct pseudo_user
*pu
;
144 FOR_EACH_PTR(*list
, pu
) {
145 if (pu
->userp
== entry
) {
146 DELETE_CURRENT_PTR(pu
);
150 } END_FOR_EACH_PTR(pu
);
153 pack_ptr_list((struct ptr_list
**)list
);
157 static inline void remove_usage(pseudo_t p
, pseudo_t
*usep
)
159 if (has_use_list(p
)) {
160 delete_pseudo_user_list_entry(&p
->users
, usep
, 1);
162 kill_instruction(p
->def
);
166 void kill_use(pseudo_t
*usep
)
171 remove_usage(p
, usep
);
175 static void kill_use_list(struct pseudo_list
*list
)
178 FOR_EACH_PTR(list
, p
) {
181 kill_use(THIS_ADDRESS(p
));
182 } END_FOR_EACH_PTR(p
);
186 * kill an instruction:
187 * - remove it from its bb
188 * - remove the usage of all its operands
189 * If forse is zero, the normal case, the function only for
190 * instructions free of (possible) side-effects. Otherwise
191 * the function does that unconditionally (must only be used
192 * for unreachable instructions.
194 void kill_insn(struct instruction
*insn
, int force
)
196 if (!insn
|| !insn
->bb
)
199 switch (insn
->opcode
) {
202 kill_use(&insn
->src3
);
205 case OP_BINARY
... OP_BINCMP_END
:
206 kill_use(&insn
->src2
);
214 case OP_NOT
: case OP_NEG
:
216 kill_use(&insn
->src1
);
220 kill_use_list(insn
->phi_list
);
223 kill_use(&insn
->phi_src
);
227 repeat_phase
|= REPEAT_SYMBOL_CLEANUP
;
231 if (!insn
->bb_true
|| !insn
->bb_false
)
235 case OP_COMPUTEDGOTO
:
236 kill_use(&insn
->cond
);
241 /* a "pure" function can be killed too */
242 if (!(insn
->func
->type
== PSEUDO_SYM
))
244 if (!(insn
->func
->sym
->ctype
.modifiers
& MOD_PURE
))
247 kill_use_list(insn
->arguments
);
248 if (insn
->func
->type
== PSEUDO_REG
)
249 kill_use(&insn
->func
);
253 if (!force
&& insn
->type
->ctype
.modifiers
& MOD_VOLATILE
)
255 kill_use(&insn
->src
);
261 kill_use(&insn
->src
);
262 kill_use(&insn
->target
);
274 repeat_phase
|= REPEAT_CSE
;
279 * Kill trivially dead instructions
281 static int dead_insn(struct instruction
*insn
, pseudo_t
*src1
, pseudo_t
*src2
, pseudo_t
*src3
)
283 struct pseudo_user
*pu
;
284 FOR_EACH_PTR(insn
->target
->users
, pu
) {
285 if (*pu
->userp
!= VOID
)
287 } END_FOR_EACH_PTR(pu
);
296 static inline int constant(pseudo_t pseudo
)
298 return pseudo
->type
== PSEUDO_VAL
;
301 static int replace_with_pseudo(struct instruction
*insn
, pseudo_t pseudo
)
303 convert_instruction_target(insn
, pseudo
);
305 switch (insn
->opcode
) {
308 kill_use(&insn
->src3
);
309 case OP_BINARY
... OP_BINCMP_END
:
310 kill_use(&insn
->src2
);
318 kill_use(&insn
->src1
);
328 static unsigned int value_size(long long value
)
343 * Try to determine the maximum size of bits in a pseudo.
345 * Right now this only follow casts and constant values, but we
346 * could look at things like logical 'and' instructions etc.
348 static unsigned int operand_size(struct instruction
*insn
, pseudo_t pseudo
)
350 unsigned int size
= insn
->size
;
352 if (pseudo
->type
== PSEUDO_REG
) {
353 struct instruction
*src
= pseudo
->def
;
354 if (src
&& src
->opcode
== OP_CAST
&& src
->orig_type
) {
355 unsigned int orig_size
= src
->orig_type
->bit_size
;
356 if (orig_size
< size
)
360 if (pseudo
->type
== PSEUDO_VAL
) {
361 unsigned int orig_size
= value_size(pseudo
->value
);
362 if (orig_size
< size
)
368 static int simplify_asr(struct instruction
*insn
, pseudo_t pseudo
, long long value
)
370 unsigned int size
= operand_size(insn
, pseudo
);
373 warning(insn
->pos
, "right shift by bigger than source value");
374 return replace_with_pseudo(insn
, value_pseudo(0));
377 return replace_with_pseudo(insn
, pseudo
);
381 static int simplify_mul_div(struct instruction
*insn
, long long value
)
383 unsigned long long sbit
= 1ULL << (insn
->size
- 1);
384 unsigned long long bits
= sbit
| (sbit
- 1);
387 return replace_with_pseudo(insn
, insn
->src1
);
389 switch (insn
->opcode
) {
393 return replace_with_pseudo(insn
, insn
->src2
);
396 if (!(value
& sbit
)) // positive
401 insn
->opcode
= OP_NEG
;
409 static int compare_opcode(int opcode
, int inverse
)
415 case OP_SET_EQ
: return OP_SET_NE
;
416 case OP_SET_NE
: return OP_SET_EQ
;
418 case OP_SET_LT
: return OP_SET_GE
;
419 case OP_SET_LE
: return OP_SET_GT
;
420 case OP_SET_GT
: return OP_SET_LE
;
421 case OP_SET_GE
: return OP_SET_LT
;
423 case OP_SET_A
: return OP_SET_BE
;
424 case OP_SET_AE
: return OP_SET_B
;
425 case OP_SET_B
: return OP_SET_AE
;
426 case OP_SET_BE
: return OP_SET_A
;
433 static int simplify_seteq_setne(struct instruction
*insn
, long long value
)
435 struct instruction
*def
= insn
->src1
->def
;
440 if (value
!= 0 && value
!= 1)
446 inverse
= (insn
->opcode
== OP_SET_NE
) == value
;
447 opcode
= def
->opcode
;
449 case OP_BINCMP
... OP_BINCMP_END
:
451 // setcc.n %t <- %a, %b
452 // setne.m %r <- %t, $0
454 // setcc.n %t <- %a, %b
455 // setcc.m %r <- %a, $b
456 // and similar for setne/eq ... 0/1
459 remove_usage(insn
->src1
, &insn
->src1
);
460 insn
->opcode
= compare_opcode(opcode
, inverse
);
461 use_pseudo(insn
, src1
, &insn
->src1
);
462 use_pseudo(insn
, src2
, &insn
->src2
);
470 static int simplify_constant_rightside(struct instruction
*insn
)
472 long long value
= insn
->src2
->value
;
474 switch (insn
->opcode
) {
477 return replace_with_pseudo(insn
, insn
->src2
);
478 goto case_neutral_zero
;
482 insn
->opcode
= OP_ADD
;
483 insn
->src2
= value_pseudo(-value
);
488 case OP_OR
: case OP_XOR
:
493 return replace_with_pseudo(insn
, insn
->src1
);
496 return simplify_asr(insn
, insn
->src1
, value
);
498 case OP_MODU
: case OP_MODS
:
500 return replace_with_pseudo(insn
, value_pseudo(0));
503 case OP_DIVU
: case OP_DIVS
:
504 case OP_MULU
: case OP_MULS
:
505 return simplify_mul_div(insn
, value
);
509 return replace_with_pseudo(insn
, insn
->src1
);
513 return replace_with_pseudo(insn
, insn
->src2
);
518 return simplify_seteq_setne(insn
, value
);
523 static int simplify_constant_leftside(struct instruction
*insn
)
525 long long value
= insn
->src1
->value
;
527 switch (insn
->opcode
) {
528 case OP_ADD
: case OP_OR
: case OP_XOR
:
530 return replace_with_pseudo(insn
, insn
->src2
);
534 case OP_LSR
: case OP_ASR
:
536 case OP_MULU
: case OP_MULS
:
538 return replace_with_pseudo(insn
, insn
->src1
);
544 static int simplify_constant_binop(struct instruction
*insn
)
546 /* FIXME! Verify signs and sizes!! */
547 long long left
= insn
->src1
->value
;
548 long long right
= insn
->src2
->value
;
549 unsigned long long ul
, ur
;
550 long long res
, mask
, bits
;
552 mask
= 1ULL << (insn
->size
-1);
553 bits
= mask
| (mask
-1);
562 switch (insn
->opcode
) {
583 if (left
== mask
&& right
== -1)
595 if (left
== mask
&& right
== -1)
625 /* Binary comparison */
661 replace_with_pseudo(insn
, value_pseudo(res
));
665 static int simplify_binop_same_args(struct instruction
*insn
, pseudo_t arg
)
667 switch (insn
->opcode
) {
669 case OP_SET_LT
: case OP_SET_GT
:
670 case OP_SET_B
: case OP_SET_A
:
671 if (Wtautological_compare
)
672 warning(insn
->pos
, "self-comparison always evaluates to false");
675 return replace_with_pseudo(insn
, value_pseudo(0));
678 case OP_SET_LE
: case OP_SET_GE
:
679 case OP_SET_BE
: case OP_SET_AE
:
680 if (Wtautological_compare
)
681 warning(insn
->pos
, "self-comparison always evaluates to true");
682 return replace_with_pseudo(insn
, value_pseudo(1));
686 return replace_with_pseudo(insn
, arg
);
690 remove_usage(arg
, &insn
->src2
);
691 insn
->src2
= value_pseudo(0);
692 insn
->opcode
= OP_SET_NE
;
702 static int simplify_binop(struct instruction
*insn
)
704 if (dead_insn(insn
, &insn
->src1
, &insn
->src2
, NULL
))
706 if (constant(insn
->src1
)) {
707 if (constant(insn
->src2
))
708 return simplify_constant_binop(insn
);
709 return simplify_constant_leftside(insn
);
711 if (constant(insn
->src2
))
712 return simplify_constant_rightside(insn
);
713 if (insn
->src1
== insn
->src2
)
714 return simplify_binop_same_args(insn
, insn
->src1
);
718 static void switch_pseudo(struct instruction
*insn1
, pseudo_t
*pp1
, struct instruction
*insn2
, pseudo_t
*pp2
)
720 pseudo_t p1
= *pp1
, p2
= *pp2
;
722 use_pseudo(insn1
, p2
, pp1
);
723 use_pseudo(insn2
, p1
, pp2
);
724 remove_usage(p1
, pp1
);
725 remove_usage(p2
, pp2
);
728 static int canonical_order(pseudo_t p1
, pseudo_t p2
)
730 /* symbol/constants on the right */
731 if (p1
->type
== PSEUDO_VAL
)
732 return p2
->type
== PSEUDO_VAL
;
734 if (p1
->type
== PSEUDO_SYM
)
735 return p2
->type
== PSEUDO_SYM
|| p2
->type
== PSEUDO_VAL
;
740 static int simplify_commutative_binop(struct instruction
*insn
)
742 if (!canonical_order(insn
->src1
, insn
->src2
)) {
743 switch_pseudo(insn
, &insn
->src1
, insn
, &insn
->src2
);
749 static inline int simple_pseudo(pseudo_t pseudo
)
751 return pseudo
->type
== PSEUDO_VAL
|| pseudo
->type
== PSEUDO_SYM
;
754 static int simplify_associative_binop(struct instruction
*insn
)
756 struct instruction
*def
;
757 pseudo_t pseudo
= insn
->src1
;
759 if (!simple_pseudo(insn
->src2
))
761 if (pseudo
->type
!= PSEUDO_REG
)
766 if (def
->opcode
!= insn
->opcode
)
768 if (!simple_pseudo(def
->src2
))
770 if (ptr_list_size((struct ptr_list
*)def
->target
->users
) != 1)
772 switch_pseudo(def
, &def
->src1
, insn
, &insn
->src2
);
776 static int simplify_constant_unop(struct instruction
*insn
)
778 long long val
= insn
->src1
->value
;
781 switch (insn
->opcode
) {
791 mask
= 1ULL << (insn
->size
-1);
792 res
&= mask
| (mask
-1);
794 replace_with_pseudo(insn
, value_pseudo(res
));
798 static int simplify_unop(struct instruction
*insn
)
800 if (dead_insn(insn
, &insn
->src1
, NULL
, NULL
))
802 if (constant(insn
->src1
))
803 return simplify_constant_unop(insn
);
805 switch (insn
->opcode
) {
806 struct instruction
*def
;
809 def
= insn
->src
->def
;
810 if (def
&& def
->opcode
== OP_NOT
)
811 return replace_with_pseudo(insn
, def
->src
);
814 def
= insn
->src
->def
;
815 if (def
&& def
->opcode
== OP_NEG
)
816 return replace_with_pseudo(insn
, def
->src
);
824 static int simplify_one_memop(struct instruction
*insn
, pseudo_t orig
)
826 pseudo_t addr
= insn
->src
;
829 if (addr
->type
== PSEUDO_REG
) {
830 struct instruction
*def
= addr
->def
;
831 if (def
->opcode
== OP_SYMADDR
&& def
->src
) {
832 kill_use(&insn
->src
);
833 use_pseudo(insn
, def
->src
, &insn
->src
);
834 return REPEAT_CSE
| REPEAT_SYMBOL_CLEANUP
;
836 if (def
->opcode
== OP_ADD
) {
856 warning(insn
->pos
, "crazy programmer");
858 insn
->offset
+= off
->value
;
859 use_pseudo(insn
, new, &insn
->src
);
860 remove_usage(addr
, &insn
->src
);
861 return REPEAT_CSE
| REPEAT_SYMBOL_CLEANUP
;
865 * We walk the whole chain of adds/subs backwards. That's not
866 * only more efficient, but it allows us to find loops.
868 static int simplify_memop(struct instruction
*insn
)
871 pseudo_t orig
= insn
->src
;
874 one
= simplify_one_memop(insn
, orig
);
880 static long long get_cast_value(long long val
, int old_size
, int new_size
, int sign
)
884 if (sign
&& new_size
> old_size
) {
885 mask
= 1 << (old_size
-1);
887 val
|= ~(mask
| (mask
-1));
889 mask
= 1 << (new_size
-1);
890 return val
& (mask
| (mask
-1));
893 static int simplify_cast(struct instruction
*insn
)
895 struct symbol
*orig_type
;
899 if (dead_insn(insn
, &insn
->src
, NULL
, NULL
))
902 orig_type
= insn
->orig_type
;
906 /* Keep casts with pointer on either side (not only case of OP_PTRCAST) */
907 if (is_ptr_type(orig_type
) || is_ptr_type(insn
->type
))
910 orig_size
= orig_type
->bit_size
;
914 /* A cast of a constant? */
916 int sign
= orig_type
->ctype
.modifiers
& MOD_SIGNED
;
917 long long val
= get_cast_value(src
->value
, orig_size
, size
, sign
);
918 src
= value_pseudo(val
);
922 /* A cast of a "and" might be a no-op.. */
923 if (src
->type
== PSEUDO_REG
) {
924 struct instruction
*def
= src
->def
;
925 if (def
->opcode
== OP_AND
&& def
->size
>= size
) {
926 pseudo_t val
= def
->src2
;
927 if (val
->type
== PSEUDO_VAL
) {
928 unsigned long long value
= val
->value
;
929 if (!(value
>> (size
-1)))
935 if (size
== orig_size
) {
936 int op
= (orig_type
->ctype
.modifiers
& MOD_SIGNED
) ? OP_SCAST
: OP_CAST
;
937 if (insn
->opcode
== op
)
939 if (insn
->opcode
== OP_FPCAST
&& is_float_type(orig_type
))
946 return replace_with_pseudo(insn
, src
);
949 static int simplify_select(struct instruction
*insn
)
951 pseudo_t cond
, src1
, src2
;
953 if (dead_insn(insn
, &insn
->src1
, &insn
->src2
, &insn
->src3
))
959 if (constant(cond
) || src1
== src2
) {
960 pseudo_t
*kill
, take
;
961 kill_use(&insn
->src1
);
962 take
= cond
->value
? src1
: src2
;
963 kill
= cond
->value
? &insn
->src3
: &insn
->src2
;
965 replace_with_pseudo(insn
, take
);
968 if (constant(src1
) && constant(src2
)) {
969 long long val1
= src1
->value
;
970 long long val2
= src2
->value
;
972 /* The pair 0/1 is special - replace with SETNE/SETEQ */
973 if ((val1
| val2
) == 1) {
974 int opcode
= OP_SET_EQ
;
979 insn
->opcode
= opcode
;
980 /* insn->src1 is already cond */
981 insn
->src2
= src1
; /* Zero */
988 static int is_in_range(pseudo_t src
, long long low
, long long high
)
995 return value
>= low
&& value
<= high
;
1001 static int simplify_range(struct instruction
*insn
)
1003 pseudo_t src1
, src2
, src3
;
1008 if (src2
->type
!= PSEUDO_VAL
|| src3
->type
!= PSEUDO_VAL
)
1010 if (is_in_range(src1
, src2
->value
, src3
->value
)) {
1011 kill_instruction(insn
);
1018 * Simplify "set_ne/eq $0 + br"
1020 static int simplify_cond_branch(struct instruction
*br
, pseudo_t cond
, struct instruction
*def
, pseudo_t
*pp
)
1022 use_pseudo(br
, *pp
, &br
->cond
);
1023 remove_usage(cond
, &br
->cond
);
1024 if (def
->opcode
== OP_SET_EQ
) {
1025 struct basic_block
*true = br
->bb_true
;
1026 struct basic_block
*false = br
->bb_false
;
1027 br
->bb_false
= true;
1028 br
->bb_true
= false;
1033 static int simplify_branch(struct instruction
*insn
)
1035 pseudo_t cond
= insn
->cond
;
1040 /* Constant conditional */
1041 if (constant(cond
)) {
1042 insert_branch(insn
->bb
, insn
, cond
->value
? insn
->bb_true
: insn
->bb_false
);
1047 if (insn
->bb_true
== insn
->bb_false
) {
1048 struct basic_block
*bb
= insn
->bb
;
1049 struct basic_block
*target
= insn
->bb_false
;
1050 remove_bb_from_list(&target
->parents
, bb
, 1);
1051 remove_bb_from_list(&bb
->children
, target
, 1);
1052 insn
->bb_false
= NULL
;
1053 kill_use(&insn
->cond
);
1058 /* Conditional on a SETNE $0 or SETEQ $0 */
1059 if (cond
->type
== PSEUDO_REG
) {
1060 struct instruction
*def
= cond
->def
;
1062 if (def
->opcode
== OP_SET_NE
|| def
->opcode
== OP_SET_EQ
) {
1063 if (constant(def
->src1
) && !def
->src1
->value
)
1064 return simplify_cond_branch(insn
, cond
, def
, &def
->src2
);
1065 if (constant(def
->src2
) && !def
->src2
->value
)
1066 return simplify_cond_branch(insn
, cond
, def
, &def
->src1
);
1068 if (def
->opcode
== OP_SEL
) {
1069 if (constant(def
->src2
) && constant(def
->src3
)) {
1070 long long val1
= def
->src2
->value
;
1071 long long val2
= def
->src3
->value
;
1072 if (!val1
&& !val2
) {
1073 insert_branch(insn
->bb
, insn
, insn
->bb_false
);
1077 insert_branch(insn
->bb
, insn
, insn
->bb_true
);
1081 struct basic_block
*true = insn
->bb_true
;
1082 struct basic_block
*false = insn
->bb_false
;
1083 insn
->bb_false
= true;
1084 insn
->bb_true
= false;
1086 use_pseudo(insn
, def
->src1
, &insn
->cond
);
1087 remove_usage(cond
, &insn
->cond
);
1091 if (def
->opcode
== OP_CAST
|| def
->opcode
== OP_SCAST
) {
1092 int orig_size
= def
->orig_type
? def
->orig_type
->bit_size
: 0;
1093 if (def
->size
> orig_size
) {
1094 use_pseudo(insn
, def
->src
, &insn
->cond
);
1095 remove_usage(cond
, &insn
->cond
);
1103 static int simplify_switch(struct instruction
*insn
)
1105 pseudo_t cond
= insn
->cond
;
1107 struct multijmp
*jmp
;
1109 if (!constant(cond
))
1111 val
= insn
->cond
->value
;
1113 FOR_EACH_PTR(insn
->multijmp_list
, jmp
) {
1115 if (jmp
->begin
> jmp
->end
)
1117 if (val
>= jmp
->begin
&& val
<= jmp
->end
)
1119 } END_FOR_EACH_PTR(jmp
);
1120 warning(insn
->pos
, "Impossible case statement");
1124 insert_branch(insn
->bb
, insn
, jmp
->target
);
1128 int simplify_instruction(struct instruction
*insn
)
1132 switch (insn
->opcode
) {
1133 case OP_ADD
: case OP_MULS
:
1134 case OP_AND
: case OP_OR
: case OP_XOR
:
1135 case OP_AND_BOOL
: case OP_OR_BOOL
:
1136 if (simplify_binop(insn
))
1138 if (simplify_commutative_binop(insn
))
1140 return simplify_associative_binop(insn
);
1143 case OP_SET_EQ
: case OP_SET_NE
:
1144 if (simplify_binop(insn
))
1146 return simplify_commutative_binop(insn
);
1149 case OP_DIVU
: case OP_DIVS
:
1150 case OP_MODU
: case OP_MODS
:
1152 case OP_LSR
: case OP_ASR
:
1153 case OP_SET_LE
: case OP_SET_GE
:
1154 case OP_SET_LT
: case OP_SET_GT
:
1155 case OP_SET_B
: case OP_SET_A
:
1156 case OP_SET_BE
: case OP_SET_AE
:
1157 return simplify_binop(insn
);
1159 case OP_NOT
: case OP_NEG
:
1160 return simplify_unop(insn
);
1161 case OP_LOAD
: case OP_STORE
:
1162 return simplify_memop(insn
);
1164 if (dead_insn(insn
, NULL
, NULL
, NULL
))
1165 return REPEAT_CSE
| REPEAT_SYMBOL_CLEANUP
;
1166 return replace_with_pseudo(insn
, insn
->symbol
);
1171 return simplify_cast(insn
);
1173 if (dead_insn(insn
, NULL
, NULL
, NULL
)) {
1174 kill_use_list(insn
->phi_list
);
1177 return clean_up_phi(insn
);
1179 if (dead_insn(insn
, &insn
->phi_src
, NULL
, NULL
))
1183 return simplify_select(insn
);
1185 return simplify_branch(insn
);
1187 return simplify_switch(insn
);
1189 return simplify_range(insn
);