[llvm] AMDGPU: Use pattern to select instruction for intrinsic llvm.fptrunc.round (PR #105761)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 28 07:14:44 PDT 2024


================
@@ -1,9 +1,8 @@
-; RUN: not --crash llc -mtriple=amdgcn -mcpu=gfx1030 -o /dev/null %s 2>&1 | FileCheck %s --ignore-case --check-prefixes=SDAG-FAIL
-; RUN: not --crash llc -global-isel -mtriple=amdgcn -mcpu=gfx1030 -o /dev/null %s 2>&1 | FileCheck %s --ignore-case --check-prefix=GISEL-FAIL
+; RUN: not --crash llc -mtriple=amdgcn -mcpu=gfx1030 -o /dev/null %s 2>&1 | FileCheck %s --ignore-case --check-prefix=FAIL
+; RUN: not --crash llc -global-isel -mtriple=amdgcn -mcpu=gfx1030 -o /dev/null %s 2>&1 | FileCheck %s --ignore-case --check-prefix=FAIL
 
 define amdgpu_gs void @test_fptrunc_round_f64(double %a, ptr addrspace(1) %out) {
-; SDAG-FAIL: LLVM ERROR: Cannot select
-; GISEL-FAIL: unable to legalize instruction
+; FAIL: LLVM ERROR: Cannot select
   %res = call half @llvm.fptrunc.round.f64(double %a, metadata !"round.upward")
----------------
arsenm wrote:

This isn't using the correct suffix on the intrinsic, it's missing the mangled result type. I guess this was an existing bug, can you precommit the fix for that? 

Also using the f32->f16 case would be more representative

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


More information about the llvm-commits mailing list