[llvm] [CodeGen] [AMDGPU] Adds pre-commit test for fmul-select combine (PR #111107)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 29 19:59:28 PDT 2024


================
@@ -0,0 +1,1191 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
+;RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 < %s | FileCheck -check-prefix=GFX9 %s
+;RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1030 < %s | FileCheck -check-prefix=GFX1030 %s
+;RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1100 < %s | FileCheck -check-prefix=GFX1100 %s
+
+define float @fmul_select_f32_test1(float %x, i32 %bool.arg1, i32 %bool.arg2) {
----------------
arsenm wrote:

```
define float @v_s_fmul_select_f32_test1(float inreg %x, i32 inreg %bool.arg1) {
  %bool = icmp eq i32 %bool.arg1, 0
  %y = select i1 %bool, float 2.000000e+00, float 1.000000e+00
  %ldexp = fmul float %x, %y
  ret float %ldexp
}

; with scalar output
define amdgpu_ps i32 @s_fmul_select_f32_test1(float inreg %x, i32 inreg %bool.arg1) {
  %bool = icmp eq i32 %bool.arg1, 0
  %y = select i1 %bool, float 2.000000e+00, float 1.000000e+00
  %ldexp = fmul float %x, %y
  %cast = bitcast float %ldexp to i32
  ret i32 %cast
}
```

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


More information about the llvm-commits mailing list