machinst lowering: update inst color when scanning across branch to allow more load-op merging.
A branch is considered side-effecting and so updates the instruction color (which is our way of computing how far instructions can sink). However, in the lowering loop, we did not update current instruction color when scanning backward across branches, which are side-effecting. As a result, the color was stale and fewer load-op merges were permitted than are actually possible. Note that this would not have resulted in any correctness issues, as the stale color is too high (so no merges are permitted that should have been disallowed). Fixes #2562.
This commit is contained in:
@@ -59,3 +59,14 @@ block0(v0: i64, v1: i64):
|
||||
; nextln: movq 0(%rax,%rdi,1), %rsi
|
||||
; nextln: movq %rsi, %rax
|
||||
}
|
||||
|
||||
function %merge_scalar_to_vector(i64) -> i32x4 {
|
||||
block0(v0: i64):
|
||||
v1 = load.i32 v0
|
||||
v2 = scalar_to_vector.i32x4 v1
|
||||
; check: movss 0(%rdi), %xmm0
|
||||
|
||||
jump block1
|
||||
block1:
|
||||
return v2
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user