Resolve value aliases when legalizing instructions.

Since we're deconstructing an instruction anyway, go ahead and resolve
any value aliases on its arguments before we construct the replacement
instructions.
This commit is contained in:
Jakob Stoklund Olesen
2016-11-04 15:54:58 -07:00
parent 453a1b2d17
commit be3577ad7e
2 changed files with 24 additions and 4 deletions

View File

@@ -63,11 +63,11 @@ def unwrap_inst(iref, node, fmt):
else:
# This is a value operand.
if nvops == 1:
outs.append(prefix + 'arg')
arg = prefix + 'arg'
else:
outs.append(
'{}args[{}]'.format(
prefix, iform.value_operands.index(i)))
arg = '{}args[{}]'.format(
prefix, iform.value_operands.index(i))
outs.append('dfg.resolve_aliases({})'.format(arg))
fmt.line('({})'.format(', '.join(outs)))
fmt.outdented_line('} else {')
fmt.line('unreachable!("bad instruction format")')