Avoid creating value aliases in legalizer/split.rs.

When we're splitting an EBB argument, we insert a iconcat/vconcat
instruction that computes the original value from the new split
arguments.

The concat instruction can now define the original value directly, it is
not necessary to define a new value and alias the old one.
This commit is contained in:
Jakob Stoklund Olesen
2017-04-13 09:45:36 -07:00
parent d48f79aa72
commit 7ad882c154

View File

@@ -228,9 +228,9 @@ fn split_value(dfg: &mut DataFlowGraph,
// need to insert a split instruction before returning. // need to insert a split instruction before returning.
pos.goto_top(ebb); pos.goto_top(ebb);
pos.next_inst(); pos.next_inst();
let concat_inst = dfg.ins(pos).Binary(concat, split_type, lo, hi).0; dfg.ins(pos)
let concat_val = dfg.first_result(concat_inst); .with_result(value)
dfg.change_to_alias(value, concat_val); .Binary(concat, split_type, lo, hi);
// Finally, splitting the EBB argument is not enough. We also have to repair all // Finally, splitting the EBB argument is not enough. We also have to repair all
// of the predecessor instructions that branch here. // of the predecessor instructions that branch here.