From c716d86c8d887a3adbc52c369264fda50d961f84 Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Thu, 13 Apr 2017 09:45:36 -0700 Subject: [PATCH] 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. --- lib/cretonne/src/legalizer/split.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/cretonne/src/legalizer/split.rs b/lib/cretonne/src/legalizer/split.rs index 3c03d1d77b..764448b5bc 100644 --- a/lib/cretonne/src/legalizer/split.rs +++ b/lib/cretonne/src/legalizer/split.rs @@ -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.