|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
static bool |
|
|
static bool |
|
|
try_constant_propagation(struct brw_context *brw, vec4_instruction *inst, |
|
|
|
|
|
int arg, src_reg *values[4]) |
|
|
|
|
|
|
|
|
try_constant_propagate(struct brw_context *brw, vec4_instruction *inst, |
|
|
|
|
|
int arg, src_reg *values[4]) |
|
|
{ |
|
|
{ |
|
|
/* For constant propagation, we only handle the same constant |
|
|
/* For constant propagation, we only handle the same constant |
|
|
* across all 4 channels. Some day, we should handle the 8-bit |
|
|
* across all 4 channels. Some day, we should handle the 8-bit |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
bool |
|
|
bool |
|
|
vec4_visitor::try_copy_propagation(vec4_instruction *inst, int arg, |
|
|
|
|
|
src_reg *values[4]) |
|
|
|
|
|
|
|
|
vec4_visitor::try_copy_propagate(vec4_instruction *inst, int arg, |
|
|
|
|
|
src_reg *values[4]) |
|
|
{ |
|
|
{ |
|
|
/* For constant propagation, we only handle the same constant |
|
|
/* For constant propagation, we only handle the same constant |
|
|
* across all 4 channels. Some day, we should handle the 8-bit |
|
|
* across all 4 channels. Some day, we should handle the 8-bit |
|
|
|
|
|
|
|
|
if (c != 4) |
|
|
if (c != 4) |
|
|
continue; |
|
|
continue; |
|
|
|
|
|
|
|
|
if (try_constant_propagation(brw, inst, i, values) || |
|
|
|
|
|
try_copy_propagation(inst, i, values)) |
|
|
|
|
|
|
|
|
if (try_constant_propagate(brw, inst, i, values) || |
|
|
|
|
|
try_copy_propagate(inst, i, values)) |
|
|
progress = true; |
|
|
progress = true; |
|
|
} |
|
|
} |
|
|
|
|
|
|