diff options
| author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2018-11-02 11:06:18 +0000 |
|---|---|---|
| committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2018-11-02 11:06:18 +0000 |
| commit | cdcbeb4997a85895266b688b6077c48fbe1c4085 (patch) | |
| tree | 438fa676cd6db4c0b6f1ca30190f431433cacd63 /llvm/test/CodeGen/Mips/cconv | |
| parent | dfc56b43fadf5c4f84cdb8706f29ccf1ba68e5f1 (diff) | |
| download | bcm5719-llvm-cdcbeb4997a85895266b688b6077c48fbe1c4085.tar.gz bcm5719-llvm-cdcbeb4997a85895266b688b6077c48fbe1c4085.zip | |
[DAGCombiner] Remove reduceBuildVecConvertToConvertBuildVec and rely on the vectorizers instead (PR35732)
reduceBuildVecConvertToConvertBuildVec vectorizes int2float in the DAGCombiner, which means that even if the LV/SLP has decided to keep scalar code using the cost models, this will override this.
While there are cases where vectorization is necessary in the DAG (mainly due to legalization artefacts), I don't think this is the case here, we should assume that the vectorizers know what they are doing.
Differential Revision: https://reviews.llvm.org/D53712
llvm-svn: 345964
Diffstat (limited to 'llvm/test/CodeGen/Mips/cconv')
| -rw-r--r-- | llvm/test/CodeGen/Mips/cconv/vector.ll | 151 |
1 files changed, 108 insertions, 43 deletions
diff --git a/llvm/test/CodeGen/Mips/cconv/vector.ll b/llvm/test/CodeGen/Mips/cconv/vector.ll index d6e260786d1..9a55285feae 100644 --- a/llvm/test/CodeGen/Mips/cconv/vector.ll +++ b/llvm/test/CodeGen/Mips/cconv/vector.ll @@ -6181,14 +6181,15 @@ define float @mixed_i8(<2 x float> %a, i8 %b, <2 x float> %c) { ; MIPS32R5-NEXT: addiu $1, $zero, -16 ; MIPS32R5-NEXT: and $sp, $sp, $1 ; MIPS32R5-NEXT: andi $1, $6, 255 -; MIPS32R5-NEXT: sw $1, 36($sp) -; MIPS32R5-NEXT: sw $1, 32($sp) +; MIPS32R5-NEXT: mtc1 $1, $f0 +; MIPS32R5-NEXT: cvt.s.w $f0, $f0 +; MIPS32R5-NEXT: swc1 $f0, 36($sp) +; MIPS32R5-NEXT: swc1 $f0, 32($sp) ; MIPS32R5-NEXT: sw $5, 4($sp) ; MIPS32R5-NEXT: sw $4, 0($sp) -; MIPS32R5-NEXT: ld.w $w0, 32($sp) -; MIPS32R5-NEXT: ffint_s.w $w0, $w0 -; MIPS32R5-NEXT: ld.w $w1, 0($sp) -; MIPS32R5-NEXT: fadd.w $w0, $w0, $w1 +; MIPS32R5-NEXT: ld.w $w0, 0($sp) +; MIPS32R5-NEXT: ld.w $w1, 32($sp) +; MIPS32R5-NEXT: fadd.w $w0, $w1, $w0 ; MIPS32R5-NEXT: lw $1, 84($fp) ; MIPS32R5-NEXT: sw $1, 20($sp) ; MIPS32R5-NEXT: lw $1, 80($fp) @@ -6209,13 +6210,14 @@ define float @mixed_i8(<2 x float> %a, i8 %b, <2 x float> %c) { ; MIPS64R5-NEXT: .cfi_def_cfa_offset 48 ; MIPS64R5-NEXT: sll $1, $5, 0 ; MIPS64R5-NEXT: andi $1, $1, 255 -; MIPS64R5-NEXT: sw $1, 36($sp) -; MIPS64R5-NEXT: sw $1, 32($sp) +; MIPS64R5-NEXT: mtc1 $1, $f0 +; MIPS64R5-NEXT: cvt.s.w $f0, $f0 +; MIPS64R5-NEXT: swc1 $f0, 36($sp) +; MIPS64R5-NEXT: swc1 $f0, 32($sp) ; MIPS64R5-NEXT: sd $4, 0($sp) -; MIPS64R5-NEXT: ld.w $w0, 32($sp) -; MIPS64R5-NEXT: ffint_s.w $w0, $w0 -; MIPS64R5-NEXT: ld.w $w1, 0($sp) -; MIPS64R5-NEXT: fadd.w $w0, $w0, $w1 +; MIPS64R5-NEXT: ld.w $w0, 0($sp) +; MIPS64R5-NEXT: ld.w $w1, 32($sp) +; MIPS64R5-NEXT: fadd.w $w0, $w1, $w0 ; MIPS64R5-NEXT: sd $6, 16($sp) ; MIPS64R5-NEXT: ld.w $w1, 16($sp) ; MIPS64R5-NEXT: fadd.w $w0, $w0, $w1 @@ -6337,36 +6339,59 @@ define <4 x float> @mixed_32(<4 x float> %a, i32 %b) { ; MIPS64EB-NEXT: jr $ra ; MIPS64EB-NEXT: nop ; -; MIPS32R5-LABEL: mixed_32: -; MIPS32R5: # %bb.0: # %entry -; MIPS32R5-NEXT: ldi.b $w0, 0 -; MIPS32R5-NEXT: insert.w $w0[0], $6 -; MIPS32R5-NEXT: insert.w $w0[1], $7 -; MIPS32R5-NEXT: lw $1, 16($sp) -; MIPS32R5-NEXT: insert.w $w0[2], $1 -; MIPS32R5-NEXT: lw $1, 20($sp) -; MIPS32R5-NEXT: insert.w $w0[3], $1 -; MIPS32R5-NEXT: lw $1, 24($sp) -; MIPS32R5-NEXT: fill.w $w1, $1 -; MIPS32R5-NEXT: ffint_u.w $w1, $w1 -; MIPS32R5-NEXT: fadd.w $w0, $w1, $w0 -; MIPS32R5-NEXT: st.w $w0, 0($4) -; MIPS32R5-NEXT: jr $ra -; MIPS32R5-NEXT: nop +; MIPS32R5EB-LABEL: mixed_32: +; MIPS32R5EB: # %bb.0: # %entry +; MIPS32R5EB-NEXT: addiu $sp, $sp, -8 +; MIPS32R5EB-NEXT: .cfi_def_cfa_offset 8 +; MIPS32R5EB-NEXT: lui $1, 17200 +; MIPS32R5EB-NEXT: sw $1, 0($sp) +; MIPS32R5EB-NEXT: lw $1, 32($sp) +; MIPS32R5EB-NEXT: sw $1, 4($sp) +; MIPS32R5EB-NEXT: lui $1, %hi($CPI41_0) +; MIPS32R5EB-NEXT: ldc1 $f0, %lo($CPI41_0)($1) +; MIPS32R5EB-NEXT: ldc1 $f1, 0($sp) +; MIPS32R5EB-NEXT: sub.d $f0, $f1, $f0 +; MIPS32R5EB-NEXT: cvt.s.d $f0, $f0 +; MIPS32R5EB-NEXT: ldi.b $w1, 0 +; MIPS32R5EB-NEXT: splati.w $w0, $w0[0] +; MIPS32R5EB-NEXT: insert.w $w1[0], $6 +; MIPS32R5EB-NEXT: insert.w $w1[1], $7 +; MIPS32R5EB-NEXT: lw $1, 24($sp) +; MIPS32R5EB-NEXT: insert.w $w1[2], $1 +; MIPS32R5EB-NEXT: lw $1, 28($sp) +; MIPS32R5EB-NEXT: insert.w $w1[3], $1 +; MIPS32R5EB-NEXT: fadd.w $w0, $w0, $w1 +; MIPS32R5EB-NEXT: st.w $w0, 0($4) +; MIPS32R5EB-NEXT: addiu $sp, $sp, 8 +; MIPS32R5EB-NEXT: jr $ra +; MIPS32R5EB-NEXT: nop ; ; MIPS64R5EB-LABEL: mixed_32: ; MIPS64R5EB: # %bb.0: # %entry -; MIPS64R5EB-NEXT: ldi.b $w0, 0 -; MIPS64R5EB-NEXT: insert.d $w0[0], $4 -; MIPS64R5EB-NEXT: insert.d $w0[1], $5 -; MIPS64R5EB-NEXT: shf.w $w0, $w0, 177 -; MIPS64R5EB-NEXT: sll $1, $6, 0 -; MIPS64R5EB-NEXT: fill.w $w1, $1 -; MIPS64R5EB-NEXT: ffint_u.w $w1, $w1 -; MIPS64R5EB-NEXT: fadd.w $w0, $w1, $w0 +; MIPS64R5EB-NEXT: daddiu $sp, $sp, -16 +; MIPS64R5EB-NEXT: .cfi_def_cfa_offset 16 +; MIPS64R5EB-NEXT: lui $1, %hi(%neg(%gp_rel(mixed_32))) +; MIPS64R5EB-NEXT: daddu $1, $1, $25 +; MIPS64R5EB-NEXT: daddiu $1, $1, %lo(%neg(%gp_rel(mixed_32))) +; MIPS64R5EB-NEXT: lui $2, 17200 +; MIPS64R5EB-NEXT: sw $2, 8($sp) +; MIPS64R5EB-NEXT: sll $2, $6, 0 +; MIPS64R5EB-NEXT: sw $2, 12($sp) +; MIPS64R5EB-NEXT: ld $1, %got_page(.LCPI41_0)($1) +; MIPS64R5EB-NEXT: ldc1 $f0, %got_ofst(.LCPI41_0)($1) +; MIPS64R5EB-NEXT: ldc1 $f1, 8($sp) +; MIPS64R5EB-NEXT: sub.d $f0, $f1, $f0 +; MIPS64R5EB-NEXT: ldi.b $w1, 0 +; MIPS64R5EB-NEXT: insert.d $w1[0], $4 +; MIPS64R5EB-NEXT: insert.d $w1[1], $5 +; MIPS64R5EB-NEXT: shf.w $w1, $w1, 177 +; MIPS64R5EB-NEXT: cvt.s.d $f0, $f0 +; MIPS64R5EB-NEXT: splati.w $w0, $w0[0] +; MIPS64R5EB-NEXT: fadd.w $w0, $w0, $w1 ; MIPS64R5EB-NEXT: shf.w $w0, $w0, 177 ; MIPS64R5EB-NEXT: copy_s.d $2, $w0[0] ; MIPS64R5EB-NEXT: copy_s.d $3, $w0[1] +; MIPS64R5EB-NEXT: daddiu $sp, $sp, 16 ; MIPS64R5EB-NEXT: jr $ra ; MIPS64R5EB-NEXT: nop ; @@ -6445,17 +6470,57 @@ define <4 x float> @mixed_32(<4 x float> %a, i32 %b) { ; MIPS64EL-NEXT: jr $ra ; MIPS64EL-NEXT: nop ; +; MIPS32R5EL-LABEL: mixed_32: +; MIPS32R5EL: # %bb.0: # %entry +; MIPS32R5EL-NEXT: addiu $sp, $sp, -8 +; MIPS32R5EL-NEXT: .cfi_def_cfa_offset 8 +; MIPS32R5EL-NEXT: lui $1, 17200 +; MIPS32R5EL-NEXT: sw $1, 4($sp) +; MIPS32R5EL-NEXT: lw $1, 32($sp) +; MIPS32R5EL-NEXT: sw $1, 0($sp) +; MIPS32R5EL-NEXT: lui $1, %hi($CPI41_0) +; MIPS32R5EL-NEXT: ldc1 $f0, %lo($CPI41_0)($1) +; MIPS32R5EL-NEXT: ldc1 $f1, 0($sp) +; MIPS32R5EL-NEXT: sub.d $f0, $f1, $f0 +; MIPS32R5EL-NEXT: cvt.s.d $f0, $f0 +; MIPS32R5EL-NEXT: ldi.b $w1, 0 +; MIPS32R5EL-NEXT: splati.w $w0, $w0[0] +; MIPS32R5EL-NEXT: insert.w $w1[0], $6 +; MIPS32R5EL-NEXT: insert.w $w1[1], $7 +; MIPS32R5EL-NEXT: lw $1, 24($sp) +; MIPS32R5EL-NEXT: insert.w $w1[2], $1 +; MIPS32R5EL-NEXT: lw $1, 28($sp) +; MIPS32R5EL-NEXT: insert.w $w1[3], $1 +; MIPS32R5EL-NEXT: fadd.w $w0, $w0, $w1 +; MIPS32R5EL-NEXT: st.w $w0, 0($4) +; MIPS32R5EL-NEXT: addiu $sp, $sp, 8 +; MIPS32R5EL-NEXT: jr $ra +; MIPS32R5EL-NEXT: nop +; ; MIPS64R5EL-LABEL: mixed_32: ; MIPS64R5EL: # %bb.0: # %entry -; MIPS64R5EL-NEXT: ldi.b $w0, 0 -; MIPS64R5EL-NEXT: insert.d $w0[0], $4 -; MIPS64R5EL-NEXT: insert.d $w0[1], $5 -; MIPS64R5EL-NEXT: sll $1, $6, 0 -; MIPS64R5EL-NEXT: fill.w $w1, $1 -; MIPS64R5EL-NEXT: ffint_u.w $w1, $w1 -; MIPS64R5EL-NEXT: fadd.w $w0, $w1, $w0 +; MIPS64R5EL-NEXT: daddiu $sp, $sp, -16 +; MIPS64R5EL-NEXT: .cfi_def_cfa_offset 16 +; MIPS64R5EL-NEXT: lui $1, %hi(%neg(%gp_rel(mixed_32))) +; MIPS64R5EL-NEXT: daddu $1, $1, $25 +; MIPS64R5EL-NEXT: daddiu $1, $1, %lo(%neg(%gp_rel(mixed_32))) +; MIPS64R5EL-NEXT: lui $2, 17200 +; MIPS64R5EL-NEXT: sw $2, 12($sp) +; MIPS64R5EL-NEXT: sll $2, $6, 0 +; MIPS64R5EL-NEXT: sw $2, 8($sp) +; MIPS64R5EL-NEXT: ld $1, %got_page(.LCPI41_0)($1) +; MIPS64R5EL-NEXT: ldc1 $f0, %got_ofst(.LCPI41_0)($1) +; MIPS64R5EL-NEXT: ldc1 $f1, 8($sp) +; MIPS64R5EL-NEXT: sub.d $f0, $f1, $f0 +; MIPS64R5EL-NEXT: ldi.b $w1, 0 +; MIPS64R5EL-NEXT: insert.d $w1[0], $4 +; MIPS64R5EL-NEXT: insert.d $w1[1], $5 +; MIPS64R5EL-NEXT: cvt.s.d $f0, $f0 +; MIPS64R5EL-NEXT: splati.w $w0, $w0[0] +; MIPS64R5EL-NEXT: fadd.w $w0, $w0, $w1 ; MIPS64R5EL-NEXT: copy_s.d $2, $w0[0] ; MIPS64R5EL-NEXT: copy_s.d $3, $w0[1] +; MIPS64R5EL-NEXT: daddiu $sp, $sp, 16 ; MIPS64R5EL-NEXT: jr $ra ; MIPS64R5EL-NEXT: nop entry: |

