[llvm] stop emitting direct copy from intermediate result to out reg (PR #135326)
Pankaj Dwivedi via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 18 01:46:05 PDT 2025
================
@@ -1,21 +1,91 @@
-; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 5
-; RUN: llc < %s -mtriple=amdgcn -mcpu=gfx1100 -verify-machineinstrs -stop-after=finalize-isel | FileCheck %s -check-prefixes=GFX11
-
-define amdgpu_ps i32 @s_copysign_f32_bf16(float inreg %mag, bfloat inreg %sign.bf16) {
- ; GFX11-LABEL: name: s_copysign_f32_bf16
- ; GFX11: bb.0 (%ir-block.0):
- ; GFX11-NEXT: liveins: $sgpr0, $sgpr1
- ; GFX11-NEXT: {{ $}}
- ; GFX11-NEXT: [[COPY:%[0-9]+]]:sgpr_32 = COPY $sgpr1
- ; GFX11-NEXT: [[COPY1:%[0-9]+]]:sgpr_32 = COPY $sgpr0
- ; GFX11-NEXT: [[V_LSHLREV_B32_e64_:%[0-9]+]]:vgpr_32 = V_LSHLREV_B32_e64 16, [[COPY]], implicit $exec
- ; GFX11-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 2147483647
- ; GFX11-NEXT: [[V_BFI_B32_e64_:%[0-9]+]]:vgpr_32 = V_BFI_B32_e64 killed [[S_MOV_B32_]], [[COPY1]], killed [[V_LSHLREV_B32_e64_]], implicit $exec
- ; GFX11-NEXT: [[V_READFIRSTLANE_B32_:%[0-9]+]]:sreg_32_xm0 = V_READFIRSTLANE_B32 killed [[V_BFI_B32_e64_]], implicit $exec
- ; GFX11-NEXT: $sgpr0 = COPY [[V_READFIRSTLANE_B32_]]
- ; GFX11-NEXT: SI_RETURN_TO_EPILOG $sgpr0
- %sign = fpext bfloat %sign.bf16 to float
- %op = call float @llvm.copysign.f32(float %mag, float %sign)
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
+; RUN: llc < %s -mtriple=amdgcn -mcpu=gfx1100 | FileCheck %s -check-prefixes=GFX11
+
+define amdgpu_ps i32 @s_copysign_uniform(float inreg %x, float inreg %y) {
----------------
PankajDwivedi-25 wrote:
in case of fpxet, it returns in vgpr.
https://github.com/llvm/llvm-project/pull/135326
More information about the llvm-commits
mailing list