[clang-tools-extra] [clang] [llvm] [AMDGPU] Update uses of new VOP2 pseudos for GFX12 (PR #78155)
Jay Foad via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 18 04:47:56 PST 2024
https://github.com/jayfoad updated https://github.com/llvm/llvm-project/pull/78155
>From a12632a764eaeac4618af8d6ac6a9d8986c8296d Mon Sep 17 00:00:00 2001
From: Jay Foad <jay.foad at amd.com>
Date: Mon, 15 Jan 2024 11:22:31 +0000
Subject: [PATCH 1/2] Add some GFX12 test coverage
---
llvm/test/CodeGen/AMDGPU/fcanonicalize.ll | 1054 ++++++++++++---------
llvm/test/CodeGen/AMDGPU/omod.ll | 496 ++++++----
2 files changed, 938 insertions(+), 612 deletions(-)
diff --git a/llvm/test/CodeGen/AMDGPU/fcanonicalize.ll b/llvm/test/CodeGen/AMDGPU/fcanonicalize.ll
index 41b436473f6521..37f4552af18fcf 100644
--- a/llvm/test/CodeGen/AMDGPU/fcanonicalize.ll
+++ b/llvm/test/CodeGen/AMDGPU/fcanonicalize.ll
@@ -2,7 +2,8 @@
; RUN: llc -amdgpu-scalarize-global-loads=false -mtriple=amdgcn-amd-amdhsa -mcpu=hawaii -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX678,GFX6 %s
; RUN: llc -amdgpu-scalarize-global-loads=false -mtriple=amdgcn-amd-amdhsa -mcpu=fiji -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX678,GFX8 %s
; RUN: llc -amdgpu-scalarize-global-loads=false -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX9 %s
-; RUN: llc -amdgpu-scalarize-global-loads=false -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1100 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX11 %s
+; RUN: llc -amdgpu-scalarize-global-loads=false -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1100 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX11PLUS,GFX11 %s
+; RUN: llc -amdgpu-scalarize-global-loads=false -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1200 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX11PLUS,GFX12 %s
declare float @llvm.fabs.f32(float) #0
declare float @llvm.canonicalize.f32(float) #0
@@ -55,6 +56,19 @@ define amdgpu_kernel void @v_test_canonicalize_var_f32(ptr addrspace(1) %out) #1
; GFX11-NEXT: s_nop 0
; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
; GFX11-NEXT: s_endpgm
+;
+; GFX12-LABEL: v_test_canonicalize_var_f32:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX12-NEXT: v_mov_b32_e32 v0, 0
+; GFX12-NEXT: s_waitcnt lgkmcnt(0)
+; GFX12-NEXT: global_load_b32 v1, v0, s[0:1]
+; GFX12-NEXT: s_waitcnt vmcnt(0)
+; GFX12-NEXT: v_max_num_f32_e32 v1, v1, v1
+; GFX12-NEXT: global_store_b32 v0, v1, s[0:1]
+; GFX12-NEXT: s_nop 0
+; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX12-NEXT: s_endpgm
%val = load float, ptr addrspace(1) %out
%canonicalized = call float @llvm.canonicalize.f32(float %val)
store float %canonicalized, ptr addrspace(1) %out
@@ -106,6 +120,17 @@ define amdgpu_kernel void @s_test_canonicalize_var_f32(ptr addrspace(1) %out, fl
; GFX11-NEXT: s_nop 0
; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
; GFX11-NEXT: s_endpgm
+;
+; GFX12-LABEL: s_test_canonicalize_var_f32:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: s_load_b96 s[0:2], s[0:1], 0x0
+; GFX12-NEXT: v_mov_b32_e32 v0, 0
+; GFX12-NEXT: s_waitcnt lgkmcnt(0)
+; GFX12-NEXT: v_max_num_f32_e64 v1, s2, s2
+; GFX12-NEXT: global_store_b32 v0, v1, s[0:1]
+; GFX12-NEXT: s_nop 0
+; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX12-NEXT: s_endpgm
%canonicalized = call float @llvm.canonicalize.f32(float %val)
store float %canonicalized, ptr addrspace(1) %out
ret void
@@ -147,6 +172,19 @@ define amdgpu_kernel void @v_test_canonicalize_fabs_var_f32(ptr addrspace(1) %ou
; GFX11-NEXT: s_nop 0
; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
; GFX11-NEXT: s_endpgm
+;
+; GFX12-LABEL: v_test_canonicalize_fabs_var_f32:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX12-NEXT: v_mov_b32_e32 v0, 0
+; GFX12-NEXT: s_waitcnt lgkmcnt(0)
+; GFX12-NEXT: global_load_b32 v1, v0, s[0:1]
+; GFX12-NEXT: s_waitcnt vmcnt(0)
+; GFX12-NEXT: v_max_num_f32_e64 v1, |v1|, |v1|
+; GFX12-NEXT: global_store_b32 v0, v1, s[0:1]
+; GFX12-NEXT: s_nop 0
+; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX12-NEXT: s_endpgm
%val = load float, ptr addrspace(1) %out
%val.fabs = call float @llvm.fabs.f32(float %val)
%canonicalized = call float @llvm.canonicalize.f32(float %val.fabs)
@@ -190,6 +228,19 @@ define amdgpu_kernel void @v_test_canonicalize_fneg_fabs_var_f32(ptr addrspace(1
; GFX11-NEXT: s_nop 0
; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
; GFX11-NEXT: s_endpgm
+;
+; GFX12-LABEL: v_test_canonicalize_fneg_fabs_var_f32:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX12-NEXT: v_mov_b32_e32 v0, 0
+; GFX12-NEXT: s_waitcnt lgkmcnt(0)
+; GFX12-NEXT: global_load_b32 v1, v0, s[0:1]
+; GFX12-NEXT: s_waitcnt vmcnt(0)
+; GFX12-NEXT: v_max_num_f32_e64 v1, -|v1|, -|v1|
+; GFX12-NEXT: global_store_b32 v0, v1, s[0:1]
+; GFX12-NEXT: s_nop 0
+; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX12-NEXT: s_endpgm
%val = load float, ptr addrspace(1) %out
%val.fabs = call float @llvm.fabs.f32(float %val)
%val.fabs.fneg = fneg float %val.fabs
@@ -234,6 +285,19 @@ define amdgpu_kernel void @v_test_canonicalize_fneg_var_f32(ptr addrspace(1) %ou
; GFX11-NEXT: s_nop 0
; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
; GFX11-NEXT: s_endpgm
+;
+; GFX12-LABEL: v_test_canonicalize_fneg_var_f32:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX12-NEXT: v_mov_b32_e32 v0, 0
+; GFX12-NEXT: s_waitcnt lgkmcnt(0)
+; GFX12-NEXT: global_load_b32 v1, v0, s[0:1]
+; GFX12-NEXT: s_waitcnt vmcnt(0)
+; GFX12-NEXT: v_max_num_f32_e64 v1, -v1, -v1
+; GFX12-NEXT: global_store_b32 v0, v1, s[0:1]
+; GFX12-NEXT: s_nop 0
+; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX12-NEXT: s_endpgm
%val = load float, ptr addrspace(1) %out
%val.fneg = fneg float %val
%canonicalized = call float @llvm.canonicalize.f32(float %val.fneg)
@@ -260,15 +324,15 @@ define amdgpu_kernel void @test_fold_canonicalize_undef_f32(ptr addrspace(1) %ou
; GFX9-NEXT: global_store_dword v0, v0, s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: test_fold_canonicalize_undef_f32:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_mov_b32_e32 v0, 0
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_store_b32 v0, v0, s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: test_fold_canonicalize_undef_f32:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_mov_b32_e32 v0, 0
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_store_b32 v0, v0, s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%canonicalized = call float @llvm.canonicalize.f32(float undef)
store float %canonicalized, ptr addrspace(1) %out
ret void
@@ -293,15 +357,15 @@ define amdgpu_kernel void @test_fold_canonicalize_p0_f32(ptr addrspace(1) %out)
; GFX9-NEXT: global_store_dword v0, v0, s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: test_fold_canonicalize_p0_f32:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_mov_b32_e32 v0, 0
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_store_b32 v0, v0, s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: test_fold_canonicalize_p0_f32:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_mov_b32_e32 v0, 0
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_store_b32 v0, v0, s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%canonicalized = call float @llvm.canonicalize.f32(float 0.0)
store float %canonicalized, ptr addrspace(1) %out
ret void
@@ -327,16 +391,16 @@ define amdgpu_kernel void @test_fold_canonicalize_n0_f32(ptr addrspace(1) %out)
; GFX9-NEXT: global_store_dword v0, v1, s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: test_fold_canonicalize_n0_f32:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_mov_b32_e32 v0, 0
-; GFX11-NEXT: v_bfrev_b32_e32 v1, 1
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_store_b32 v0, v1, s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: test_fold_canonicalize_n0_f32:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_mov_b32_e32 v0, 0
+; GFX11PLUS-NEXT: v_bfrev_b32_e32 v1, 1
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_store_b32 v0, v1, s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%canonicalized = call float @llvm.canonicalize.f32(float -0.0)
store float %canonicalized, ptr addrspace(1) %out
ret void
@@ -362,15 +426,15 @@ define amdgpu_kernel void @test_fold_canonicalize_p1_f32(ptr addrspace(1) %out)
; GFX9-NEXT: global_store_dword v0, v1, s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: test_fold_canonicalize_p1_f32:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 1.0
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_store_b32 v0, v1, s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: test_fold_canonicalize_p1_f32:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 1.0
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_store_b32 v0, v1, s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%canonicalized = call float @llvm.canonicalize.f32(float 1.0)
store float %canonicalized, ptr addrspace(1) %out
ret void
@@ -396,15 +460,15 @@ define amdgpu_kernel void @test_fold_canonicalize_n1_f32(ptr addrspace(1) %out)
; GFX9-NEXT: global_store_dword v0, v1, s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: test_fold_canonicalize_n1_f32:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, -1.0
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_store_b32 v0, v1, s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: test_fold_canonicalize_n1_f32:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, -1.0
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_store_b32 v0, v1, s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%canonicalized = call float @llvm.canonicalize.f32(float -1.0)
store float %canonicalized, ptr addrspace(1) %out
ret void
@@ -430,15 +494,15 @@ define amdgpu_kernel void @test_fold_canonicalize_literal_f32(ptr addrspace(1) %
; GFX9-NEXT: global_store_dword v0, v1, s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: test_fold_canonicalize_literal_f32:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x41800000
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_store_b32 v0, v1, s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: test_fold_canonicalize_literal_f32:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x41800000
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_store_b32 v0, v1, s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%canonicalized = call float @llvm.canonicalize.f32(float 16.0)
store float %canonicalized, ptr addrspace(1) %out
ret void
@@ -463,15 +527,15 @@ define amdgpu_kernel void @test_no_denormals_fold_canonicalize_denormal0_f32(ptr
; GFX9-NEXT: global_store_dword v0, v0, s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: test_no_denormals_fold_canonicalize_denormal0_f32:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_mov_b32_e32 v0, 0
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_store_b32 v0, v0, s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: test_no_denormals_fold_canonicalize_denormal0_f32:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_mov_b32_e32 v0, 0
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_store_b32 v0, v0, s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%canonicalized = call float @llvm.canonicalize.f32(float bitcast (i32 8388607 to float))
store float %canonicalized, ptr addrspace(1) %out
ret void
@@ -509,6 +573,17 @@ define amdgpu_kernel void @test_no_denormals_fold_canonicalize_denormal0_f32_dyn
; GFX11-NEXT: s_nop 0
; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
; GFX11-NEXT: s_endpgm
+;
+; GFX12-LABEL: test_no_denormals_fold_canonicalize_denormal0_f32_dynamic:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX12-NEXT: v_mov_b32_e32 v0, 0
+; GFX12-NEXT: v_max_num_f32_e64 v1, 0x7fffff, 0x7fffff
+; GFX12-NEXT: s_waitcnt lgkmcnt(0)
+; GFX12-NEXT: global_store_b32 v0, v1, s[0:1]
+; GFX12-NEXT: s_nop 0
+; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX12-NEXT: s_endpgm
%canonicalized = call float @llvm.canonicalize.f32(float bitcast (i32 8388607 to float))
store float %canonicalized, ptr addrspace(1) %out
ret void
@@ -546,6 +621,17 @@ define amdgpu_kernel void @test_no_denormals_fold_canonicalize_denormal0_f32_dyn
; GFX11-NEXT: s_nop 0
; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
; GFX11-NEXT: s_endpgm
+;
+; GFX12-LABEL: test_no_denormals_fold_canonicalize_denormal0_f32_dynamic_out:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX12-NEXT: v_mov_b32_e32 v0, 0
+; GFX12-NEXT: v_max_num_f32_e64 v1, 0x7fffff, 0x7fffff
+; GFX12-NEXT: s_waitcnt lgkmcnt(0)
+; GFX12-NEXT: global_store_b32 v0, v1, s[0:1]
+; GFX12-NEXT: s_nop 0
+; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX12-NEXT: s_endpgm
%canonicalized = call float @llvm.canonicalize.f32(float bitcast (i32 8388607 to float))
store float %canonicalized, ptr addrspace(1) %out
ret void
@@ -583,6 +669,17 @@ define amdgpu_kernel void @test_no_denormals_fold_canonicalize_denormal0_f32_dyn
; GFX11-NEXT: s_nop 0
; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
; GFX11-NEXT: s_endpgm
+;
+; GFX12-LABEL: test_no_denormals_fold_canonicalize_denormal0_f32_dynamic_in:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX12-NEXT: v_mov_b32_e32 v0, 0
+; GFX12-NEXT: v_max_num_f32_e64 v1, 0x7fffff, 0x7fffff
+; GFX12-NEXT: s_waitcnt lgkmcnt(0)
+; GFX12-NEXT: global_store_b32 v0, v1, s[0:1]
+; GFX12-NEXT: s_nop 0
+; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX12-NEXT: s_endpgm
%canonicalized = call float @llvm.canonicalize.f32(float bitcast (i32 8388607 to float))
store float %canonicalized, ptr addrspace(1) %out
ret void
@@ -608,15 +705,15 @@ define amdgpu_kernel void @test_denormals_fold_canonicalize_denormal0_f32(ptr ad
; GFX9-NEXT: global_store_dword v0, v1, s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: test_denormals_fold_canonicalize_denormal0_f32:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x7fffff
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_store_b32 v0, v1, s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: test_denormals_fold_canonicalize_denormal0_f32:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x7fffff
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_store_b32 v0, v1, s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%canonicalized = call float @llvm.canonicalize.f32(float bitcast (i32 8388607 to float))
store float %canonicalized, ptr addrspace(1) %out
ret void
@@ -642,16 +739,16 @@ define amdgpu_kernel void @test_no_denormals_fold_canonicalize_denormal1_f32(ptr
; GFX9-NEXT: global_store_dword v0, v1, s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: test_no_denormals_fold_canonicalize_denormal1_f32:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_mov_b32_e32 v0, 0
-; GFX11-NEXT: v_bfrev_b32_e32 v1, 1
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_store_b32 v0, v1, s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: test_no_denormals_fold_canonicalize_denormal1_f32:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_mov_b32_e32 v0, 0
+; GFX11PLUS-NEXT: v_bfrev_b32_e32 v1, 1
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_store_b32 v0, v1, s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%canonicalized = call float @llvm.canonicalize.f32(float bitcast (i32 2155872255 to float))
store float %canonicalized, ptr addrspace(1) %out
ret void
@@ -677,15 +774,15 @@ define amdgpu_kernel void @test_denormals_fold_canonicalize_denormal1_f32(ptr ad
; GFX9-NEXT: global_store_dword v0, v1, s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: test_denormals_fold_canonicalize_denormal1_f32:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x807fffff
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_store_b32 v0, v1, s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: test_denormals_fold_canonicalize_denormal1_f32:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x807fffff
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_store_b32 v0, v1, s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%canonicalized = call float @llvm.canonicalize.f32(float bitcast (i32 2155872255 to float))
store float %canonicalized, ptr addrspace(1) %out
ret void
@@ -711,15 +808,15 @@ define amdgpu_kernel void @test_fold_canonicalize_qnan_f32(ptr addrspace(1) %out
; GFX9-NEXT: global_store_dword v0, v1, s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: test_fold_canonicalize_qnan_f32:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x7fc00000
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_store_b32 v0, v1, s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: test_fold_canonicalize_qnan_f32:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x7fc00000
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_store_b32 v0, v1, s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%canonicalized = call float @llvm.canonicalize.f32(float 0x7FF8000000000000)
store float %canonicalized, ptr addrspace(1) %out
ret void
@@ -745,15 +842,15 @@ define amdgpu_kernel void @test_fold_canonicalize_qnan_value_neg1_f32(ptr addrsp
; GFX9-NEXT: global_store_dword v0, v1, s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: test_fold_canonicalize_qnan_value_neg1_f32:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x7fc00000
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_store_b32 v0, v1, s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: test_fold_canonicalize_qnan_value_neg1_f32:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x7fc00000
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_store_b32 v0, v1, s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%canonicalized = call float @llvm.canonicalize.f32(float bitcast (i32 -1 to float))
store float %canonicalized, ptr addrspace(1) %out
ret void
@@ -779,15 +876,15 @@ define amdgpu_kernel void @test_fold_canonicalize_qnan_value_neg2_f32(ptr addrsp
; GFX9-NEXT: global_store_dword v0, v1, s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: test_fold_canonicalize_qnan_value_neg2_f32:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x7fc00000
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_store_b32 v0, v1, s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: test_fold_canonicalize_qnan_value_neg2_f32:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x7fc00000
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_store_b32 v0, v1, s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%canonicalized = call float @llvm.canonicalize.f32(float bitcast (i32 -2 to float))
store float %canonicalized, ptr addrspace(1) %out
ret void
@@ -813,15 +910,15 @@ define amdgpu_kernel void @test_fold_canonicalize_snan0_value_f32(ptr addrspace(
; GFX9-NEXT: global_store_dword v0, v1, s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: test_fold_canonicalize_snan0_value_f32:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x7fc00000
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_store_b32 v0, v1, s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: test_fold_canonicalize_snan0_value_f32:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x7fc00000
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_store_b32 v0, v1, s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%canonicalized = call float @llvm.canonicalize.f32(float bitcast (i32 2139095041 to float))
store float %canonicalized, ptr addrspace(1) %out
ret void
@@ -847,15 +944,15 @@ define amdgpu_kernel void @test_fold_canonicalize_snan1_value_f32(ptr addrspace(
; GFX9-NEXT: global_store_dword v0, v1, s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: test_fold_canonicalize_snan1_value_f32:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x7fc00000
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_store_b32 v0, v1, s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: test_fold_canonicalize_snan1_value_f32:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x7fc00000
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_store_b32 v0, v1, s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%canonicalized = call float @llvm.canonicalize.f32(float bitcast (i32 2143289343 to float))
store float %canonicalized, ptr addrspace(1) %out
ret void
@@ -881,15 +978,15 @@ define amdgpu_kernel void @test_fold_canonicalize_snan2_value_f32(ptr addrspace(
; GFX9-NEXT: global_store_dword v0, v1, s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: test_fold_canonicalize_snan2_value_f32:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x7fc00000
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_store_b32 v0, v1, s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: test_fold_canonicalize_snan2_value_f32:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x7fc00000
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_store_b32 v0, v1, s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%canonicalized = call float @llvm.canonicalize.f32(float bitcast (i32 4286578689 to float))
store float %canonicalized, ptr addrspace(1) %out
ret void
@@ -915,15 +1012,15 @@ define amdgpu_kernel void @test_fold_canonicalize_snan3_value_f32(ptr addrspace(
; GFX9-NEXT: global_store_dword v0, v1, s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: test_fold_canonicalize_snan3_value_f32:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x7fc00000
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_store_b32 v0, v1, s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: test_fold_canonicalize_snan3_value_f32:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x7fc00000
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_store_b32 v0, v1, s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%canonicalized = call float @llvm.canonicalize.f32(float bitcast (i32 4290772991 to float))
store float %canonicalized, ptr addrspace(1) %out
ret void
@@ -953,18 +1050,18 @@ define amdgpu_kernel void @v_test_canonicalize_var_f64(ptr addrspace(1) %out) #1
; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: v_test_canonicalize_var_f64:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_mov_b32_e32 v2, 0
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_load_b64 v[0:1], v2, s[0:1]
-; GFX11-NEXT: s_waitcnt vmcnt(0)
-; GFX11-NEXT: v_max_f64 v[0:1], v[0:1], v[0:1]
-; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: v_test_canonicalize_var_f64:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_mov_b32_e32 v2, 0
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_load_b64 v[0:1], v2, s[0:1]
+; GFX11PLUS-NEXT: s_waitcnt vmcnt(0)
+; GFX11PLUS-NEXT: v_max_f64 v[0:1], v[0:1], v[0:1]
+; GFX11PLUS-NEXT: global_store_b64 v2, v[0:1], s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%val = load double, ptr addrspace(1) %out
%canonicalized = call double @llvm.canonicalize.f64(double %val)
store double %canonicalized, ptr addrspace(1) %out
@@ -1001,16 +1098,16 @@ define amdgpu_kernel void @s_test_canonicalize_var_f64(ptr addrspace(1) %out, do
; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: s_test_canonicalize_var_f64:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b128 s[0:3], s[0:1], 0x0
-; GFX11-NEXT: v_mov_b32_e32 v2, 0
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: v_max_f64 v[0:1], s[2:3], s[2:3]
-; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: s_test_canonicalize_var_f64:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b128 s[0:3], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_mov_b32_e32 v2, 0
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: v_max_f64 v[0:1], s[2:3], s[2:3]
+; GFX11PLUS-NEXT: global_store_b64 v2, v[0:1], s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%canonicalized = call double @llvm.canonicalize.f64(double %val)
store double %canonicalized, ptr addrspace(1) %out
ret void
@@ -1040,18 +1137,18 @@ define amdgpu_kernel void @v_test_canonicalize_fabs_var_f64(ptr addrspace(1) %ou
; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: v_test_canonicalize_fabs_var_f64:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_mov_b32_e32 v2, 0
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_load_b64 v[0:1], v2, s[0:1]
-; GFX11-NEXT: s_waitcnt vmcnt(0)
-; GFX11-NEXT: v_max_f64 v[0:1], |v[0:1]|, |v[0:1]|
-; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: v_test_canonicalize_fabs_var_f64:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_mov_b32_e32 v2, 0
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_load_b64 v[0:1], v2, s[0:1]
+; GFX11PLUS-NEXT: s_waitcnt vmcnt(0)
+; GFX11PLUS-NEXT: v_max_f64 v[0:1], |v[0:1]|, |v[0:1]|
+; GFX11PLUS-NEXT: global_store_b64 v2, v[0:1], s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%val = load double, ptr addrspace(1) %out
%val.fabs = call double @llvm.fabs.f64(double %val)
%canonicalized = call double @llvm.canonicalize.f64(double %val.fabs)
@@ -1083,18 +1180,18 @@ define amdgpu_kernel void @v_test_canonicalize_fneg_fabs_var_f64(ptr addrspace(1
; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: v_test_canonicalize_fneg_fabs_var_f64:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_mov_b32_e32 v2, 0
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_load_b64 v[0:1], v2, s[0:1]
-; GFX11-NEXT: s_waitcnt vmcnt(0)
-; GFX11-NEXT: v_max_f64 v[0:1], -|v[0:1]|, -|v[0:1]|
-; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: v_test_canonicalize_fneg_fabs_var_f64:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_mov_b32_e32 v2, 0
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_load_b64 v[0:1], v2, s[0:1]
+; GFX11PLUS-NEXT: s_waitcnt vmcnt(0)
+; GFX11PLUS-NEXT: v_max_f64 v[0:1], -|v[0:1]|, -|v[0:1]|
+; GFX11PLUS-NEXT: global_store_b64 v2, v[0:1], s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%val = load double, ptr addrspace(1) %out
%val.fabs = call double @llvm.fabs.f64(double %val)
%val.fabs.fneg = fneg double %val.fabs
@@ -1127,18 +1224,18 @@ define amdgpu_kernel void @v_test_canonicalize_fneg_var_f64(ptr addrspace(1) %ou
; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: v_test_canonicalize_fneg_var_f64:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_mov_b32_e32 v2, 0
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_load_b64 v[0:1], v2, s[0:1]
-; GFX11-NEXT: s_waitcnt vmcnt(0)
-; GFX11-NEXT: v_max_f64 v[0:1], -v[0:1], -v[0:1]
-; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: v_test_canonicalize_fneg_var_f64:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_mov_b32_e32 v2, 0
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_load_b64 v[0:1], v2, s[0:1]
+; GFX11PLUS-NEXT: s_waitcnt vmcnt(0)
+; GFX11PLUS-NEXT: v_max_f64 v[0:1], -v[0:1], -v[0:1]
+; GFX11PLUS-NEXT: global_store_b64 v2, v[0:1], s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%val = load double, ptr addrspace(1) %out
%val.fneg = fneg double %val
%canonicalized = call double @llvm.canonicalize.f64(double %val.fneg)
@@ -1167,17 +1264,17 @@ define amdgpu_kernel void @test_fold_canonicalize_p0_f64(ptr addrspace(1) %out)
; GFX9-NEXT: global_store_dwordx2 v0, v[0:1], s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: test_fold_canonicalize_p0_f64:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_mov_b32_e32 v0, 0
-; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
-; GFX11-NEXT: v_mov_b32_e32 v1, v0
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_store_b64 v0, v[0:1], s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: test_fold_canonicalize_p0_f64:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_mov_b32_e32 v0, 0
+; GFX11PLUS-NEXT: s_delay_alu instid0(VALU_DEP_1)
+; GFX11PLUS-NEXT: v_mov_b32_e32 v1, v0
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_store_b64 v0, v[0:1], s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%canonicalized = call double @llvm.canonicalize.f64(double 0.0)
store double %canonicalized, ptr addrspace(1) %out
ret void
@@ -1204,16 +1301,16 @@ define amdgpu_kernel void @test_fold_canonicalize_n0_f64(ptr addrspace(1) %out)
; GFX9-NEXT: global_store_dwordx2 v0, v[0:1], s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: test_fold_canonicalize_n0_f64:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_mov_b32_e32 v0, 0
-; GFX11-NEXT: v_bfrev_b32_e32 v1, 1
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_store_b64 v0, v[0:1], s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: test_fold_canonicalize_n0_f64:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_mov_b32_e32 v0, 0
+; GFX11PLUS-NEXT: v_bfrev_b32_e32 v1, 1
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_store_b64 v0, v[0:1], s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%canonicalized = call double @llvm.canonicalize.f64(double -0.0)
store double %canonicalized, ptr addrspace(1) %out
ret void
@@ -1240,15 +1337,15 @@ define amdgpu_kernel void @test_fold_canonicalize_p1_f64(ptr addrspace(1) %out)
; GFX9-NEXT: global_store_dwordx2 v0, v[0:1], s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: test_fold_canonicalize_p1_f64:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x3ff00000
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_store_b64 v0, v[0:1], s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: test_fold_canonicalize_p1_f64:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x3ff00000
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_store_b64 v0, v[0:1], s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%canonicalized = call double @llvm.canonicalize.f64(double 1.0)
store double %canonicalized, ptr addrspace(1) %out
ret void
@@ -1275,15 +1372,15 @@ define amdgpu_kernel void @test_fold_canonicalize_n1_f64(ptr addrspace(1) %out)
; GFX9-NEXT: global_store_dwordx2 v0, v[0:1], s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: test_fold_canonicalize_n1_f64:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0xbff00000
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_store_b64 v0, v[0:1], s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: test_fold_canonicalize_n1_f64:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0xbff00000
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_store_b64 v0, v[0:1], s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%canonicalized = call double @llvm.canonicalize.f64(double -1.0)
store double %canonicalized, ptr addrspace(1) %out
ret void
@@ -1310,15 +1407,15 @@ define amdgpu_kernel void @test_fold_canonicalize_literal_f64(ptr addrspace(1) %
; GFX9-NEXT: global_store_dwordx2 v0, v[0:1], s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: test_fold_canonicalize_literal_f64:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x40300000
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_store_b64 v0, v[0:1], s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: test_fold_canonicalize_literal_f64:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x40300000
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_store_b64 v0, v[0:1], s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%canonicalized = call double @llvm.canonicalize.f64(double 16.0)
store double %canonicalized, ptr addrspace(1) %out
ret void
@@ -1345,17 +1442,17 @@ define amdgpu_kernel void @test_no_denormals_fold_canonicalize_denormal0_f64(ptr
; GFX9-NEXT: global_store_dwordx2 v0, v[0:1], s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: test_no_denormals_fold_canonicalize_denormal0_f64:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_mov_b32_e32 v0, 0
-; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
-; GFX11-NEXT: v_mov_b32_e32 v1, v0
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_store_b64 v0, v[0:1], s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: test_no_denormals_fold_canonicalize_denormal0_f64:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_mov_b32_e32 v0, 0
+; GFX11PLUS-NEXT: s_delay_alu instid0(VALU_DEP_1)
+; GFX11PLUS-NEXT: v_mov_b32_e32 v1, v0
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_store_b64 v0, v[0:1], s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%canonicalized = call double @llvm.canonicalize.f64(double bitcast (i64 4503599627370495 to double))
store double %canonicalized, ptr addrspace(1) %out
ret void
@@ -1383,16 +1480,16 @@ define amdgpu_kernel void @test_denormals_fold_canonicalize_denormal0_f64(ptr ad
; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: test_denormals_fold_canonicalize_denormal0_f64:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_dual_mov_b32 v2, 0 :: v_dual_mov_b32 v1, 0xfffff
-; GFX11-NEXT: v_mov_b32_e32 v0, -1
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: test_denormals_fold_canonicalize_denormal0_f64:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_dual_mov_b32 v2, 0 :: v_dual_mov_b32 v1, 0xfffff
+; GFX11PLUS-NEXT: v_mov_b32_e32 v0, -1
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_store_b64 v2, v[0:1], s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%canonicalized = call double @llvm.canonicalize.f64(double bitcast (i64 4503599627370495 to double))
store double %canonicalized, ptr addrspace(1) %out
ret void
@@ -1419,16 +1516,16 @@ define amdgpu_kernel void @test_no_denormals_fold_canonicalize_denormal1_f64(ptr
; GFX9-NEXT: global_store_dwordx2 v0, v[0:1], s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: test_no_denormals_fold_canonicalize_denormal1_f64:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_mov_b32_e32 v0, 0
-; GFX11-NEXT: v_bfrev_b32_e32 v1, 1
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_store_b64 v0, v[0:1], s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: test_no_denormals_fold_canonicalize_denormal1_f64:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_mov_b32_e32 v0, 0
+; GFX11PLUS-NEXT: v_bfrev_b32_e32 v1, 1
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_store_b64 v0, v[0:1], s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%canonicalized = call double @llvm.canonicalize.f64(double bitcast (i64 9227875636482146303 to double))
store double %canonicalized, ptr addrspace(1) %out
ret void
@@ -1456,16 +1553,16 @@ define amdgpu_kernel void @test_denormals_fold_canonicalize_denormal1_f64(ptr ad
; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: test_denormals_fold_canonicalize_denormal1_f64:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_dual_mov_b32 v2, 0 :: v_dual_mov_b32 v1, 0x800fffff
-; GFX11-NEXT: v_mov_b32_e32 v0, -1
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: test_denormals_fold_canonicalize_denormal1_f64:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_dual_mov_b32 v2, 0 :: v_dual_mov_b32 v1, 0x800fffff
+; GFX11PLUS-NEXT: v_mov_b32_e32 v0, -1
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_store_b64 v2, v[0:1], s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%canonicalized = call double @llvm.canonicalize.f64(double bitcast (i64 9227875636482146303 to double))
store double %canonicalized, ptr addrspace(1) %out
ret void
@@ -1492,15 +1589,15 @@ define amdgpu_kernel void @test_fold_canonicalize_qnan_f64(ptr addrspace(1) %out
; GFX9-NEXT: global_store_dwordx2 v0, v[0:1], s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: test_fold_canonicalize_qnan_f64:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x7ff80000
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_store_b64 v0, v[0:1], s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: test_fold_canonicalize_qnan_f64:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x7ff80000
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_store_b64 v0, v[0:1], s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%canonicalized = call double @llvm.canonicalize.f64(double 0x7FF8000000000000)
store double %canonicalized, ptr addrspace(1) %out
ret void
@@ -1527,15 +1624,15 @@ define amdgpu_kernel void @test_fold_canonicalize_qnan_value_neg1_f64(ptr addrsp
; GFX9-NEXT: global_store_dwordx2 v0, v[0:1], s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: test_fold_canonicalize_qnan_value_neg1_f64:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x7ff80000
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_store_b64 v0, v[0:1], s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: test_fold_canonicalize_qnan_value_neg1_f64:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x7ff80000
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_store_b64 v0, v[0:1], s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%canonicalized = call double @llvm.canonicalize.f64(double bitcast (i64 -1 to double))
store double %canonicalized, ptr addrspace(1) %out
ret void
@@ -1562,15 +1659,15 @@ define amdgpu_kernel void @test_fold_canonicalize_qnan_value_neg2_f64(ptr addrsp
; GFX9-NEXT: global_store_dwordx2 v0, v[0:1], s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: test_fold_canonicalize_qnan_value_neg2_f64:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x7ff80000
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_store_b64 v0, v[0:1], s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: test_fold_canonicalize_qnan_value_neg2_f64:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x7ff80000
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_store_b64 v0, v[0:1], s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%canonicalized = call double @llvm.canonicalize.f64(double bitcast (i64 -2 to double))
store double %canonicalized, ptr addrspace(1) %out
ret void
@@ -1597,15 +1694,15 @@ define amdgpu_kernel void @test_fold_canonicalize_snan0_value_f64(ptr addrspace(
; GFX9-NEXT: global_store_dwordx2 v0, v[0:1], s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: test_fold_canonicalize_snan0_value_f64:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x7ff80000
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_store_b64 v0, v[0:1], s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: test_fold_canonicalize_snan0_value_f64:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x7ff80000
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_store_b64 v0, v[0:1], s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%canonicalized = call double @llvm.canonicalize.f64(double bitcast (i64 9218868437227405313 to double))
store double %canonicalized, ptr addrspace(1) %out
ret void
@@ -1632,15 +1729,15 @@ define amdgpu_kernel void @test_fold_canonicalize_snan1_value_f64(ptr addrspace(
; GFX9-NEXT: global_store_dwordx2 v0, v[0:1], s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: test_fold_canonicalize_snan1_value_f64:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x7ff80000
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_store_b64 v0, v[0:1], s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: test_fold_canonicalize_snan1_value_f64:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x7ff80000
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_store_b64 v0, v[0:1], s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%canonicalized = call double @llvm.canonicalize.f64(double bitcast (i64 9223372036854775807 to double))
store double %canonicalized, ptr addrspace(1) %out
ret void
@@ -1667,15 +1764,15 @@ define amdgpu_kernel void @test_fold_canonicalize_snan2_value_f64(ptr addrspace(
; GFX9-NEXT: global_store_dwordx2 v0, v[0:1], s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: test_fold_canonicalize_snan2_value_f64:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x7ff80000
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_store_b64 v0, v[0:1], s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: test_fold_canonicalize_snan2_value_f64:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x7ff80000
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_store_b64 v0, v[0:1], s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%canonicalized = call double @llvm.canonicalize.f64(double bitcast (i64 18442240474082181121 to double))
store double %canonicalized, ptr addrspace(1) %out
ret void
@@ -1702,15 +1799,15 @@ define amdgpu_kernel void @test_fold_canonicalize_snan3_value_f64(ptr addrspace(
; GFX9-NEXT: global_store_dwordx2 v0, v[0:1], s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: test_fold_canonicalize_snan3_value_f64:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x7ff80000
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_store_b64 v0, v[0:1], s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: test_fold_canonicalize_snan3_value_f64:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0x7ff80000
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_store_b64 v0, v[0:1], s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%canonicalized = call double @llvm.canonicalize.f64(double bitcast (i64 18446744073709551615 to double))
store double %canonicalized, ptr addrspace(1) %out
ret void
@@ -1762,18 +1859,18 @@ define amdgpu_kernel void @test_canonicalize_value_f64_flush(ptr addrspace(1) %a
; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[2:3]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: test_canonicalize_value_f64_flush:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b128 s[0:3], s[0:1], 0x0
-; GFX11-NEXT: v_lshlrev_b32_e32 v2, 3, v0
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_load_b64 v[0:1], v2, s[0:1]
-; GFX11-NEXT: s_waitcnt vmcnt(0)
-; GFX11-NEXT: v_max_f64 v[0:1], v[0:1], v[0:1]
-; GFX11-NEXT: global_store_b64 v2, v[0:1], s[2:3]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: test_canonicalize_value_f64_flush:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b128 s[0:3], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_lshlrev_b32_e32 v2, 3, v0
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_load_b64 v[0:1], v2, s[0:1]
+; GFX11PLUS-NEXT: s_waitcnt vmcnt(0)
+; GFX11PLUS-NEXT: v_max_f64 v[0:1], v[0:1], v[0:1]
+; GFX11PLUS-NEXT: global_store_b64 v2, v[0:1], s[2:3]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%id = tail call i32 @llvm.amdgcn.workitem.id.x()
%gep = getelementptr inbounds double, ptr addrspace(1) %arg, i32 %id
%v = load double, ptr addrspace(1) %gep, align 8
@@ -1841,6 +1938,19 @@ define amdgpu_kernel void @test_canonicalize_value_f32_flush(ptr addrspace(1) %a
; GFX11-NEXT: s_nop 0
; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
; GFX11-NEXT: s_endpgm
+;
+; GFX12-LABEL: test_canonicalize_value_f32_flush:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: s_load_b128 s[0:3], s[0:1], 0x0
+; GFX12-NEXT: v_lshlrev_b32_e32 v0, 2, v0
+; GFX12-NEXT: s_waitcnt lgkmcnt(0)
+; GFX12-NEXT: global_load_b32 v1, v0, s[0:1]
+; GFX12-NEXT: s_waitcnt vmcnt(0)
+; GFX12-NEXT: v_max_num_f32_e32 v1, v1, v1
+; GFX12-NEXT: global_store_b32 v0, v1, s[2:3]
+; GFX12-NEXT: s_nop 0
+; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX12-NEXT: s_endpgm
%id = tail call i32 @llvm.amdgcn.workitem.id.x()
%gep = getelementptr inbounds float, ptr addrspace(1) %arg, i32 %id
%v = load float, ptr addrspace(1) %gep, align 4
@@ -1910,6 +2020,19 @@ define amdgpu_kernel void @test_canonicalize_value_f16_flush(ptr addrspace(1) %a
; GFX11-NEXT: s_nop 0
; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
; GFX11-NEXT: s_endpgm
+;
+; GFX12-LABEL: test_canonicalize_value_f16_flush:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: s_load_b128 s[0:3], s[0:1], 0x0
+; GFX12-NEXT: v_lshlrev_b32_e32 v0, 1, v0
+; GFX12-NEXT: s_waitcnt lgkmcnt(0)
+; GFX12-NEXT: global_load_u16 v1, v0, s[0:1]
+; GFX12-NEXT: s_waitcnt vmcnt(0)
+; GFX12-NEXT: v_max_num_f16_e32 v1, v1, v1
+; GFX12-NEXT: global_store_b16 v0, v1, s[2:3]
+; GFX12-NEXT: s_nop 0
+; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX12-NEXT: s_endpgm
%id = tail call i32 @llvm.amdgcn.workitem.id.x()
%gep = getelementptr inbounds half, ptr addrspace(1) %arg, i32 %id
%v = load half, ptr addrspace(1) %gep, align 2
@@ -1989,6 +2112,19 @@ define amdgpu_kernel void @test_canonicalize_value_v2f16_flush(ptr addrspace(1)
; GFX11-NEXT: s_nop 0
; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
; GFX11-NEXT: s_endpgm
+;
+; GFX12-LABEL: test_canonicalize_value_v2f16_flush:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: s_load_b128 s[0:3], s[0:1], 0x0
+; GFX12-NEXT: v_lshlrev_b32_e32 v0, 2, v0
+; GFX12-NEXT: s_waitcnt lgkmcnt(0)
+; GFX12-NEXT: global_load_b32 v1, v0, s[0:1]
+; GFX12-NEXT: s_waitcnt vmcnt(0)
+; GFX12-NEXT: v_pk_max_num_f16 v1, v1, v1
+; GFX12-NEXT: global_store_b32 v0, v1, s[2:3]
+; GFX12-NEXT: s_nop 0
+; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX12-NEXT: s_endpgm
%id = tail call i32 @llvm.amdgcn.workitem.id.x()
%gep = getelementptr inbounds <2 x half>, ptr addrspace(1) %arg, i32 %id
%v = load <2 x half>, ptr addrspace(1) %gep, align 4
@@ -2044,18 +2180,18 @@ define amdgpu_kernel void @test_canonicalize_value_f64_denorm(ptr addrspace(1) %
; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[2:3]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: test_canonicalize_value_f64_denorm:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b128 s[0:3], s[0:1], 0x0
-; GFX11-NEXT: v_lshlrev_b32_e32 v2, 3, v0
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_load_b64 v[0:1], v2, s[0:1]
-; GFX11-NEXT: s_waitcnt vmcnt(0)
-; GFX11-NEXT: v_max_f64 v[0:1], v[0:1], v[0:1]
-; GFX11-NEXT: global_store_b64 v2, v[0:1], s[2:3]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: test_canonicalize_value_f64_denorm:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b128 s[0:3], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_lshlrev_b32_e32 v2, 3, v0
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_load_b64 v[0:1], v2, s[0:1]
+; GFX11PLUS-NEXT: s_waitcnt vmcnt(0)
+; GFX11PLUS-NEXT: v_max_f64 v[0:1], v[0:1], v[0:1]
+; GFX11PLUS-NEXT: global_store_b64 v2, v[0:1], s[2:3]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%id = tail call i32 @llvm.amdgcn.workitem.id.x()
%gep = getelementptr inbounds double, ptr addrspace(1) %arg, i32 %id
%v = load double, ptr addrspace(1) %gep, align 8
@@ -2123,6 +2259,19 @@ define amdgpu_kernel void @test_canonicalize_value_f32_denorm(ptr addrspace(1) %
; GFX11-NEXT: s_nop 0
; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
; GFX11-NEXT: s_endpgm
+;
+; GFX12-LABEL: test_canonicalize_value_f32_denorm:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: s_load_b128 s[0:3], s[0:1], 0x0
+; GFX12-NEXT: v_lshlrev_b32_e32 v0, 2, v0
+; GFX12-NEXT: s_waitcnt lgkmcnt(0)
+; GFX12-NEXT: global_load_b32 v1, v0, s[0:1]
+; GFX12-NEXT: s_waitcnt vmcnt(0)
+; GFX12-NEXT: v_max_num_f32_e32 v1, v1, v1
+; GFX12-NEXT: global_store_b32 v0, v1, s[2:3]
+; GFX12-NEXT: s_nop 0
+; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX12-NEXT: s_endpgm
%id = tail call i32 @llvm.amdgcn.workitem.id.x()
%gep = getelementptr inbounds float, ptr addrspace(1) %arg, i32 %id
%v = load float, ptr addrspace(1) %gep, align 4
@@ -2193,6 +2342,19 @@ define amdgpu_kernel void @test_canonicalize_value_f16_denorm(ptr addrspace(1) %
; GFX11-NEXT: s_nop 0
; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
; GFX11-NEXT: s_endpgm
+;
+; GFX12-LABEL: test_canonicalize_value_f16_denorm:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: s_load_b128 s[0:3], s[0:1], 0x0
+; GFX12-NEXT: v_lshlrev_b32_e32 v0, 1, v0
+; GFX12-NEXT: s_waitcnt lgkmcnt(0)
+; GFX12-NEXT: global_load_u16 v1, v0, s[0:1]
+; GFX12-NEXT: s_waitcnt vmcnt(0)
+; GFX12-NEXT: v_max_num_f16_e32 v1, v1, v1
+; GFX12-NEXT: global_store_b16 v0, v1, s[2:3]
+; GFX12-NEXT: s_nop 0
+; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX12-NEXT: s_endpgm
%id = tail call i32 @llvm.amdgcn.workitem.id.x()
%gep = getelementptr inbounds half, ptr addrspace(1) %arg, i32 %id
%v = load half, ptr addrspace(1) %gep, align 2
@@ -2272,6 +2434,19 @@ define amdgpu_kernel void @test_canonicalize_value_v2f16_denorm(ptr addrspace(1)
; GFX11-NEXT: s_nop 0
; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
; GFX11-NEXT: s_endpgm
+;
+; GFX12-LABEL: test_canonicalize_value_v2f16_denorm:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: s_load_b128 s[0:3], s[0:1], 0x0
+; GFX12-NEXT: v_lshlrev_b32_e32 v0, 2, v0
+; GFX12-NEXT: s_waitcnt lgkmcnt(0)
+; GFX12-NEXT: global_load_b32 v1, v0, s[0:1]
+; GFX12-NEXT: s_waitcnt vmcnt(0)
+; GFX12-NEXT: v_pk_max_num_f16 v1, v1, v1
+; GFX12-NEXT: global_store_b32 v0, v1, s[2:3]
+; GFX12-NEXT: s_nop 0
+; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX12-NEXT: s_endpgm
%id = tail call i32 @llvm.amdgcn.workitem.id.x()
%gep = getelementptr inbounds <2 x half>, ptr addrspace(1) %arg, i32 %id
%v = load <2 x half>, ptr addrspace(1) %gep, align 4
@@ -2329,20 +2504,20 @@ define amdgpu_kernel void @v_test_canonicalize_var_v2f64(ptr addrspace(1) %out)
; GFX9-NEXT: global_store_dwordx4 v4, v[0:3], s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11-LABEL: v_test_canonicalize_var_v2f64:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11-NEXT: v_lshlrev_b32_e32 v0, 4, v0
-; GFX11-NEXT: v_mov_b32_e32 v4, 0
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_load_b128 v[0:3], v0, s[0:1]
-; GFX11-NEXT: s_waitcnt vmcnt(0)
-; GFX11-NEXT: v_max_f64 v[2:3], v[2:3], v[2:3]
-; GFX11-NEXT: v_max_f64 v[0:1], v[0:1], v[0:1]
-; GFX11-NEXT: global_store_b128 v4, v[0:3], s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: v_test_canonicalize_var_v2f64:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11PLUS-NEXT: v_lshlrev_b32_e32 v0, 4, v0
+; GFX11PLUS-NEXT: v_mov_b32_e32 v4, 0
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_load_b128 v[0:3], v0, s[0:1]
+; GFX11PLUS-NEXT: s_waitcnt vmcnt(0)
+; GFX11PLUS-NEXT: v_max_f64 v[2:3], v[2:3], v[2:3]
+; GFX11PLUS-NEXT: v_max_f64 v[0:1], v[0:1], v[0:1]
+; GFX11PLUS-NEXT: global_store_b128 v4, v[0:3], s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%tid = call i32 @llvm.amdgcn.workitem.id.x()
%gep = getelementptr <2 x double>, ptr addrspace(1) %out, i32 %tid
%val = load <2 x double>, ptr addrspace(1) %gep
@@ -2372,6 +2547,12 @@ define <2 x float> @v_test_canonicalize_v2f32_flush(<2 x float> %arg) #1 {
; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX11-NEXT: v_dual_max_f32 v0, v0, v0 :: v_dual_max_f32 v1, v1, v1
; GFX11-NEXT: s_setpc_b64 s[30:31]
+;
+; GFX12-LABEL: v_test_canonicalize_v2f32_flush:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
+; GFX12-NEXT: v_dual_max_num_f32 v0, v0, v0 :: v_dual_max_num_f32 v1, v1, v1
+; GFX12-NEXT: s_setpc_b64 s[30:31]
%canon = call <2 x float> @llvm.canonicalize.v2f32(<2 x float> %arg)
ret <2 x float> %canon
}
@@ -2400,6 +2581,13 @@ define <3 x float> @v_test_canonicalize_v3f32_flush(<3 x float> %arg) #1 {
; GFX11-NEXT: v_dual_max_f32 v0, v0, v0 :: v_dual_max_f32 v1, v1, v1
; GFX11-NEXT: v_max_f32_e32 v2, v2, v2
; GFX11-NEXT: s_setpc_b64 s[30:31]
+;
+; GFX12-LABEL: v_test_canonicalize_v3f32_flush:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
+; GFX12-NEXT: v_dual_max_num_f32 v0, v0, v0 :: v_dual_max_num_f32 v1, v1, v1
+; GFX12-NEXT: v_max_num_f32_e32 v2, v2, v2
+; GFX12-NEXT: s_setpc_b64 s[30:31]
%canon = call <3 x float> @llvm.canonicalize.v3f32(<3 x float> %arg)
ret <3 x float> %canon
}
@@ -2430,6 +2618,13 @@ define <4 x float> @v_test_canonicalize_v4f32_flush(<4 x float> %arg) #1 {
; GFX11-NEXT: v_dual_max_f32 v0, v0, v0 :: v_dual_max_f32 v1, v1, v1
; GFX11-NEXT: v_dual_max_f32 v2, v2, v2 :: v_dual_max_f32 v3, v3, v3
; GFX11-NEXT: s_setpc_b64 s[30:31]
+;
+; GFX12-LABEL: v_test_canonicalize_v4f32_flush:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
+; GFX12-NEXT: v_dual_max_num_f32 v0, v0, v0 :: v_dual_max_num_f32 v1, v1, v1
+; GFX12-NEXT: v_dual_max_num_f32 v2, v2, v2 :: v_dual_max_num_f32 v3, v3, v3
+; GFX12-NEXT: s_setpc_b64 s[30:31]
%canon = call <4 x float> @llvm.canonicalize.v4f32(<4 x float> %arg)
ret <4 x float> %canon
}
@@ -2470,6 +2665,15 @@ define <8 x float> @v_test_canonicalize_v8f32_flush(<8 x float> %arg) #1 {
; GFX11-NEXT: v_dual_max_f32 v4, v4, v4 :: v_dual_max_f32 v5, v5, v5
; GFX11-NEXT: v_dual_max_f32 v6, v6, v6 :: v_dual_max_f32 v7, v7, v7
; GFX11-NEXT: s_setpc_b64 s[30:31]
+;
+; GFX12-LABEL: v_test_canonicalize_v8f32_flush:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
+; GFX12-NEXT: v_dual_max_num_f32 v0, v0, v0 :: v_dual_max_num_f32 v1, v1, v1
+; GFX12-NEXT: v_dual_max_num_f32 v2, v2, v2 :: v_dual_max_num_f32 v3, v3, v3
+; GFX12-NEXT: v_dual_max_num_f32 v4, v4, v4 :: v_dual_max_num_f32 v5, v5, v5
+; GFX12-NEXT: v_dual_max_num_f32 v6, v6, v6 :: v_dual_max_num_f32 v7, v7, v7
+; GFX12-NEXT: s_setpc_b64 s[30:31]
%canon = call <8 x float> @llvm.canonicalize.v8f32(<8 x float> %arg)
ret <8 x float> %canon
}
@@ -2489,12 +2693,12 @@ define <2 x double> @v_test_canonicalize_v2f64(<2 x double> %arg) #1 {
; GFX9-NEXT: v_max_f64 v[2:3], v[2:3], v[2:3]
; GFX9-NEXT: s_setpc_b64 s[30:31]
;
-; GFX11-LABEL: v_test_canonicalize_v2f64:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
-; GFX11-NEXT: v_max_f64 v[0:1], v[0:1], v[0:1]
-; GFX11-NEXT: v_max_f64 v[2:3], v[2:3], v[2:3]
-; GFX11-NEXT: s_setpc_b64 s[30:31]
+; GFX11PLUS-LABEL: v_test_canonicalize_v2f64:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
+; GFX11PLUS-NEXT: v_max_f64 v[0:1], v[0:1], v[0:1]
+; GFX11PLUS-NEXT: v_max_f64 v[2:3], v[2:3], v[2:3]
+; GFX11PLUS-NEXT: s_setpc_b64 s[30:31]
%canon = call <2 x double> @llvm.canonicalize.v2f64(<2 x double> %arg)
ret <2 x double> %canon
}
@@ -2516,13 +2720,13 @@ define <3 x double> @v_test_canonicalize_v3f64(<3 x double> %arg) #1 {
; GFX9-NEXT: v_max_f64 v[4:5], v[4:5], v[4:5]
; GFX9-NEXT: s_setpc_b64 s[30:31]
;
-; GFX11-LABEL: v_test_canonicalize_v3f64:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
-; GFX11-NEXT: v_max_f64 v[0:1], v[0:1], v[0:1]
-; GFX11-NEXT: v_max_f64 v[2:3], v[2:3], v[2:3]
-; GFX11-NEXT: v_max_f64 v[4:5], v[4:5], v[4:5]
-; GFX11-NEXT: s_setpc_b64 s[30:31]
+; GFX11PLUS-LABEL: v_test_canonicalize_v3f64:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
+; GFX11PLUS-NEXT: v_max_f64 v[0:1], v[0:1], v[0:1]
+; GFX11PLUS-NEXT: v_max_f64 v[2:3], v[2:3], v[2:3]
+; GFX11PLUS-NEXT: v_max_f64 v[4:5], v[4:5], v[4:5]
+; GFX11PLUS-NEXT: s_setpc_b64 s[30:31]
%canon = call <3 x double> @llvm.canonicalize.v3f64(<3 x double> %arg)
ret <3 x double> %canon
}
@@ -2546,14 +2750,14 @@ define <4 x double> @v_test_canonicalize_v4f64(<4 x double> %arg) #1 {
; GFX9-NEXT: v_max_f64 v[6:7], v[6:7], v[6:7]
; GFX9-NEXT: s_setpc_b64 s[30:31]
;
-; GFX11-LABEL: v_test_canonicalize_v4f64:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
-; GFX11-NEXT: v_max_f64 v[0:1], v[0:1], v[0:1]
-; GFX11-NEXT: v_max_f64 v[2:3], v[2:3], v[2:3]
-; GFX11-NEXT: v_max_f64 v[4:5], v[4:5], v[4:5]
-; GFX11-NEXT: v_max_f64 v[6:7], v[6:7], v[6:7]
-; GFX11-NEXT: s_setpc_b64 s[30:31]
+; GFX11PLUS-LABEL: v_test_canonicalize_v4f64:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
+; GFX11PLUS-NEXT: v_max_f64 v[0:1], v[0:1], v[0:1]
+; GFX11PLUS-NEXT: v_max_f64 v[2:3], v[2:3], v[2:3]
+; GFX11PLUS-NEXT: v_max_f64 v[4:5], v[4:5], v[4:5]
+; GFX11PLUS-NEXT: v_max_f64 v[6:7], v[6:7], v[6:7]
+; GFX11PLUS-NEXT: s_setpc_b64 s[30:31]
%canon = call <4 x double> @llvm.canonicalize.v4f64(<4 x double> %arg)
ret <4 x double> %canon
}
diff --git a/llvm/test/CodeGen/AMDGPU/omod.ll b/llvm/test/CodeGen/AMDGPU/omod.ll
index c0491acd8a416c..e00b4f5f78409b 100644
--- a/llvm/test/CodeGen/AMDGPU/omod.ll
+++ b/llvm/test/CodeGen/AMDGPU/omod.ll
@@ -1,7 +1,8 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -march=amdgcn -mcpu=tahiti -verify-machineinstrs < %s | FileCheck --check-prefixes=SI %s
; RUN: llc -march=amdgcn -mcpu=fiji -verify-machineinstrs < %s | FileCheck --check-prefixes=VI %s
-; RUN: llc -march=amdgcn -mcpu=gfx1100 -verify-machineinstrs < %s | FileCheck --check-prefixes=GFX11 %s
+; RUN: llc -march=amdgcn -mcpu=gfx1100 -verify-machineinstrs < %s | FileCheck --check-prefixes=GFX11PLUS,GFX11 %s
+; RUN: llc -march=amdgcn -mcpu=gfx1200 -verify-machineinstrs < %s | FileCheck --check-prefixes=GFX11PLUS,GFX12 %s
; IEEE bit enabled for compute kernel, so shouldn't use.
define amdgpu_kernel void @v_omod_div2_f32_enable_ieee_signed_zeros(ptr addrspace(1) %out, ptr addrspace(1) %aptr) #4 {
@@ -40,20 +41,20 @@ define amdgpu_kernel void @v_omod_div2_f32_enable_ieee_signed_zeros(ptr addrspac
; VI-NEXT: flat_store_dword v[0:1], v2
; VI-NEXT: s_endpgm
;
-; GFX11-LABEL: v_omod_div2_f32_enable_ieee_signed_zeros:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b128 s[0:3], s[0:1], 0x24
-; GFX11-NEXT: v_lshlrev_b32_e32 v0, 2, v0
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_load_b32 v1, v0, s[2:3]
-; GFX11-NEXT: s_waitcnt vmcnt(0)
-; GFX11-NEXT: v_add_f32_e32 v1, 1.0, v1
-; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
-; GFX11-NEXT: v_mul_f32_e32 v1, 0.5, v1
-; GFX11-NEXT: global_store_b32 v0, v1, s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: v_omod_div2_f32_enable_ieee_signed_zeros:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b128 s[0:3], s[0:1], 0x24
+; GFX11PLUS-NEXT: v_lshlrev_b32_e32 v0, 2, v0
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_load_b32 v1, v0, s[2:3]
+; GFX11PLUS-NEXT: s_waitcnt vmcnt(0)
+; GFX11PLUS-NEXT: v_add_f32_e32 v1, 1.0, v1
+; GFX11PLUS-NEXT: s_delay_alu instid0(VALU_DEP_1)
+; GFX11PLUS-NEXT: v_mul_f32_e32 v1, 0.5, v1
+; GFX11PLUS-NEXT: global_store_b32 v0, v1, s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%tid = call i32 @llvm.amdgcn.workitem.id.x()
%gep0 = getelementptr float, ptr addrspace(1) %aptr, i32 %tid
%out.gep = getelementptr float, ptr addrspace(1) %out, i32 %tid
@@ -115,6 +116,21 @@ define amdgpu_kernel void @v_omod_div2_f64_enable_ieee_signed_zeros(ptr addrspac
; GFX11-NEXT: s_nop 0
; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
; GFX11-NEXT: s_endpgm
+;
+; GFX12-LABEL: v_omod_div2_f64_enable_ieee_signed_zeros:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: s_load_b128 s[0:3], s[0:1], 0x24
+; GFX12-NEXT: v_lshlrev_b32_e32 v2, 3, v0
+; GFX12-NEXT: s_waitcnt lgkmcnt(0)
+; GFX12-NEXT: global_load_b64 v[0:1], v2, s[2:3]
+; GFX12-NEXT: s_waitcnt vmcnt(0)
+; GFX12-NEXT: v_add_f64_e32 v[0:1], 1.0, v[0:1]
+; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1)
+; GFX12-NEXT: v_mul_f64_e32 v[0:1], 0.5, v[0:1]
+; GFX12-NEXT: global_store_b64 v2, v[0:1], s[0:1]
+; GFX12-NEXT: s_nop 0
+; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX12-NEXT: s_endpgm
%tid = call i32 @llvm.amdgcn.workitem.id.x()
%gep0 = getelementptr double, ptr addrspace(1) %aptr, i32 %tid
%out.gep = getelementptr double, ptr addrspace(1) %out, i32 %tid
@@ -162,20 +178,20 @@ define amdgpu_kernel void @v_omod_div2_f32_enable_ieee_nsz(ptr addrspace(1) %out
; VI-NEXT: flat_store_dword v[0:1], v2
; VI-NEXT: s_endpgm
;
-; GFX11-LABEL: v_omod_div2_f32_enable_ieee_nsz:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: s_load_b128 s[0:3], s[0:1], 0x24
-; GFX11-NEXT: v_lshlrev_b32_e32 v0, 2, v0
-; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: global_load_b32 v1, v0, s[2:3]
-; GFX11-NEXT: s_waitcnt vmcnt(0)
-; GFX11-NEXT: v_add_f32_e32 v1, 1.0, v1
-; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
-; GFX11-NEXT: v_mul_f32_e32 v1, 0.5, v1
-; GFX11-NEXT: global_store_b32 v0, v1, s[0:1]
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: v_omod_div2_f32_enable_ieee_nsz:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: s_load_b128 s[0:3], s[0:1], 0x24
+; GFX11PLUS-NEXT: v_lshlrev_b32_e32 v0, 2, v0
+; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11PLUS-NEXT: global_load_b32 v1, v0, s[2:3]
+; GFX11PLUS-NEXT: s_waitcnt vmcnt(0)
+; GFX11PLUS-NEXT: v_add_f32_e32 v1, 1.0, v1
+; GFX11PLUS-NEXT: s_delay_alu instid0(VALU_DEP_1)
+; GFX11PLUS-NEXT: v_mul_f32_e32 v1, 0.5, v1
+; GFX11PLUS-NEXT: global_store_b32 v0, v1, s[0:1]
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%tid = call i32 @llvm.amdgcn.workitem.id.x()
%gep0 = getelementptr float, ptr addrspace(1) %aptr, i32 %tid
%out.gep = getelementptr float, ptr addrspace(1) %out, i32 %tid
@@ -237,6 +253,21 @@ define amdgpu_kernel void @v_omod_div2_f64_enable_ieee_nsz(ptr addrspace(1) %out
; GFX11-NEXT: s_nop 0
; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
; GFX11-NEXT: s_endpgm
+;
+; GFX12-LABEL: v_omod_div2_f64_enable_ieee_nsz:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: s_load_b128 s[0:3], s[0:1], 0x24
+; GFX12-NEXT: v_lshlrev_b32_e32 v2, 3, v0
+; GFX12-NEXT: s_waitcnt lgkmcnt(0)
+; GFX12-NEXT: global_load_b64 v[0:1], v2, s[2:3]
+; GFX12-NEXT: s_waitcnt vmcnt(0)
+; GFX12-NEXT: v_add_f64_e32 v[0:1], 1.0, v[0:1]
+; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1)
+; GFX12-NEXT: v_mul_f64_e32 v[0:1], 0.5, v[0:1]
+; GFX12-NEXT: global_store_b64 v2, v[0:1], s[0:1]
+; GFX12-NEXT: s_nop 0
+; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX12-NEXT: s_endpgm
%tid = call i32 @llvm.amdgcn.workitem.id.x()
%gep0 = getelementptr double, ptr addrspace(1) %aptr, i32 %tid
%out.gep = getelementptr double, ptr addrspace(1) %out, i32 %tid
@@ -265,15 +296,15 @@ define amdgpu_ps void @v_omod_div2_f32_signed_zeros(float %a) #4 {
; VI-NEXT: flat_store_dword v[0:1], v0
; VI-NEXT: s_endpgm
;
-; GFX11-LABEL: v_omod_div2_f32_signed_zeros:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: v_add_f32_e32 v0, 1.0, v0
-; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
-; GFX11-NEXT: v_mul_f32_e32 v0, 0.5, v0
-; GFX11-NEXT: global_store_b32 v[0:1], v0, off
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: v_omod_div2_f32_signed_zeros:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: v_add_f32_e32 v0, 1.0, v0
+; GFX11PLUS-NEXT: s_delay_alu instid0(VALU_DEP_1)
+; GFX11PLUS-NEXT: v_mul_f32_e32 v0, 0.5, v0
+; GFX11PLUS-NEXT: global_store_b32 v[0:1], v0, off
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%add = fadd float %a, 1.0
%div2 = fmul float %add, 0.5
store float %div2, ptr addrspace(1) undef
@@ -307,6 +338,16 @@ define amdgpu_ps void @v_omod_div2_f64_signed_zeros(double %a) #4 {
; GFX11-NEXT: s_nop 0
; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
; GFX11-NEXT: s_endpgm
+;
+; GFX12-LABEL: v_omod_div2_f64_signed_zeros:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: v_add_f64_e32 v[0:1], 1.0, v[0:1]
+; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1)
+; GFX12-NEXT: v_mul_f64_e32 v[0:1], 0.5, v[0:1]
+; GFX12-NEXT: global_store_b64 v[0:1], v[0:1], off
+; GFX12-NEXT: s_nop 0
+; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX12-NEXT: s_endpgm
%add = fadd double %a, 1.0
%div2 = fmul double %add, 0.5
store double %div2, ptr addrspace(1) undef
@@ -328,13 +369,13 @@ define amdgpu_ps void @v_omod_div2_f32(float %a) #0 {
; VI-NEXT: flat_store_dword v[0:1], v0
; VI-NEXT: s_endpgm
;
-; GFX11-LABEL: v_omod_div2_f32:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: v_add_f32_e64 v0, v0, 1.0 div:2
-; GFX11-NEXT: global_store_b32 v[0:1], v0, off
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: v_omod_div2_f32:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: v_add_f32_e64 v0, v0, 1.0 div:2
+; GFX11PLUS-NEXT: global_store_b32 v[0:1], v0, off
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%add = fadd float %a, 1.0
%div2 = fmul float %add, 0.5
store float %div2, ptr addrspace(1) undef
@@ -363,6 +404,16 @@ define amdgpu_ps void @v_omod_div2_f64(double %a) #5 {
; GFX11-NEXT: s_nop 0
; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
; GFX11-NEXT: s_endpgm
+;
+; GFX12-LABEL: v_omod_div2_f64:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: v_add_f64_e32 v[0:1], 1.0, v[0:1]
+; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1)
+; GFX12-NEXT: v_mul_f64_e32 v[0:1], 0.5, v[0:1]
+; GFX12-NEXT: global_store_b64 v[0:1], v[0:1], off
+; GFX12-NEXT: s_nop 0
+; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX12-NEXT: s_endpgm
%add = fadd nsz double %a, 1.0
%div2 = fmul nsz double %add, 0.5
store double %div2, ptr addrspace(1) undef
@@ -384,13 +435,13 @@ define amdgpu_ps void @v_omod_mul2_f32(float %a) #0 {
; VI-NEXT: flat_store_dword v[0:1], v0
; VI-NEXT: s_endpgm
;
-; GFX11-LABEL: v_omod_mul2_f32:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: v_add_f32_e64 v0, v0, 1.0 mul:2
-; GFX11-NEXT: global_store_b32 v[0:1], v0, off
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: v_omod_mul2_f32:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: v_add_f32_e64 v0, v0, 1.0 mul:2
+; GFX11PLUS-NEXT: global_store_b32 v[0:1], v0, off
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%add = fadd float %a, 1.0
%div2 = fmul float %add, 2.0
store float %div2, ptr addrspace(1) undef
@@ -419,6 +470,14 @@ define amdgpu_ps void @v_omod_mul2_med3(float %x, float %y, float %z) #0 {
; GFX11-NEXT: s_nop 0
; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
; GFX11-NEXT: s_endpgm
+;
+; GFX12-LABEL: v_omod_mul2_med3:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: v_med3_num_f32 v0, v0, v1, v2 mul:2
+; GFX12-NEXT: global_store_b32 v[0:1], v0, off
+; GFX12-NEXT: s_nop 0
+; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX12-NEXT: s_endpgm
%fmed3 = call float @llvm.amdgcn.fmed3.f32(float %x, float %y, float %z)
%div2 = fmul float %fmed3, 2.0
store float %div2, float addrspace(1)* undef
@@ -447,6 +506,16 @@ define amdgpu_ps void @v_omod_mul2_f64(double %a) #5 {
; GFX11-NEXT: s_nop 0
; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
; GFX11-NEXT: s_endpgm
+;
+; GFX12-LABEL: v_omod_mul2_f64:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: v_add_f64_e32 v[0:1], 1.0, v[0:1]
+; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1)
+; GFX12-NEXT: v_add_f64_e32 v[0:1], v[0:1], v[0:1]
+; GFX12-NEXT: global_store_b64 v[0:1], v[0:1], off
+; GFX12-NEXT: s_nop 0
+; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX12-NEXT: s_endpgm
%add = fadd nsz double %a, 1.0
%div2 = fmul nsz double %add, 2.0
store double %div2, ptr addrspace(1) undef
@@ -468,13 +537,13 @@ define amdgpu_ps void @v_omod_mul4_f32(float %a) #0 {
; VI-NEXT: flat_store_dword v[0:1], v0
; VI-NEXT: s_endpgm
;
-; GFX11-LABEL: v_omod_mul4_f32:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: v_add_f32_e64 v0, v0, 1.0 mul:4
-; GFX11-NEXT: global_store_b32 v[0:1], v0, off
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: v_omod_mul4_f32:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: v_add_f32_e64 v0, v0, 1.0 mul:4
+; GFX11PLUS-NEXT: global_store_b32 v[0:1], v0, off
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%add = fadd float %a, 1.0
%div2 = fmul float %add, 4.0
store float %div2, ptr addrspace(1) undef
@@ -503,6 +572,16 @@ define amdgpu_ps void @v_omod_mul4_f64(double %a) #5 {
; GFX11-NEXT: s_nop 0
; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
; GFX11-NEXT: s_endpgm
+;
+; GFX12-LABEL: v_omod_mul4_f64:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: v_add_f64_e32 v[0:1], 1.0, v[0:1]
+; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1)
+; GFX12-NEXT: v_mul_f64_e32 v[0:1], 4.0, v[0:1]
+; GFX12-NEXT: global_store_b64 v[0:1], v[0:1], off
+; GFX12-NEXT: s_nop 0
+; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX12-NEXT: s_endpgm
%add = fadd nsz double %a, 1.0
%div2 = fmul nsz double %add, 4.0
store double %div2, ptr addrspace(1) undef
@@ -542,6 +621,19 @@ define amdgpu_ps void @v_omod_mul4_multi_use_f32(float %a) #0 {
; GFX11-NEXT: s_nop 0
; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
; GFX11-NEXT: s_endpgm
+;
+; GFX12-LABEL: v_omod_mul4_multi_use_f32:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: v_add_f32_e32 v0, 1.0, v0
+; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1)
+; GFX12-NEXT: v_mul_f32_e32 v1, 4.0, v0
+; GFX12-NEXT: s_clause 0x1
+; GFX12-NEXT: global_store_b32 v[0:1], v1, off
+; GFX12-NEXT: global_store_b32 v[0:1], v0, off th:TH_STORE_NT_RT
+; GFX12-NEXT: s_waitcnt_vscnt null, 0x0
+; GFX12-NEXT: s_nop 0
+; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX12-NEXT: s_endpgm
%add = fadd float %a, 1.0
%div2 = fmul float %add, 4.0
store float %div2, ptr addrspace(1) undef
@@ -564,13 +656,13 @@ define amdgpu_ps void @v_omod_mul4_dbg_use_f32(float %a) #0 {
; VI-NEXT: flat_store_dword v[0:1], v0
; VI-NEXT: s_endpgm
;
-; GFX11-LABEL: v_omod_mul4_dbg_use_f32:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: v_add_f32_e64 v0, v0, 1.0 mul:4
-; GFX11-NEXT: global_store_b32 v[0:1], v0, off
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: v_omod_mul4_dbg_use_f32:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: v_add_f32_e64 v0, v0, 1.0 mul:4
+; GFX11PLUS-NEXT: global_store_b32 v[0:1], v0, off
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%add = fadd float %a, 1.0
call void @llvm.dbg.value(metadata float %add, i64 0, metadata !4, metadata !9), !dbg !10
%div2 = fmul float %add, 4.0
@@ -594,13 +686,13 @@ define amdgpu_ps void @v_clamp_omod_div2_f32(float %a) #0 {
; VI-NEXT: flat_store_dword v[0:1], v0
; VI-NEXT: s_endpgm
;
-; GFX11-LABEL: v_clamp_omod_div2_f32:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: v_add_f32_e64 v0, v0, 1.0 clamp div:2
-; GFX11-NEXT: global_store_b32 v[0:1], v0, off
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: v_clamp_omod_div2_f32:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: v_add_f32_e64 v0, v0, 1.0 clamp div:2
+; GFX11PLUS-NEXT: global_store_b32 v[0:1], v0, off
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%add = fadd float %a, 1.0
%div2 = fmul float %add, 0.5
@@ -628,15 +720,15 @@ define amdgpu_ps void @v_omod_div2_clamp_f32(float %a) #0 {
; VI-NEXT: flat_store_dword v[0:1], v0
; VI-NEXT: s_endpgm
;
-; GFX11-LABEL: v_omod_div2_clamp_f32:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: v_add_f32_e64 v0, v0, 1.0 clamp
-; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
-; GFX11-NEXT: v_mul_f32_e32 v0, 0.5, v0
-; GFX11-NEXT: global_store_b32 v[0:1], v0, off
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: v_omod_div2_clamp_f32:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: v_add_f32_e64 v0, v0, 1.0 clamp
+; GFX11PLUS-NEXT: s_delay_alu instid0(VALU_DEP_1)
+; GFX11PLUS-NEXT: v_mul_f32_e32 v0, 0.5, v0
+; GFX11PLUS-NEXT: global_store_b32 v[0:1], v0, off
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%add = fadd float %a, 1.0
%max = call float @llvm.maxnum.f32(float %add, float 0.0)
%clamp = call float @llvm.minnum.f32(float %max, float 1.0)
@@ -662,15 +754,15 @@ define amdgpu_ps void @v_omod_div2_abs_src_f32(float %a) #0 {
; VI-NEXT: flat_store_dword v[0:1], v0
; VI-NEXT: s_endpgm
;
-; GFX11-LABEL: v_omod_div2_abs_src_f32:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: v_add_f32_e32 v0, 1.0, v0
-; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
-; GFX11-NEXT: v_mul_f32_e64 v0, |v0|, 0.5
-; GFX11-NEXT: global_store_b32 v[0:1], v0, off
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: v_omod_div2_abs_src_f32:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: v_add_f32_e32 v0, 1.0, v0
+; GFX11PLUS-NEXT: s_delay_alu instid0(VALU_DEP_1)
+; GFX11PLUS-NEXT: v_mul_f32_e64 v0, |v0|, 0.5
+; GFX11PLUS-NEXT: global_store_b32 v[0:1], v0, off
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%add = fadd float %a, 1.0
%abs.add = call float @llvm.fabs.f32(float %add)
%div2 = fmul float %abs.add, 0.5
@@ -693,13 +785,13 @@ define amdgpu_ps void @v_omod_add_self_clamp_f32(float %a) #0 {
; VI-NEXT: flat_store_dword v[0:1], v0
; VI-NEXT: s_endpgm
;
-; GFX11-LABEL: v_omod_add_self_clamp_f32:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: v_add_f32_e64 v0, v0, v0 clamp
-; GFX11-NEXT: global_store_b32 v[0:1], v0, off
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: v_omod_add_self_clamp_f32:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: v_add_f32_e64 v0, v0, v0 clamp
+; GFX11PLUS-NEXT: global_store_b32 v[0:1], v0, off
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%add = fadd float %a, %a
%max = call float @llvm.maxnum.f32(float %add, float 0.0)
%clamp = call float @llvm.minnum.f32(float %max, float 1.0)
@@ -733,6 +825,16 @@ define amdgpu_ps void @v_omod_add_clamp_self_f32(float %a) #0 {
; GFX11-NEXT: s_nop 0
; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
; GFX11-NEXT: s_endpgm
+;
+; GFX12-LABEL: v_omod_add_clamp_self_f32:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: v_max_num_f32_e64 v0, v0, v0 clamp
+; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1)
+; GFX12-NEXT: v_add_f32_e32 v0, v0, v0
+; GFX12-NEXT: global_store_b32 v[0:1], v0, off
+; GFX12-NEXT: s_nop 0
+; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX12-NEXT: s_endpgm
%max = call float @llvm.maxnum.f32(float %a, float 0.0)
%clamp = call float @llvm.minnum.f32(float %max, float 1.0)
%add = fadd float %clamp, %clamp
@@ -757,15 +859,15 @@ define amdgpu_ps void @v_omod_add_abs_self_f32(float %a) #0 {
; VI-NEXT: flat_store_dword v[0:1], v0
; VI-NEXT: s_endpgm
;
-; GFX11-LABEL: v_omod_add_abs_self_f32:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: v_add_f32_e32 v0, 1.0, v0
-; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
-; GFX11-NEXT: v_add_f32_e64 v0, |v0|, |v0|
-; GFX11-NEXT: global_store_b32 v[0:1], v0, off
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: v_omod_add_abs_self_f32:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: v_add_f32_e32 v0, 1.0, v0
+; GFX11PLUS-NEXT: s_delay_alu instid0(VALU_DEP_1)
+; GFX11PLUS-NEXT: v_add_f32_e64 v0, |v0|, |v0|
+; GFX11PLUS-NEXT: global_store_b32 v[0:1], v0, off
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%x = fadd float %a, 1.0
%abs.x = call float @llvm.fabs.f32(float %x)
%add = fadd float %abs.x, %abs.x
@@ -790,15 +892,15 @@ define amdgpu_ps void @v_omod_add_abs_x_x_f32(float %a) #0 {
; VI-NEXT: flat_store_dword v[0:1], v0
; VI-NEXT: s_endpgm
;
-; GFX11-LABEL: v_omod_add_abs_x_x_f32:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: v_add_f32_e32 v0, 1.0, v0
-; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
-; GFX11-NEXT: v_add_f32_e64 v0, |v0|, v0
-; GFX11-NEXT: global_store_b32 v[0:1], v0, off
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: v_omod_add_abs_x_x_f32:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: v_add_f32_e32 v0, 1.0, v0
+; GFX11PLUS-NEXT: s_delay_alu instid0(VALU_DEP_1)
+; GFX11PLUS-NEXT: v_add_f32_e64 v0, |v0|, v0
+; GFX11PLUS-NEXT: global_store_b32 v[0:1], v0, off
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%x = fadd float %a, 1.0
%abs.x = call float @llvm.fabs.f32(float %x)
%add = fadd float %abs.x, %x
@@ -823,15 +925,15 @@ define amdgpu_ps void @v_omod_add_x_abs_x_f32(float %a) #0 {
; VI-NEXT: flat_store_dword v[0:1], v0
; VI-NEXT: s_endpgm
;
-; GFX11-LABEL: v_omod_add_x_abs_x_f32:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: v_add_f32_e32 v0, 1.0, v0
-; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
-; GFX11-NEXT: v_add_f32_e64 v0, v0, |v0|
-; GFX11-NEXT: global_store_b32 v[0:1], v0, off
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: v_omod_add_x_abs_x_f32:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: v_add_f32_e32 v0, 1.0, v0
+; GFX11PLUS-NEXT: s_delay_alu instid0(VALU_DEP_1)
+; GFX11PLUS-NEXT: v_add_f32_e64 v0, v0, |v0|
+; GFX11PLUS-NEXT: global_store_b32 v[0:1], v0, off
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%x = fadd float %a, 1.0
%abs.x = call float @llvm.fabs.f32(float %x)
%add = fadd float %x, %abs.x
@@ -857,15 +959,15 @@ define amdgpu_ps void @v_omod_div2_omod_div2_f32(float %a) #0 {
; VI-NEXT: flat_store_dword v[0:1], v0
; VI-NEXT: s_endpgm
;
-; GFX11-LABEL: v_omod_div2_omod_div2_f32:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: v_add_f32_e64 v0, v0, 1.0 div:2
-; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
-; GFX11-NEXT: v_mul_f32_e32 v0, 0.5, v0
-; GFX11-NEXT: global_store_b32 v[0:1], v0, off
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: v_omod_div2_omod_div2_f32:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: v_add_f32_e64 v0, v0, 1.0 div:2
+; GFX11PLUS-NEXT: s_delay_alu instid0(VALU_DEP_1)
+; GFX11PLUS-NEXT: v_mul_f32_e32 v0, 0.5, v0
+; GFX11PLUS-NEXT: global_store_b32 v[0:1], v0, off
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%add = fadd float %a, 1.0
%div2.0 = fmul float %add, 0.5
%div2.1 = fmul float %div2.0, 0.5
@@ -891,15 +993,15 @@ define amdgpu_ps void @v_omod_div2_f32_denormals(float %a) #2 {
; VI-NEXT: flat_store_dword v[0:1], v0
; VI-NEXT: s_endpgm
;
-; GFX11-LABEL: v_omod_div2_f32_denormals:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: v_add_f32_e32 v0, 1.0, v0
-; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
-; GFX11-NEXT: v_mul_f32_e32 v0, 0.5, v0
-; GFX11-NEXT: global_store_b32 v[0:1], v0, off
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: v_omod_div2_f32_denormals:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: v_add_f32_e32 v0, 1.0, v0
+; GFX11PLUS-NEXT: s_delay_alu instid0(VALU_DEP_1)
+; GFX11PLUS-NEXT: v_mul_f32_e32 v0, 0.5, v0
+; GFX11PLUS-NEXT: global_store_b32 v[0:1], v0, off
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%add = fadd float %a, 1.0
%div2 = fmul float %add, 0.5
store float %div2, ptr addrspace(1) undef
@@ -933,6 +1035,16 @@ define amdgpu_ps void @v_omod_div2_f64_denormals(double %a) #6 {
; GFX11-NEXT: s_nop 0
; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
; GFX11-NEXT: s_endpgm
+;
+; GFX12-LABEL: v_omod_div2_f64_denormals:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: v_add_f64_e32 v[0:1], 1.0, v[0:1]
+; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1)
+; GFX12-NEXT: v_mul_f64_e32 v[0:1], 0.5, v[0:1]
+; GFX12-NEXT: global_store_b64 v[0:1], v[0:1], off
+; GFX12-NEXT: s_nop 0
+; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX12-NEXT: s_endpgm
%add = fadd double %a, 1.0
%div2 = fmul double %add, 0.5
store double %div2, ptr addrspace(1) undef
@@ -957,15 +1069,15 @@ define amdgpu_ps void @v_omod_mul2_f32_denormals(float %a) #2 {
; VI-NEXT: flat_store_dword v[0:1], v0
; VI-NEXT: s_endpgm
;
-; GFX11-LABEL: v_omod_mul2_f32_denormals:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: v_add_f32_e32 v0, 1.0, v0
-; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
-; GFX11-NEXT: v_add_f32_e32 v0, v0, v0
-; GFX11-NEXT: global_store_b32 v[0:1], v0, off
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: v_omod_mul2_f32_denormals:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: v_add_f32_e32 v0, 1.0, v0
+; GFX11PLUS-NEXT: s_delay_alu instid0(VALU_DEP_1)
+; GFX11PLUS-NEXT: v_add_f32_e32 v0, v0, v0
+; GFX11PLUS-NEXT: global_store_b32 v[0:1], v0, off
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%add = fadd float %a, 1.0
%mul2 = fadd float %add, %add
store float %mul2, ptr addrspace(1) undef
@@ -999,6 +1111,16 @@ define amdgpu_ps void @v_omod_mul2_f64_denormals(double %a) #2 {
; GFX11-NEXT: s_nop 0
; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
; GFX11-NEXT: s_endpgm
+;
+; GFX12-LABEL: v_omod_mul2_f64_denormals:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: v_add_f64_e32 v[0:1], 1.0, v[0:1]
+; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1)
+; GFX12-NEXT: v_add_f64_e32 v[0:1], v[0:1], v[0:1]
+; GFX12-NEXT: global_store_b64 v[0:1], v[0:1], off
+; GFX12-NEXT: s_nop 0
+; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX12-NEXT: s_endpgm
%add = fadd double %a, 1.0
%mul2 = fadd double %add, %add
store double %mul2, ptr addrspace(1) undef
@@ -1025,15 +1147,15 @@ define amdgpu_ps void @v_omod_div2_f16_denormals(half %a) #0 {
; VI-NEXT: flat_store_short v[0:1], v0
; VI-NEXT: s_endpgm
;
-; GFX11-LABEL: v_omod_div2_f16_denormals:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: v_add_f16_e32 v0, 1.0, v0
-; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
-; GFX11-NEXT: v_mul_f16_e32 v0, 0.5, v0
-; GFX11-NEXT: global_store_b16 v[0:1], v0, off
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: v_omod_div2_f16_denormals:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: v_add_f16_e32 v0, 1.0, v0
+; GFX11PLUS-NEXT: s_delay_alu instid0(VALU_DEP_1)
+; GFX11PLUS-NEXT: v_mul_f16_e32 v0, 0.5, v0
+; GFX11PLUS-NEXT: global_store_b16 v[0:1], v0, off
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%add = fadd half %a, 1.0
%div2 = fmul half %add, 0.5
store half %div2, ptr addrspace(1) undef
@@ -1060,15 +1182,15 @@ define amdgpu_ps void @v_omod_mul2_f16_denormals(half %a) #0 {
; VI-NEXT: flat_store_short v[0:1], v0
; VI-NEXT: s_endpgm
;
-; GFX11-LABEL: v_omod_mul2_f16_denormals:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: v_add_f16_e32 v0, 1.0, v0
-; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
-; GFX11-NEXT: v_add_f16_e32 v0, v0, v0
-; GFX11-NEXT: global_store_b16 v[0:1], v0, off
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: v_omod_mul2_f16_denormals:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: v_add_f16_e32 v0, 1.0, v0
+; GFX11PLUS-NEXT: s_delay_alu instid0(VALU_DEP_1)
+; GFX11PLUS-NEXT: v_add_f16_e32 v0, v0, v0
+; GFX11PLUS-NEXT: global_store_b16 v[0:1], v0, off
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%add = fadd half %a, 1.0
%mul2 = fadd half %add, %add
store half %mul2, ptr addrspace(1) undef
@@ -1093,13 +1215,13 @@ define amdgpu_ps void @v_omod_div2_f16_no_denormals(half %a) #3 {
; VI-NEXT: flat_store_short v[0:1], v0
; VI-NEXT: s_endpgm
;
-; GFX11-LABEL: v_omod_div2_f16_no_denormals:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: v_add_f16_e64 v0, v0, 1.0 div:2
-; GFX11-NEXT: global_store_b16 v[0:1], v0, off
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: v_omod_div2_f16_no_denormals:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: v_add_f16_e64 v0, v0, 1.0 div:2
+; GFX11PLUS-NEXT: global_store_b16 v[0:1], v0, off
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%add = fadd half %a, 1.0
%div2 = fmul half %add, 0.5
store half %div2, ptr addrspace(1) undef
@@ -1123,16 +1245,16 @@ define amdgpu_ps void @v_omod_mac_to_mad(float %b, float %a) #0 {
; VI-NEXT: flat_store_dword v[0:1], v0
; VI-NEXT: s_endpgm
;
-; GFX11-LABEL: v_omod_mac_to_mad:
-; GFX11: ; %bb.0:
-; GFX11-NEXT: v_mul_f32_e32 v1, v1, v1
-; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
-; GFX11-NEXT: v_add_f32_e64 v1, v1, v0 mul:2
-; GFX11-NEXT: v_mul_f32_e32 v0, v1, v0
-; GFX11-NEXT: global_store_b32 v[0:1], v0, off
-; GFX11-NEXT: s_nop 0
-; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11-NEXT: s_endpgm
+; GFX11PLUS-LABEL: v_omod_mac_to_mad:
+; GFX11PLUS: ; %bb.0:
+; GFX11PLUS-NEXT: v_mul_f32_e32 v1, v1, v1
+; GFX11PLUS-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
+; GFX11PLUS-NEXT: v_add_f32_e64 v1, v1, v0 mul:2
+; GFX11PLUS-NEXT: v_mul_f32_e32 v0, v1, v0
+; GFX11PLUS-NEXT: global_store_b32 v[0:1], v0, off
+; GFX11PLUS-NEXT: s_nop 0
+; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11PLUS-NEXT: s_endpgm
%mul = fmul float %a, %a
%add = fadd float %mul, %b
%mad = fmul float %add, 2.0
>From 19feae0c527ac0ec759610a65134d11b91ec2067 Mon Sep 17 00:00:00 2001
From: Mirko Brkusanin <Mirko.Brkusanin at amd.com>
Date: Tue, 18 Oct 2022 16:13:59 +0200
Subject: [PATCH 2/2] [AMDGPU] Update uses of new VOP2 pseudos for GFX12
New pseudos were added for instructions that were natively VOP3 on
GFX11: V_ADD_F64_pseudo, V_MUL_F64_pseudo, V_MIN_NUM_F64, V_MAX_NUM_F64,
V_LSHLREV_B64_pseudo
---
llvm/lib/Target/AMDGPU/SIFoldOperands.cpp | 14 +-
llvm/lib/Target/AMDGPU/SIInstructions.td | 13 +-
llvm/test/CodeGen/AMDGPU/clamp.ll | 6 +-
llvm/test/CodeGen/AMDGPU/fcanonicalize.ll | 362 +++++++++++++++-------
llvm/test/CodeGen/AMDGPU/omod.ll | 12 +-
5 files changed, 272 insertions(+), 135 deletions(-)
diff --git a/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp b/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
index aa7639a0f18665..2862a7787e75a3 100644
--- a/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
+++ b/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
@@ -1498,6 +1498,7 @@ const MachineOperand *SIFoldOperands::isClamp(const MachineInstr &MI) const {
case AMDGPU::V_MAX_F16_t16_e64:
case AMDGPU::V_MAX_F16_fake16_e64:
case AMDGPU::V_MAX_F64_e64:
+ case AMDGPU::V_MAX_NUM_F64_e64:
case AMDGPU::V_PK_MAX_F16: {
if (!TII->getNamedOperand(MI, AMDGPU::OpName::clamp)->getImm())
return nullptr;
@@ -1567,7 +1568,8 @@ bool SIFoldOperands::tryFoldClamp(MachineInstr &MI) {
static int getOModValue(unsigned Opc, int64_t Val) {
switch (Opc) {
- case AMDGPU::V_MUL_F64_e64: {
+ case AMDGPU::V_MUL_F64_e64:
+ case AMDGPU::V_MUL_F64_pseudo_e64: {
switch (Val) {
case 0x3fe0000000000000: // 0.5
return SIOutMods::DIV2;
@@ -1618,6 +1620,7 @@ SIFoldOperands::isOMod(const MachineInstr &MI) const {
unsigned Op = MI.getOpcode();
switch (Op) {
case AMDGPU::V_MUL_F64_e64:
+ case AMDGPU::V_MUL_F64_pseudo_e64:
case AMDGPU::V_MUL_F32_e64:
case AMDGPU::V_MUL_F16_t16_e64:
case AMDGPU::V_MUL_F16_fake16_e64:
@@ -1625,8 +1628,8 @@ SIFoldOperands::isOMod(const MachineInstr &MI) const {
// If output denormals are enabled, omod is ignored.
if ((Op == AMDGPU::V_MUL_F32_e64 &&
MFI->getMode().FP32Denormals.Output != DenormalMode::PreserveSign) ||
- ((Op == AMDGPU::V_MUL_F64_e64 || Op == AMDGPU::V_MUL_F16_e64 ||
- Op == AMDGPU::V_MUL_F16_t16_e64 ||
+ ((Op == AMDGPU::V_MUL_F64_e64 || Op == AMDGPU::V_MUL_F64_pseudo_e64 ||
+ Op == AMDGPU::V_MUL_F16_e64 || Op == AMDGPU::V_MUL_F16_t16_e64 ||
Op == AMDGPU::V_MUL_F16_fake16_e64) &&
MFI->getMode().FP64FP16Denormals.Output != DenormalMode::PreserveSign))
return std::pair(nullptr, SIOutMods::NONE);
@@ -1655,6 +1658,7 @@ SIFoldOperands::isOMod(const MachineInstr &MI) const {
return std::pair(RegOp, OMod);
}
case AMDGPU::V_ADD_F64_e64:
+ case AMDGPU::V_ADD_F64_pseudo_e64:
case AMDGPU::V_ADD_F32_e64:
case AMDGPU::V_ADD_F16_e64:
case AMDGPU::V_ADD_F16_t16_e64:
@@ -1662,8 +1666,8 @@ SIFoldOperands::isOMod(const MachineInstr &MI) const {
// If output denormals are enabled, omod is ignored.
if ((Op == AMDGPU::V_ADD_F32_e64 &&
MFI->getMode().FP32Denormals.Output != DenormalMode::PreserveSign) ||
- ((Op == AMDGPU::V_ADD_F64_e64 || Op == AMDGPU::V_ADD_F16_e64 ||
- Op == AMDGPU::V_ADD_F16_t16_e64 ||
+ ((Op == AMDGPU::V_ADD_F64_e64 || Op == AMDGPU::V_ADD_F64_pseudo_e64 ||
+ Op == AMDGPU::V_ADD_F16_e64 || Op == AMDGPU::V_ADD_F16_t16_e64 ||
Op == AMDGPU::V_ADD_F16_fake16_e64) &&
MFI->getMode().FP64FP16Denormals.Output != DenormalMode::PreserveSign))
return std::pair(nullptr, SIOutMods::NONE);
diff --git a/llvm/lib/Target/AMDGPU/SIInstructions.td b/llvm/lib/Target/AMDGPU/SIInstructions.td
index b4bd46d33c1f10..ffa7952888c355 100644
--- a/llvm/lib/Target/AMDGPU/SIInstructions.td
+++ b/llvm/lib/Target/AMDGPU/SIInstructions.td
@@ -1862,7 +1862,10 @@ class ClampPat<Instruction inst, ValueType vt> : GCNPat <
>;
def : ClampPat<V_MAX_F32_e64, f32>;
+let SubtargetPredicate = isNotGFX12Plus in
def : ClampPat<V_MAX_F64_e64, f64>;
+let SubtargetPredicate = isGFX12Plus in
+def : ClampPat<V_MAX_NUM_F64_e64, f64>;
let SubtargetPredicate = NotHasTrue16BitInsts in
def : ClampPat<V_MAX_F16_e64, f16>;
let SubtargetPredicate = UseRealTrue16Insts in
@@ -2990,10 +2993,12 @@ def : GCNPat<
}
// TODO: Handle fneg like other types.
+let SubtargetPredicate = isNotGFX12Plus in {
def : GCNPat<
(fcanonicalize (f64 (VOP3Mods f64:$src, i32:$src_mods))),
(V_MUL_F64_e64 0, CONST.FP64_ONE, $src_mods, $src)
>;
+}
} // End AddedComplexity = -5
multiclass SelectCanonicalizeAsMax<
@@ -3009,7 +3014,13 @@ multiclass SelectCanonicalizeAsMax<
def : GCNPat<
(fcanonicalize (f64 (VOP3Mods f64:$src, i32:$src_mods))),
(V_MAX_F64_e64 $src_mods, $src, $src_mods, $src)> {
- let OtherPredicates = f64_preds;
+ let OtherPredicates = !listconcat(f64_preds, [isNotGFX12Plus]);
+ }
+
+ def : GCNPat<
+ (fcanonicalize (f64 (VOP3Mods f64:$src, i32:$src_mods))),
+ (V_MAX_NUM_F64_e64 $src_mods, $src, $src_mods, $src)> {
+ let OtherPredicates = !listconcat(f64_preds, [isGFX12Plus]);
}
def : GCNPat<
diff --git a/llvm/test/CodeGen/AMDGPU/clamp.ll b/llvm/test/CodeGen/AMDGPU/clamp.ll
index b95231fd8880f5..92660b9a646ff3 100644
--- a/llvm/test/CodeGen/AMDGPU/clamp.ll
+++ b/llvm/test/CodeGen/AMDGPU/clamp.ll
@@ -857,7 +857,7 @@ define amdgpu_kernel void @v_clamp_f64(ptr addrspace(1) %out, ptr addrspace(1) %
; GFX12-NEXT: s_waitcnt lgkmcnt(0)
; GFX12-NEXT: global_load_b64 v[0:1], v2, s[2:3]
; GFX12-NEXT: s_waitcnt vmcnt(0)
-; GFX12-NEXT: v_max_f64 v[0:1], v[0:1], v[0:1] clamp
+; GFX12-NEXT: v_max_num_f64_e64 v[0:1], v[0:1], v[0:1] clamp
; GFX12-NEXT: global_store_b64 v2, v[0:1], s[0:1]
; GFX12-NEXT: s_nop 0
; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
@@ -938,7 +938,7 @@ define amdgpu_kernel void @v_clamp_neg_f64(ptr addrspace(1) %out, ptr addrspace(
; GFX12-NEXT: s_waitcnt lgkmcnt(0)
; GFX12-NEXT: global_load_b64 v[0:1], v2, s[2:3]
; GFX12-NEXT: s_waitcnt vmcnt(0)
-; GFX12-NEXT: v_max_f64 v[0:1], -v[0:1], -v[0:1] clamp
+; GFX12-NEXT: v_max_num_f64_e64 v[0:1], -v[0:1], -v[0:1] clamp
; GFX12-NEXT: global_store_b64 v2, v[0:1], s[0:1]
; GFX12-NEXT: s_nop 0
; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
@@ -1020,7 +1020,7 @@ define amdgpu_kernel void @v_clamp_negabs_f64(ptr addrspace(1) %out, ptr addrspa
; GFX12-NEXT: s_waitcnt lgkmcnt(0)
; GFX12-NEXT: global_load_b64 v[0:1], v2, s[2:3]
; GFX12-NEXT: s_waitcnt vmcnt(0)
-; GFX12-NEXT: v_max_f64 v[0:1], -|v[0:1]|, -|v[0:1]| clamp
+; GFX12-NEXT: v_max_num_f64_e64 v[0:1], -|v[0:1]|, -|v[0:1]| clamp
; GFX12-NEXT: global_store_b64 v2, v[0:1], s[0:1]
; GFX12-NEXT: s_nop 0
; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
diff --git a/llvm/test/CodeGen/AMDGPU/fcanonicalize.ll b/llvm/test/CodeGen/AMDGPU/fcanonicalize.ll
index 37f4552af18fcf..fc4bc7595da5b7 100644
--- a/llvm/test/CodeGen/AMDGPU/fcanonicalize.ll
+++ b/llvm/test/CodeGen/AMDGPU/fcanonicalize.ll
@@ -1050,18 +1050,31 @@ define amdgpu_kernel void @v_test_canonicalize_var_f64(ptr addrspace(1) %out) #1
; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11PLUS-LABEL: v_test_canonicalize_var_f64:
-; GFX11PLUS: ; %bb.0:
-; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11PLUS-NEXT: v_mov_b32_e32 v2, 0
-; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11PLUS-NEXT: global_load_b64 v[0:1], v2, s[0:1]
-; GFX11PLUS-NEXT: s_waitcnt vmcnt(0)
-; GFX11PLUS-NEXT: v_max_f64 v[0:1], v[0:1], v[0:1]
-; GFX11PLUS-NEXT: global_store_b64 v2, v[0:1], s[0:1]
-; GFX11PLUS-NEXT: s_nop 0
-; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11PLUS-NEXT: s_endpgm
+; GFX11-LABEL: v_test_canonicalize_var_f64:
+; GFX11: ; %bb.0:
+; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11-NEXT: v_mov_b32_e32 v2, 0
+; GFX11-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11-NEXT: global_load_b64 v[0:1], v2, s[0:1]
+; GFX11-NEXT: s_waitcnt vmcnt(0)
+; GFX11-NEXT: v_max_f64 v[0:1], v[0:1], v[0:1]
+; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
+; GFX11-NEXT: s_nop 0
+; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11-NEXT: s_endpgm
+;
+; GFX12-LABEL: v_test_canonicalize_var_f64:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX12-NEXT: v_mov_b32_e32 v2, 0
+; GFX12-NEXT: s_waitcnt lgkmcnt(0)
+; GFX12-NEXT: global_load_b64 v[0:1], v2, s[0:1]
+; GFX12-NEXT: s_waitcnt vmcnt(0)
+; GFX12-NEXT: v_max_num_f64_e32 v[0:1], v[0:1], v[0:1]
+; GFX12-NEXT: global_store_b64 v2, v[0:1], s[0:1]
+; GFX12-NEXT: s_nop 0
+; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX12-NEXT: s_endpgm
%val = load double, ptr addrspace(1) %out
%canonicalized = call double @llvm.canonicalize.f64(double %val)
store double %canonicalized, ptr addrspace(1) %out
@@ -1098,16 +1111,27 @@ define amdgpu_kernel void @s_test_canonicalize_var_f64(ptr addrspace(1) %out, do
; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11PLUS-LABEL: s_test_canonicalize_var_f64:
-; GFX11PLUS: ; %bb.0:
-; GFX11PLUS-NEXT: s_load_b128 s[0:3], s[0:1], 0x0
-; GFX11PLUS-NEXT: v_mov_b32_e32 v2, 0
-; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11PLUS-NEXT: v_max_f64 v[0:1], s[2:3], s[2:3]
-; GFX11PLUS-NEXT: global_store_b64 v2, v[0:1], s[0:1]
-; GFX11PLUS-NEXT: s_nop 0
-; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11PLUS-NEXT: s_endpgm
+; GFX11-LABEL: s_test_canonicalize_var_f64:
+; GFX11: ; %bb.0:
+; GFX11-NEXT: s_load_b128 s[0:3], s[0:1], 0x0
+; GFX11-NEXT: v_mov_b32_e32 v2, 0
+; GFX11-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11-NEXT: v_max_f64 v[0:1], s[2:3], s[2:3]
+; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
+; GFX11-NEXT: s_nop 0
+; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11-NEXT: s_endpgm
+;
+; GFX12-LABEL: s_test_canonicalize_var_f64:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: s_load_b128 s[0:3], s[0:1], 0x0
+; GFX12-NEXT: v_mov_b32_e32 v2, 0
+; GFX12-NEXT: s_waitcnt lgkmcnt(0)
+; GFX12-NEXT: v_max_num_f64_e64 v[0:1], s[2:3], s[2:3]
+; GFX12-NEXT: global_store_b64 v2, v[0:1], s[0:1]
+; GFX12-NEXT: s_nop 0
+; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX12-NEXT: s_endpgm
%canonicalized = call double @llvm.canonicalize.f64(double %val)
store double %canonicalized, ptr addrspace(1) %out
ret void
@@ -1137,18 +1161,31 @@ define amdgpu_kernel void @v_test_canonicalize_fabs_var_f64(ptr addrspace(1) %ou
; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11PLUS-LABEL: v_test_canonicalize_fabs_var_f64:
-; GFX11PLUS: ; %bb.0:
-; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11PLUS-NEXT: v_mov_b32_e32 v2, 0
-; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11PLUS-NEXT: global_load_b64 v[0:1], v2, s[0:1]
-; GFX11PLUS-NEXT: s_waitcnt vmcnt(0)
-; GFX11PLUS-NEXT: v_max_f64 v[0:1], |v[0:1]|, |v[0:1]|
-; GFX11PLUS-NEXT: global_store_b64 v2, v[0:1], s[0:1]
-; GFX11PLUS-NEXT: s_nop 0
-; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11PLUS-NEXT: s_endpgm
+; GFX11-LABEL: v_test_canonicalize_fabs_var_f64:
+; GFX11: ; %bb.0:
+; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11-NEXT: v_mov_b32_e32 v2, 0
+; GFX11-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11-NEXT: global_load_b64 v[0:1], v2, s[0:1]
+; GFX11-NEXT: s_waitcnt vmcnt(0)
+; GFX11-NEXT: v_max_f64 v[0:1], |v[0:1]|, |v[0:1]|
+; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
+; GFX11-NEXT: s_nop 0
+; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11-NEXT: s_endpgm
+;
+; GFX12-LABEL: v_test_canonicalize_fabs_var_f64:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX12-NEXT: v_mov_b32_e32 v2, 0
+; GFX12-NEXT: s_waitcnt lgkmcnt(0)
+; GFX12-NEXT: global_load_b64 v[0:1], v2, s[0:1]
+; GFX12-NEXT: s_waitcnt vmcnt(0)
+; GFX12-NEXT: v_max_num_f64_e64 v[0:1], |v[0:1]|, |v[0:1]|
+; GFX12-NEXT: global_store_b64 v2, v[0:1], s[0:1]
+; GFX12-NEXT: s_nop 0
+; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX12-NEXT: s_endpgm
%val = load double, ptr addrspace(1) %out
%val.fabs = call double @llvm.fabs.f64(double %val)
%canonicalized = call double @llvm.canonicalize.f64(double %val.fabs)
@@ -1180,18 +1217,31 @@ define amdgpu_kernel void @v_test_canonicalize_fneg_fabs_var_f64(ptr addrspace(1
; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11PLUS-LABEL: v_test_canonicalize_fneg_fabs_var_f64:
-; GFX11PLUS: ; %bb.0:
-; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11PLUS-NEXT: v_mov_b32_e32 v2, 0
-; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11PLUS-NEXT: global_load_b64 v[0:1], v2, s[0:1]
-; GFX11PLUS-NEXT: s_waitcnt vmcnt(0)
-; GFX11PLUS-NEXT: v_max_f64 v[0:1], -|v[0:1]|, -|v[0:1]|
-; GFX11PLUS-NEXT: global_store_b64 v2, v[0:1], s[0:1]
-; GFX11PLUS-NEXT: s_nop 0
-; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11PLUS-NEXT: s_endpgm
+; GFX11-LABEL: v_test_canonicalize_fneg_fabs_var_f64:
+; GFX11: ; %bb.0:
+; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11-NEXT: v_mov_b32_e32 v2, 0
+; GFX11-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11-NEXT: global_load_b64 v[0:1], v2, s[0:1]
+; GFX11-NEXT: s_waitcnt vmcnt(0)
+; GFX11-NEXT: v_max_f64 v[0:1], -|v[0:1]|, -|v[0:1]|
+; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
+; GFX11-NEXT: s_nop 0
+; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11-NEXT: s_endpgm
+;
+; GFX12-LABEL: v_test_canonicalize_fneg_fabs_var_f64:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX12-NEXT: v_mov_b32_e32 v2, 0
+; GFX12-NEXT: s_waitcnt lgkmcnt(0)
+; GFX12-NEXT: global_load_b64 v[0:1], v2, s[0:1]
+; GFX12-NEXT: s_waitcnt vmcnt(0)
+; GFX12-NEXT: v_max_num_f64_e64 v[0:1], -|v[0:1]|, -|v[0:1]|
+; GFX12-NEXT: global_store_b64 v2, v[0:1], s[0:1]
+; GFX12-NEXT: s_nop 0
+; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX12-NEXT: s_endpgm
%val = load double, ptr addrspace(1) %out
%val.fabs = call double @llvm.fabs.f64(double %val)
%val.fabs.fneg = fneg double %val.fabs
@@ -1224,18 +1274,31 @@ define amdgpu_kernel void @v_test_canonicalize_fneg_var_f64(ptr addrspace(1) %ou
; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11PLUS-LABEL: v_test_canonicalize_fneg_var_f64:
-; GFX11PLUS: ; %bb.0:
-; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11PLUS-NEXT: v_mov_b32_e32 v2, 0
-; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11PLUS-NEXT: global_load_b64 v[0:1], v2, s[0:1]
-; GFX11PLUS-NEXT: s_waitcnt vmcnt(0)
-; GFX11PLUS-NEXT: v_max_f64 v[0:1], -v[0:1], -v[0:1]
-; GFX11PLUS-NEXT: global_store_b64 v2, v[0:1], s[0:1]
-; GFX11PLUS-NEXT: s_nop 0
-; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11PLUS-NEXT: s_endpgm
+; GFX11-LABEL: v_test_canonicalize_fneg_var_f64:
+; GFX11: ; %bb.0:
+; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11-NEXT: v_mov_b32_e32 v2, 0
+; GFX11-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11-NEXT: global_load_b64 v[0:1], v2, s[0:1]
+; GFX11-NEXT: s_waitcnt vmcnt(0)
+; GFX11-NEXT: v_max_f64 v[0:1], -v[0:1], -v[0:1]
+; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
+; GFX11-NEXT: s_nop 0
+; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11-NEXT: s_endpgm
+;
+; GFX12-LABEL: v_test_canonicalize_fneg_var_f64:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX12-NEXT: v_mov_b32_e32 v2, 0
+; GFX12-NEXT: s_waitcnt lgkmcnt(0)
+; GFX12-NEXT: global_load_b64 v[0:1], v2, s[0:1]
+; GFX12-NEXT: s_waitcnt vmcnt(0)
+; GFX12-NEXT: v_max_num_f64_e64 v[0:1], -v[0:1], -v[0:1]
+; GFX12-NEXT: global_store_b64 v2, v[0:1], s[0:1]
+; GFX12-NEXT: s_nop 0
+; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX12-NEXT: s_endpgm
%val = load double, ptr addrspace(1) %out
%val.fneg = fneg double %val
%canonicalized = call double @llvm.canonicalize.f64(double %val.fneg)
@@ -1859,18 +1922,31 @@ define amdgpu_kernel void @test_canonicalize_value_f64_flush(ptr addrspace(1) %a
; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[2:3]
; GFX9-NEXT: s_endpgm
;
-; GFX11PLUS-LABEL: test_canonicalize_value_f64_flush:
-; GFX11PLUS: ; %bb.0:
-; GFX11PLUS-NEXT: s_load_b128 s[0:3], s[0:1], 0x0
-; GFX11PLUS-NEXT: v_lshlrev_b32_e32 v2, 3, v0
-; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11PLUS-NEXT: global_load_b64 v[0:1], v2, s[0:1]
-; GFX11PLUS-NEXT: s_waitcnt vmcnt(0)
-; GFX11PLUS-NEXT: v_max_f64 v[0:1], v[0:1], v[0:1]
-; GFX11PLUS-NEXT: global_store_b64 v2, v[0:1], s[2:3]
-; GFX11PLUS-NEXT: s_nop 0
-; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11PLUS-NEXT: s_endpgm
+; GFX11-LABEL: test_canonicalize_value_f64_flush:
+; GFX11: ; %bb.0:
+; GFX11-NEXT: s_load_b128 s[0:3], s[0:1], 0x0
+; GFX11-NEXT: v_lshlrev_b32_e32 v2, 3, v0
+; GFX11-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11-NEXT: global_load_b64 v[0:1], v2, s[0:1]
+; GFX11-NEXT: s_waitcnt vmcnt(0)
+; GFX11-NEXT: v_max_f64 v[0:1], v[0:1], v[0:1]
+; GFX11-NEXT: global_store_b64 v2, v[0:1], s[2:3]
+; GFX11-NEXT: s_nop 0
+; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11-NEXT: s_endpgm
+;
+; GFX12-LABEL: test_canonicalize_value_f64_flush:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: s_load_b128 s[0:3], s[0:1], 0x0
+; GFX12-NEXT: v_lshlrev_b32_e32 v2, 3, v0
+; GFX12-NEXT: s_waitcnt lgkmcnt(0)
+; GFX12-NEXT: global_load_b64 v[0:1], v2, s[0:1]
+; GFX12-NEXT: s_waitcnt vmcnt(0)
+; GFX12-NEXT: v_max_num_f64_e32 v[0:1], v[0:1], v[0:1]
+; GFX12-NEXT: global_store_b64 v2, v[0:1], s[2:3]
+; GFX12-NEXT: s_nop 0
+; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX12-NEXT: s_endpgm
%id = tail call i32 @llvm.amdgcn.workitem.id.x()
%gep = getelementptr inbounds double, ptr addrspace(1) %arg, i32 %id
%v = load double, ptr addrspace(1) %gep, align 8
@@ -2180,18 +2256,31 @@ define amdgpu_kernel void @test_canonicalize_value_f64_denorm(ptr addrspace(1) %
; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[2:3]
; GFX9-NEXT: s_endpgm
;
-; GFX11PLUS-LABEL: test_canonicalize_value_f64_denorm:
-; GFX11PLUS: ; %bb.0:
-; GFX11PLUS-NEXT: s_load_b128 s[0:3], s[0:1], 0x0
-; GFX11PLUS-NEXT: v_lshlrev_b32_e32 v2, 3, v0
-; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11PLUS-NEXT: global_load_b64 v[0:1], v2, s[0:1]
-; GFX11PLUS-NEXT: s_waitcnt vmcnt(0)
-; GFX11PLUS-NEXT: v_max_f64 v[0:1], v[0:1], v[0:1]
-; GFX11PLUS-NEXT: global_store_b64 v2, v[0:1], s[2:3]
-; GFX11PLUS-NEXT: s_nop 0
-; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11PLUS-NEXT: s_endpgm
+; GFX11-LABEL: test_canonicalize_value_f64_denorm:
+; GFX11: ; %bb.0:
+; GFX11-NEXT: s_load_b128 s[0:3], s[0:1], 0x0
+; GFX11-NEXT: v_lshlrev_b32_e32 v2, 3, v0
+; GFX11-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11-NEXT: global_load_b64 v[0:1], v2, s[0:1]
+; GFX11-NEXT: s_waitcnt vmcnt(0)
+; GFX11-NEXT: v_max_f64 v[0:1], v[0:1], v[0:1]
+; GFX11-NEXT: global_store_b64 v2, v[0:1], s[2:3]
+; GFX11-NEXT: s_nop 0
+; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11-NEXT: s_endpgm
+;
+; GFX12-LABEL: test_canonicalize_value_f64_denorm:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: s_load_b128 s[0:3], s[0:1], 0x0
+; GFX12-NEXT: v_lshlrev_b32_e32 v2, 3, v0
+; GFX12-NEXT: s_waitcnt lgkmcnt(0)
+; GFX12-NEXT: global_load_b64 v[0:1], v2, s[0:1]
+; GFX12-NEXT: s_waitcnt vmcnt(0)
+; GFX12-NEXT: v_max_num_f64_e32 v[0:1], v[0:1], v[0:1]
+; GFX12-NEXT: global_store_b64 v2, v[0:1], s[2:3]
+; GFX12-NEXT: s_nop 0
+; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX12-NEXT: s_endpgm
%id = tail call i32 @llvm.amdgcn.workitem.id.x()
%gep = getelementptr inbounds double, ptr addrspace(1) %arg, i32 %id
%v = load double, ptr addrspace(1) %gep, align 8
@@ -2504,20 +2593,35 @@ define amdgpu_kernel void @v_test_canonicalize_var_v2f64(ptr addrspace(1) %out)
; GFX9-NEXT: global_store_dwordx4 v4, v[0:3], s[0:1]
; GFX9-NEXT: s_endpgm
;
-; GFX11PLUS-LABEL: v_test_canonicalize_var_v2f64:
-; GFX11PLUS: ; %bb.0:
-; GFX11PLUS-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
-; GFX11PLUS-NEXT: v_lshlrev_b32_e32 v0, 4, v0
-; GFX11PLUS-NEXT: v_mov_b32_e32 v4, 0
-; GFX11PLUS-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11PLUS-NEXT: global_load_b128 v[0:3], v0, s[0:1]
-; GFX11PLUS-NEXT: s_waitcnt vmcnt(0)
-; GFX11PLUS-NEXT: v_max_f64 v[2:3], v[2:3], v[2:3]
-; GFX11PLUS-NEXT: v_max_f64 v[0:1], v[0:1], v[0:1]
-; GFX11PLUS-NEXT: global_store_b128 v4, v[0:3], s[0:1]
-; GFX11PLUS-NEXT: s_nop 0
-; GFX11PLUS-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
-; GFX11PLUS-NEXT: s_endpgm
+; GFX11-LABEL: v_test_canonicalize_var_v2f64:
+; GFX11: ; %bb.0:
+; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX11-NEXT: v_lshlrev_b32_e32 v0, 4, v0
+; GFX11-NEXT: v_mov_b32_e32 v4, 0
+; GFX11-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11-NEXT: global_load_b128 v[0:3], v0, s[0:1]
+; GFX11-NEXT: s_waitcnt vmcnt(0)
+; GFX11-NEXT: v_max_f64 v[2:3], v[2:3], v[2:3]
+; GFX11-NEXT: v_max_f64 v[0:1], v[0:1], v[0:1]
+; GFX11-NEXT: global_store_b128 v4, v[0:3], s[0:1]
+; GFX11-NEXT: s_nop 0
+; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11-NEXT: s_endpgm
+;
+; GFX12-LABEL: v_test_canonicalize_var_v2f64:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
+; GFX12-NEXT: v_lshlrev_b32_e32 v0, 4, v0
+; GFX12-NEXT: v_mov_b32_e32 v4, 0
+; GFX12-NEXT: s_waitcnt lgkmcnt(0)
+; GFX12-NEXT: global_load_b128 v[0:3], v0, s[0:1]
+; GFX12-NEXT: s_waitcnt vmcnt(0)
+; GFX12-NEXT: v_max_num_f64_e32 v[2:3], v[2:3], v[2:3]
+; GFX12-NEXT: v_max_num_f64_e32 v[0:1], v[0:1], v[0:1]
+; GFX12-NEXT: global_store_b128 v4, v[0:3], s[0:1]
+; GFX12-NEXT: s_nop 0
+; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX12-NEXT: s_endpgm
%tid = call i32 @llvm.amdgcn.workitem.id.x()
%gep = getelementptr <2 x double>, ptr addrspace(1) %out, i32 %tid
%val = load <2 x double>, ptr addrspace(1) %gep
@@ -2693,12 +2797,19 @@ define <2 x double> @v_test_canonicalize_v2f64(<2 x double> %arg) #1 {
; GFX9-NEXT: v_max_f64 v[2:3], v[2:3], v[2:3]
; GFX9-NEXT: s_setpc_b64 s[30:31]
;
-; GFX11PLUS-LABEL: v_test_canonicalize_v2f64:
-; GFX11PLUS: ; %bb.0:
-; GFX11PLUS-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
-; GFX11PLUS-NEXT: v_max_f64 v[0:1], v[0:1], v[0:1]
-; GFX11PLUS-NEXT: v_max_f64 v[2:3], v[2:3], v[2:3]
-; GFX11PLUS-NEXT: s_setpc_b64 s[30:31]
+; GFX11-LABEL: v_test_canonicalize_v2f64:
+; GFX11: ; %bb.0:
+; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
+; GFX11-NEXT: v_max_f64 v[0:1], v[0:1], v[0:1]
+; GFX11-NEXT: v_max_f64 v[2:3], v[2:3], v[2:3]
+; GFX11-NEXT: s_setpc_b64 s[30:31]
+;
+; GFX12-LABEL: v_test_canonicalize_v2f64:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
+; GFX12-NEXT: v_max_num_f64_e32 v[0:1], v[0:1], v[0:1]
+; GFX12-NEXT: v_max_num_f64_e32 v[2:3], v[2:3], v[2:3]
+; GFX12-NEXT: s_setpc_b64 s[30:31]
%canon = call <2 x double> @llvm.canonicalize.v2f64(<2 x double> %arg)
ret <2 x double> %canon
}
@@ -2720,13 +2831,21 @@ define <3 x double> @v_test_canonicalize_v3f64(<3 x double> %arg) #1 {
; GFX9-NEXT: v_max_f64 v[4:5], v[4:5], v[4:5]
; GFX9-NEXT: s_setpc_b64 s[30:31]
;
-; GFX11PLUS-LABEL: v_test_canonicalize_v3f64:
-; GFX11PLUS: ; %bb.0:
-; GFX11PLUS-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
-; GFX11PLUS-NEXT: v_max_f64 v[0:1], v[0:1], v[0:1]
-; GFX11PLUS-NEXT: v_max_f64 v[2:3], v[2:3], v[2:3]
-; GFX11PLUS-NEXT: v_max_f64 v[4:5], v[4:5], v[4:5]
-; GFX11PLUS-NEXT: s_setpc_b64 s[30:31]
+; GFX11-LABEL: v_test_canonicalize_v3f64:
+; GFX11: ; %bb.0:
+; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
+; GFX11-NEXT: v_max_f64 v[0:1], v[0:1], v[0:1]
+; GFX11-NEXT: v_max_f64 v[2:3], v[2:3], v[2:3]
+; GFX11-NEXT: v_max_f64 v[4:5], v[4:5], v[4:5]
+; GFX11-NEXT: s_setpc_b64 s[30:31]
+;
+; GFX12-LABEL: v_test_canonicalize_v3f64:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
+; GFX12-NEXT: v_max_num_f64_e32 v[0:1], v[0:1], v[0:1]
+; GFX12-NEXT: v_max_num_f64_e32 v[2:3], v[2:3], v[2:3]
+; GFX12-NEXT: v_max_num_f64_e32 v[4:5], v[4:5], v[4:5]
+; GFX12-NEXT: s_setpc_b64 s[30:31]
%canon = call <3 x double> @llvm.canonicalize.v3f64(<3 x double> %arg)
ret <3 x double> %canon
}
@@ -2750,14 +2869,23 @@ define <4 x double> @v_test_canonicalize_v4f64(<4 x double> %arg) #1 {
; GFX9-NEXT: v_max_f64 v[6:7], v[6:7], v[6:7]
; GFX9-NEXT: s_setpc_b64 s[30:31]
;
-; GFX11PLUS-LABEL: v_test_canonicalize_v4f64:
-; GFX11PLUS: ; %bb.0:
-; GFX11PLUS-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
-; GFX11PLUS-NEXT: v_max_f64 v[0:1], v[0:1], v[0:1]
-; GFX11PLUS-NEXT: v_max_f64 v[2:3], v[2:3], v[2:3]
-; GFX11PLUS-NEXT: v_max_f64 v[4:5], v[4:5], v[4:5]
-; GFX11PLUS-NEXT: v_max_f64 v[6:7], v[6:7], v[6:7]
-; GFX11PLUS-NEXT: s_setpc_b64 s[30:31]
+; GFX11-LABEL: v_test_canonicalize_v4f64:
+; GFX11: ; %bb.0:
+; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
+; GFX11-NEXT: v_max_f64 v[0:1], v[0:1], v[0:1]
+; GFX11-NEXT: v_max_f64 v[2:3], v[2:3], v[2:3]
+; GFX11-NEXT: v_max_f64 v[4:5], v[4:5], v[4:5]
+; GFX11-NEXT: v_max_f64 v[6:7], v[6:7], v[6:7]
+; GFX11-NEXT: s_setpc_b64 s[30:31]
+;
+; GFX12-LABEL: v_test_canonicalize_v4f64:
+; GFX12: ; %bb.0:
+; GFX12-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
+; GFX12-NEXT: v_max_num_f64_e32 v[0:1], v[0:1], v[0:1]
+; GFX12-NEXT: v_max_num_f64_e32 v[2:3], v[2:3], v[2:3]
+; GFX12-NEXT: v_max_num_f64_e32 v[4:5], v[4:5], v[4:5]
+; GFX12-NEXT: v_max_num_f64_e32 v[6:7], v[6:7], v[6:7]
+; GFX12-NEXT: s_setpc_b64 s[30:31]
%canon = call <4 x double> @llvm.canonicalize.v4f64(<4 x double> %arg)
ret <4 x double> %canon
}
diff --git a/llvm/test/CodeGen/AMDGPU/omod.ll b/llvm/test/CodeGen/AMDGPU/omod.ll
index e00b4f5f78409b..b55e65e2a9c180 100644
--- a/llvm/test/CodeGen/AMDGPU/omod.ll
+++ b/llvm/test/CodeGen/AMDGPU/omod.ll
@@ -407,9 +407,7 @@ define amdgpu_ps void @v_omod_div2_f64(double %a) #5 {
;
; GFX12-LABEL: v_omod_div2_f64:
; GFX12: ; %bb.0:
-; GFX12-NEXT: v_add_f64_e32 v[0:1], 1.0, v[0:1]
-; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1)
-; GFX12-NEXT: v_mul_f64_e32 v[0:1], 0.5, v[0:1]
+; GFX12-NEXT: v_add_f64_e64 v[0:1], v[0:1], 1.0 div:2
; GFX12-NEXT: global_store_b64 v[0:1], v[0:1], off
; GFX12-NEXT: s_nop 0
; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
@@ -509,9 +507,7 @@ define amdgpu_ps void @v_omod_mul2_f64(double %a) #5 {
;
; GFX12-LABEL: v_omod_mul2_f64:
; GFX12: ; %bb.0:
-; GFX12-NEXT: v_add_f64_e32 v[0:1], 1.0, v[0:1]
-; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1)
-; GFX12-NEXT: v_add_f64_e32 v[0:1], v[0:1], v[0:1]
+; GFX12-NEXT: v_add_f64_e64 v[0:1], v[0:1], 1.0 mul:2
; GFX12-NEXT: global_store_b64 v[0:1], v[0:1], off
; GFX12-NEXT: s_nop 0
; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
@@ -575,9 +571,7 @@ define amdgpu_ps void @v_omod_mul4_f64(double %a) #5 {
;
; GFX12-LABEL: v_omod_mul4_f64:
; GFX12: ; %bb.0:
-; GFX12-NEXT: v_add_f64_e32 v[0:1], 1.0, v[0:1]
-; GFX12-NEXT: s_delay_alu instid0(VALU_DEP_1)
-; GFX12-NEXT: v_mul_f64_e32 v[0:1], 4.0, v[0:1]
+; GFX12-NEXT: v_add_f64_e64 v[0:1], v[0:1], 1.0 mul:4
; GFX12-NEXT: global_store_b64 v[0:1], v[0:1], off
; GFX12-NEXT: s_nop 0
; GFX12-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
More information about the cfe-commits
mailing list