[llvm] [AArch64][SVE] Use SVE for scalar FP converts in streaming[-compatible] functions (PR #112564)

Benjamin Maxwell via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 24 08:27:28 PDT 2024


================
@@ -45,9 +45,11 @@ entry:
 define double @s32_to_f64(i32 %x) {
 ; CHECK-LABEL: s32_to_f64:
 ; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    fmov s0, w0
+; CHECK-NEXT:    // kill: def $w0 killed $w0 def $x0
+; CHECK-NEXT:    sxtw x8, w0
 ; CHECK-NEXT:    ptrue p0.d
-; CHECK-NEXT:    scvtf z0.d, p0/m, z0.s
+; CHECK-NEXT:    fmov d0, x8
+; CHECK-NEXT:    scvtf z0.d, p0/m, z0.d
 ; CHECK-NEXT:    // kill: def $d0 killed $d0 killed $z0
----------------
MacDue wrote:

This is quite sad in cases like:
```
  %conv = fptosi double %x to i32
  %conv1 = sitofp i32 %conv to double
```
which now become:
```
	fcvtzs	z0.d, p0/m, z0.d
	fmov	x8, d0
	sxtw	x8, w8
	fmov	d0, x8
	scvtf	z0.d, p0/m, z0.d
```
Though maybe some more folds could fix that. 

https://github.com/llvm/llvm-project/pull/112564


More information about the llvm-commits mailing list