Fix lowering issue in x64 vany_true: sinking and using original value. (#4815)

The x64 lowring of `vany_true` both sinks mergeable loads and uses the
original register. This PR fixes the lowering to force the value into a
register first. Ideally we should solve the issue by catching this in
the ISLE type system, as described in #4745, but this resolves the issue
for now.

Fixes #4807.
This commit is contained in:
Chris Fallin
2022-08-29 22:22:12 -07:00
committed by GitHub
parent 2b4b257834
commit b1fb4d7c35
2 changed files with 10 additions and 1 deletions

View File

@@ -3640,7 +3640,8 @@
;; Rules for `vany_true` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Rules for `vany_true` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(rule (lower (vany_true val)) (rule (lower (vany_true val))
(with_flags (x64_ptest val val) (x64_setcc (CC.NZ)))) (let ((val Xmm val))
(with_flags (x64_ptest val val) (x64_setcc (CC.NZ)))))
;; Rules for `vall_true` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Rules for `vall_true` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View File

@@ -0,0 +1,8 @@
(module
(func (result i32)
global.get 0
v128.any_true
)
(global (;0;) (mut v128) v128.const i64x2 0 0)
)