x64: Fix load sinking bugs in new lowerings (#4740)

Fixes #4736

Fix lowerings that were using values as both a Reg and a RegMem, making it look like a load could be sunk while its value in a register was still being used. Also add an assert that checks that loads that are sunk are never used.
This commit is contained in:
Trevor Elliott
2022-08-19 14:21:06 -07:00
committed by GitHub
parent fd98814b96
commit 754cf7156a
3 changed files with 57 additions and 16 deletions

View File

@@ -0,0 +1,20 @@
test compile precise-output
target x86_64
function u0:0(i64 vmctx, i8x16) -> i16x8 fast {
block0(v0: i64, v2: i8x16):
v5 = load.i8x16 notrap aligned table v0+80
v6 = uwiden_high v5
return v6
}
; pushq %rbp
; movq %rsp, %rbp
; block0:
; movdqu 80(%rdi), %xmm5
; palignr $8, %xmm5, %xmm5, %xmm5
; pmovzxbw %xmm5, %xmm0
; movq %rbp, %rsp
; popq %rbp
; ret