From: Rob Clark Date: Mon, 4 Apr 2016 21:34:57 +0000 (-0400) Subject: freedreno/ir3: don't cp into phi's X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8e451c2d06d18ee54dc3098b3987af6e0bc59f5e;p=mesa.git freedreno/ir3: don't cp into phi's The block defining a phi source might not have been executed. If we allow copy propagation, we could end up pointing to a src instruction in the wrong block. Signed-off-by: Rob Clark --- diff --git a/src/gallium/drivers/freedreno/ir3/ir3_cp.c b/src/gallium/drivers/freedreno/ir3/ir3_cp.c index 00fa3538cc0..f032f0bd53f 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_cp.c +++ b/src/gallium/drivers/freedreno/ir3/ir3_cp.c @@ -230,6 +230,12 @@ reg_cp(struct ir3_instruction *instr, struct ir3_register *reg, unsigned n) { struct ir3_instruction *src = ssa(reg); + /* don't propagate copies into a PHI, since we don't know if the + * src block executed: + */ + if (instr->opc == OPC_META_PHI) + return; + if (is_eligible_mov(src, true)) { /* simple case, no immed/const/relativ, only mov's w/ ssa src: */ struct ir3_register *src_reg = src->regs[1];