mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-04-04 00:10:52 +00:00
Generate only one daglabel for value operands.
As each value is now unique, their labels can also be unique, which will improve CSE.
This commit is contained in:
parent
16869cabd1
commit
0c58cd9067
2 changed files with 12 additions and 3 deletions
|
@ -158,6 +158,7 @@ typedef struct {
|
|||
|
||||
typedef struct ex_value_s {
|
||||
struct ex_value_s *next;
|
||||
struct daglabel_s *daglabel;///< dag label for this value
|
||||
etype_t type;
|
||||
union {
|
||||
const char *string_val; ///< string constant
|
||||
|
|
|
@ -89,6 +89,7 @@ operand_label (operand_t *op)
|
|||
{
|
||||
operand_t *o;
|
||||
symbol_t *sym = 0;
|
||||
ex_value_t *val = 0;
|
||||
daglabel_t *label;
|
||||
|
||||
if (!op)
|
||||
|
@ -108,11 +109,18 @@ operand_label (operand_t *op)
|
|||
label = new_label ();
|
||||
label->op = op;
|
||||
sym->daglabel = label;
|
||||
} else {
|
||||
if (o->op_type != op_value && o->op_type != op_pointer)
|
||||
debug (0, "unexpected operand type: %d", o->op_type);
|
||||
} else if (o->op_type == op_value) {
|
||||
val = o->o.value;
|
||||
if (val->daglabel)
|
||||
return val->daglabel;
|
||||
label = new_label ();
|
||||
label->op = op;
|
||||
val->daglabel = label;
|
||||
} else if (o->op_type == op_pointer) {
|
||||
label = new_label ();
|
||||
label->op = op;
|
||||
} else {
|
||||
internal_error (0, "unexpected operand type: %d", o->op_type);
|
||||
}
|
||||
return label;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue