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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user