Create value aliases when necessary.

If a secondary value in the source pattern becomes a primary value in
the destination pattern, it is not possible to overwrite the definition
of the source value.

Instead, change the original source value to an alias to the new promary
value.
This commit is contained in:
Jakob Stoklund Olesen
2016-11-04 14:49:31 -07:00
parent d34ec1bd06
commit 6f1a60366f
2 changed files with 13 additions and 0 deletions

View File

@@ -16,3 +16,6 @@ ebb0(v1: i32, v2: i32):
}
; 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: return $v3, $v4