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 3ae0fe6e2b
commit c716d86c8d

View File

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