[llvm] DAG: Improve fminimum/fmaximum vector expansion logic (PR #93579)

Evgenii Kudriashov via llvm-commits llvm-commits at lists.llvm.org
Thu May 30 15:55:16 PDT 2024


================
@@ -28,35 +28,17 @@ define half @test_fminimum(half %x, half %y) {
 define <8 x half> @test_fminimum_scalarize(<8 x half> %x, <8 x half> %y) "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" {
----------------
e-kud wrote:

So the situation is the following: `FMINIMUM` and `FMAXIMUM` are set to `Expand` through `setF16Action` lambda. And I didn't set `v8f16` separately to `Custom` because I saw `SELECT` inside `setF16Action`. And since `FMINIMUM` lowering requires support of `SELECT` I decided that we need to support `SELECT` for `v8f16` first. Now I see, that despite of `SELECT` inside `setF16Action`, we overwrite it later with `Custom` for `v8f16`.

When I've added `Custom` for `FMINIMUM` I've seen the desired result
```asm
test_fminimum_scalarize:                # @test_fminimum_scalarize 
        .cfi_startproc                                             
# %bb.0:                                                           
        vminph  %xmm1, %xmm0, %xmm0                                
        retq                                                       
```
Let me support it with fixing test naming to illustrate the attributes

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


More information about the llvm-commits mailing list