Avoid creating aliases when expanding legalizer patterns.

Now that we can detach and reuse all values, there is no longer a need
to create a lot of alias values during pattern expansion. Instead, reuse
the values from the source pattern when emitting instructions in the
destination pattern.

If a destination instruction produces the exact same values as a source
instruction, simply leave the values attached and replace the
instruction it. Otherwise, detach the source values, reuse them in the
expansion, and remove the source instruction afterwards.
This commit is contained in:
Jakob Stoklund Olesen
2017-04-12 17:19:28 -07:00
parent e582183619
commit 3ae0fe6e2b
2 changed files with 43 additions and 47 deletions

View File

@@ -15,9 +15,7 @@ ebb0(v1: i32, v2: i32):
return v3, v4
}
; check: $v3 = iadd $v1, $v2
; check: $(cout=$V) = icmp ult $v3, $v1
; It's possible the legalizer will rewrite these value aliases in the future.
; check: $v4 -> $cout
; check: $v4 = icmp ult $v3, $v1
; check: return $v3, $v4
; Expanding illegal immediate constants.