[llvm] [SDAG] Remove non-canonical fabs libcall handling (PR #177967)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 26 06:44:08 PST 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-backend-mips

@llvm/pr-subscribers-backend-amdgpu

Author: Nikita Popov (nikic)

<details>
<summary>Changes</summary>

This is a followup to https://github.com/llvm/llvm-project/pull/171288, which removed lowering of libcalls to SDAG nodes for most libcalls that get unconditionally canonicalized to intrinsics. This handles the remaining fabs case, which I originally skipped due to larger test impact.

---

Patch is 31.42 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/177967.diff


28 Files Affected:

- (modified) llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp (-7) 
- (modified) llvm/test/CodeGen/AArch64/floatdp_1source.ll (+4-4) 
- (modified) llvm/test/CodeGen/AMDGPU/complex-folding.ll (+2-2) 
- (modified) llvm/test/CodeGen/AMDGPU/fabs-r600.ll (-35) 
- (modified) llvm/test/CodeGen/AMDGPU/fabs.f64.ll (-41) 
- (modified) llvm/test/CodeGen/AMDGPU/fabs.ll (-61) 
- (modified) llvm/test/CodeGen/AMDGPU/fneg-fabs-r600.ll (-21) 
- (modified) llvm/test/CodeGen/AMDGPU/fneg-fabs.f64.ll (-34) 
- (modified) llvm/test/CodeGen/AMDGPU/fneg-fabs.ll (-32) 
- (modified) llvm/test/CodeGen/AMDGPU/r600-infinite-loop-bug-while-reorganizing-vector.ll (+2-2) 
- (modified) llvm/test/CodeGen/AMDGPU/schedule-if-2.ll (+2-2) 
- (modified) llvm/test/CodeGen/ARM/fabs-to-bfc.ll (+2-2) 
- (modified) llvm/test/CodeGen/ARM/fabss.ll (+2-2) 
- (modified) llvm/test/CodeGen/ARM/fparith.ll (+4-4) 
- (modified) llvm/test/CodeGen/ARM/vfp.ll (+4-4) 
- (modified) llvm/test/CodeGen/Hexagon/bit-extract-off.ll (+2-2) 
- (modified) llvm/test/CodeGen/Hexagon/opt-fabs.ll (+3-3) 
- (modified) llvm/test/CodeGen/Mips/f16abs.ll (+4-4) 
- (modified) llvm/test/CodeGen/Mips/fabs.ll (+4-4) 
- (modified) llvm/test/CodeGen/Mips/mips64-f128.ll (+2-2) 
- (modified) llvm/test/CodeGen/PowerPC/2008-07-15-Fabs.ll (+2-2) 
- (modified) llvm/test/CodeGen/PowerPC/fabs.ll (+1-1) 
- (modified) llvm/test/CodeGen/PowerPC/fnabs.ll (+2-2) 
- (modified) llvm/test/CodeGen/X86/fabs.ll (+4-4) 
- (modified) llvm/test/CodeGen/X86/fnabs.ll (+3-3) 
- (modified) llvm/test/CodeGen/X86/fp128-i128.ll (+3-3) 
- (modified) llvm/test/CodeGen/X86/pr2656.ll (+2-2) 
- (modified) llvm/test/CodeGen/X86/stack-align.ll (+3-3) 


``````````diff
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index ff3ed6e6dcb14..63c9d193421ea 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -9608,13 +9608,6 @@ void SelectionDAGBuilder::visitCall(const CallInst &I) {
           return;
         }
         break;
-      case LibFunc_fabs:
-      case LibFunc_fabsf:
-      case LibFunc_fabsl:
-        // TODO: Remove this, already canonicalized by the middle-end.
-        if (visitUnaryFloatCall(I, ISD::FABS))
-          return;
-        break;
       case LibFunc_sin:
       case LibFunc_sinf:
       case LibFunc_sinl:
diff --git a/llvm/test/CodeGen/AArch64/floatdp_1source.ll b/llvm/test/CodeGen/AArch64/floatdp_1source.ll
index 32d73d9e830f8..c3e8362ea2690 100644
--- a/llvm/test/CodeGen/AArch64/floatdp_1source.ll
+++ b/llvm/test/CodeGen/AArch64/floatdp_1source.ll
@@ -1,8 +1,8 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
 ; RUN: llc -verify-machineinstrs -o - %s -mtriple=arm64-apple-ios7.0 | FileCheck %s
 
-declare float @fabsf(float) readonly
-declare double @fabs(double) readonly
+declare float @llvm.fabs.f32(float) readonly
+declare double @llvm.fabs.f64(double) readonly
 
 declare float @llvm.sqrt.f32(float %Val)
 declare double @llvm.sqrt.f64(double %Val)
@@ -12,7 +12,7 @@ define float @fabs_f(float %v) {
 ; CHECK:       ; %bb.0:
 ; CHECK-NEXT:    fabs s0, s0
 ; CHECK-NEXT:    ret
-  %r = call float @fabsf(float %v)
+  %r = call float @llvm.fabs.f32(float %v)
   ret float %r
 }
 
@@ -84,7 +84,7 @@ define double @fabs_d(double %v) {
 ; CHECK:       ; %bb.0:
 ; CHECK-NEXT:    fabs d0, d0
 ; CHECK-NEXT:    ret
-  %r = call double @fabs(double %v)
+  %r = call double @llvm.fabs.f64(double %v)
   ret double %r
 }
 
diff --git a/llvm/test/CodeGen/AMDGPU/complex-folding.ll b/llvm/test/CodeGen/AMDGPU/complex-folding.ll
index 3d124e8cb7f4a..2de9ce3e8fcbf 100644
--- a/llvm/test/CodeGen/AMDGPU/complex-folding.ll
+++ b/llvm/test/CodeGen/AMDGPU/complex-folding.ll
@@ -5,7 +5,7 @@
 define amdgpu_ps void @main(<4 x float> inreg %reg0) {
 entry:
   %0 = extractelement <4 x float> %reg0, i32 0
-  %1 = call float @fabsf(float %0)
+  %1 = call float @llvm.fabs.f32(float %0)
   %2 = fptoui float %1 to i32
   %3 = bitcast i32 %2 to float
   %4 = insertelement <4 x float> poison, float %3, i32 0
@@ -13,5 +13,5 @@ entry:
   ret void
 }
 
-declare float @fabsf(float ) readnone
+declare float @llvm.fabs.f32(float ) readnone
 declare void @llvm.r600.store.swizzle(<4 x float>, i32, i32)
diff --git a/llvm/test/CodeGen/AMDGPU/fabs-r600.ll b/llvm/test/CodeGen/AMDGPU/fabs-r600.ll
index 7e1aa99c3ec40..5e22d5f792c18 100644
--- a/llvm/test/CodeGen/AMDGPU/fabs-r600.ll
+++ b/llvm/test/CodeGen/AMDGPU/fabs-r600.ll
@@ -5,24 +5,6 @@
 ; DAGCombiner will transform:
 ; (fabsf (f32 bitcast (i32 a))) => (f32 bitcast (and (i32 a), 0x7FFFFFFF))
 ; unless isFabsFree returns true
-define amdgpu_kernel void @s_fabsf_fn_free(ptr addrspace(1) %out, i32 %in) {
-; R600-LABEL: s_fabsf_fn_free:
-; R600:       ; %bb.0:
-; R600-NEXT:    ALU 3, @4, KC0[CB0:0-32], KC1[]
-; R600-NEXT:    MEM_RAT_CACHELESS STORE_RAW T0.X, T1.X, 1
-; R600-NEXT:    CF_END
-; R600-NEXT:    PAD
-; R600-NEXT:    ALU clause starting at 4:
-; R600-NEXT:     MOV * T0.W, KC0[2].Z,
-; R600-NEXT:     MOV T0.X, |PV.W|,
-; R600-NEXT:     LSHR * T1.X, KC0[2].Y, literal.x,
-; R600-NEXT:    2(2.802597e-45), 0(0.000000e+00)
-  %bc= bitcast i32 %in to float
-  %fabs = call float @fabsf(float %bc)
-  store float %fabs, ptr addrspace(1) %out
-  ret void
-}
-
 define amdgpu_kernel void @s_fabsf_free(ptr addrspace(1) %out, i32 %in) {
 ; R600-LABEL: s_fabsf_free:
 ; R600:       ; %bb.0:
@@ -100,23 +82,6 @@ define amdgpu_kernel void @fabsf_v4f32(ptr addrspace(1) %out, <4 x float> %in) {
   ret void
 }
 
-define amdgpu_kernel void @fabsf_fn_fold(ptr addrspace(1) %out, float %in0, float %in1) {
-; R600-LABEL: fabsf_fn_fold:
-; R600:       ; %bb.0:
-; R600-NEXT:    ALU 2, @4, KC0[CB0:0-32], KC1[]
-; R600-NEXT:    MEM_RAT_CACHELESS STORE_RAW T1.X, T0.X, 1
-; R600-NEXT:    CF_END
-; R600-NEXT:    PAD
-; R600-NEXT:    ALU clause starting at 4:
-; R600-NEXT:     LSHR T0.X, KC0[2].Y, literal.x,
-; R600-NEXT:     MUL_IEEE * T1.X, |KC0[2].Z|, KC0[2].W,
-; R600-NEXT:    2(2.802597e-45), 0(0.000000e+00)
-  %fabs = call float @fabsf(float %in0)
-  %fmul = fmul float %fabs, %in1
-  store float %fmul, ptr addrspace(1) %out
-  ret void
-}
-
 define amdgpu_kernel void @fabs_fold(ptr addrspace(1) %out, float %in0, float %in1) {
 ; R600-LABEL: fabs_fold:
 ; R600:       ; %bb.0:
diff --git a/llvm/test/CodeGen/AMDGPU/fabs.f64.ll b/llvm/test/CodeGen/AMDGPU/fabs.f64.ll
index 5d45f6723a8d1..e845cfdc37295 100644
--- a/llvm/test/CodeGen/AMDGPU/fabs.f64.ll
+++ b/llvm/test/CodeGen/AMDGPU/fabs.f64.ll
@@ -3,7 +3,6 @@
 
 declare i32 @llvm.amdgcn.workitem.id.x() nounwind readnone
 
-declare double @fabs(double) readnone
 declare double @llvm.fabs.f64(double) readnone
 declare <2 x double> @llvm.fabs.v2f64(<2 x double>) readnone
 declare <4 x double> @llvm.fabs.v4f64(<4 x double>) readnone
@@ -124,26 +123,6 @@ define amdgpu_kernel void @fabs_fold_f64(ptr addrspace(1) %out, [8 x i32], doubl
   ret void
 }
 
-define amdgpu_kernel void @fabs_fn_fold_f64(ptr addrspace(1) %out, [8 x i32], double %in0, [8 x i32], double %in1) {
-; SI-LABEL: fabs_fn_fold_f64:
-; SI:       ; %bb.0:
-; SI-NEXT:    s_load_dwordx2 s[6:7], s[4:5], 0x1d
-; SI-NEXT:    s_load_dwordx2 s[8:9], s[4:5], 0x13
-; SI-NEXT:    s_load_dwordx2 s[0:1], s[4:5], 0x9
-; SI-NEXT:    s_mov_b32 s3, 0xf000
-; SI-NEXT:    s_mov_b32 s2, -1
-; SI-NEXT:    s_waitcnt lgkmcnt(0)
-; SI-NEXT:    v_mov_b32_e32 v0, s6
-; SI-NEXT:    v_mov_b32_e32 v1, s7
-; SI-NEXT:    v_mul_f64 v[0:1], |s[8:9]|, v[0:1]
-; SI-NEXT:    buffer_store_dwordx2 v[0:1], off, s[0:3], 0
-; SI-NEXT:    s_endpgm
-  %fabs = call double @fabs(double %in0)
-  %fmul = fmul double %fabs, %in1
-  store double %fmul, ptr addrspace(1) %out
-  ret void
-}
-
 define amdgpu_kernel void @fabs_free_f64(ptr addrspace(1) %out, i64 %in) {
 ; SI-LABEL: fabs_free_f64:
 ; SI:       ; %bb.0:
@@ -163,23 +142,3 @@ define amdgpu_kernel void @fabs_free_f64(ptr addrspace(1) %out, i64 %in) {
   store double %fabs, ptr addrspace(1) %out
   ret void
 }
-
-define amdgpu_kernel void @fabs_fn_free_f64(ptr addrspace(1) %out, i64 %in) {
-; SI-LABEL: fabs_fn_free_f64:
-; SI:       ; %bb.0:
-; SI-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0x9
-; SI-NEXT:    s_mov_b32 s7, 0xf000
-; SI-NEXT:    s_waitcnt lgkmcnt(0)
-; SI-NEXT:    s_bitset0_b32 s3, 31
-; SI-NEXT:    s_mov_b32 s6, -1
-; SI-NEXT:    s_mov_b32 s4, s0
-; SI-NEXT:    s_mov_b32 s5, s1
-; SI-NEXT:    v_mov_b32_e32 v0, s2
-; SI-NEXT:    v_mov_b32_e32 v1, s3
-; SI-NEXT:    buffer_store_dwordx2 v[0:1], off, s[4:7], 0
-; SI-NEXT:    s_endpgm
-  %bc= bitcast i64 %in to double
-  %fabs = call double @fabs(double %bc)
-  store double %fabs, ptr addrspace(1) %out
-  ret void
-}
diff --git a/llvm/test/CodeGen/AMDGPU/fabs.ll b/llvm/test/CodeGen/AMDGPU/fabs.ll
index 97e23fcdb2263..fd0b6b4b0c59f 100644
--- a/llvm/test/CodeGen/AMDGPU/fabs.ll
+++ b/llvm/test/CodeGen/AMDGPU/fabs.ll
@@ -6,36 +6,6 @@
 ; DAGCombiner will transform:
 ; (fabsf (f32 bitcast (i32 a))) => (f32 bitcast (and (i32 a), 0x7FFFFFFF))
 ; unless isFabsFree returns true
-define amdgpu_kernel void @s_fabsf_fn_free(ptr addrspace(1) %out, i32 %in) {
-; SI-LABEL: s_fabsf_fn_free:
-; SI:       ; %bb.0:
-; SI-NEXT:    s_load_dwordx2 s[0:1], s[4:5], 0x9
-; SI-NEXT:    s_load_dword s4, s[4:5], 0xb
-; SI-NEXT:    s_mov_b32 s3, 0xf000
-; SI-NEXT:    s_mov_b32 s2, -1
-; SI-NEXT:    s_waitcnt lgkmcnt(0)
-; SI-NEXT:    s_bitset0_b32 s4, 31
-; SI-NEXT:    v_mov_b32_e32 v0, s4
-; SI-NEXT:    buffer_store_dword v0, off, s[0:3], 0
-; SI-NEXT:    s_endpgm
-;
-; VI-LABEL: s_fabsf_fn_free:
-; VI:       ; %bb.0:
-; VI-NEXT:    s_load_dwordx2 s[0:1], s[4:5], 0x24
-; VI-NEXT:    s_load_dword s2, s[4:5], 0x2c
-; VI-NEXT:    s_waitcnt lgkmcnt(0)
-; VI-NEXT:    v_mov_b32_e32 v0, s0
-; VI-NEXT:    s_bitset0_b32 s2, 31
-; VI-NEXT:    v_mov_b32_e32 v1, s1
-; VI-NEXT:    v_mov_b32_e32 v2, s2
-; VI-NEXT:    flat_store_dword v[0:1], v2
-; VI-NEXT:    s_endpgm
-  %bc= bitcast i32 %in to float
-  %fabs = call float @fabsf(float %bc)
-  store float %fabs, ptr addrspace(1) %out
-  ret void
-}
-
 define amdgpu_kernel void @s_fabsf_free(ptr addrspace(1) %out, i32 %in) {
 ; SI-LABEL: s_fabsf_free:
 ; SI:       ; %bb.0:
@@ -168,36 +138,6 @@ define amdgpu_kernel void @fabsf_v4f32(ptr addrspace(1) %out, <4 x float> %in) {
   ret void
 }
 
-define amdgpu_kernel void @fabsf_fn_fold(ptr addrspace(1) %out, float %in0, float %in1) {
-; SI-LABEL: fabsf_fn_fold:
-; SI:       ; %bb.0:
-; SI-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0x9
-; SI-NEXT:    s_mov_b32 s7, 0xf000
-; SI-NEXT:    s_mov_b32 s6, -1
-; SI-NEXT:    s_waitcnt lgkmcnt(0)
-; SI-NEXT:    s_mov_b32 s4, s0
-; SI-NEXT:    s_mov_b32 s5, s1
-; SI-NEXT:    v_mov_b32_e32 v0, s3
-; SI-NEXT:    v_mul_f32_e64 v0, |s2|, v0
-; SI-NEXT:    buffer_store_dword v0, off, s[4:7], 0
-; SI-NEXT:    s_endpgm
-;
-; VI-LABEL: fabsf_fn_fold:
-; VI:       ; %bb.0:
-; VI-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0x24
-; VI-NEXT:    s_waitcnt lgkmcnt(0)
-; VI-NEXT:    v_mov_b32_e32 v0, s3
-; VI-NEXT:    v_mul_f32_e64 v2, |s2|, v0
-; VI-NEXT:    v_mov_b32_e32 v0, s0
-; VI-NEXT:    v_mov_b32_e32 v1, s1
-; VI-NEXT:    flat_store_dword v[0:1], v2
-; VI-NEXT:    s_endpgm
-  %fabs = call float @fabsf(float %in0)
-  %fmul = fmul float %fabs, %in1
-  store float %fmul, ptr addrspace(1) %out
-  ret void
-}
-
 define amdgpu_kernel void @fabs_fold(ptr addrspace(1) %out, float %in0, float %in1) {
 ; SI-LABEL: fabs_fold:
 ; SI:       ; %bb.0:
@@ -258,7 +198,6 @@ define amdgpu_kernel void @bitpreserve_fabsf_f32(ptr addrspace(1) %out, float %i
   ret void
 }
 
-declare float @fabsf(float) readnone
 declare float @llvm.fabs.f32(float) readnone
 declare <2 x float> @llvm.fabs.v2f32(<2 x float>) readnone
 declare <4 x float> @llvm.fabs.v4f32(<4 x float>) readnone
diff --git a/llvm/test/CodeGen/AMDGPU/fneg-fabs-r600.ll b/llvm/test/CodeGen/AMDGPU/fneg-fabs-r600.ll
index caf7a845759fc..dccabf078c3d7 100644
--- a/llvm/test/CodeGen/AMDGPU/fneg-fabs-r600.ll
+++ b/llvm/test/CodeGen/AMDGPU/fneg-fabs-r600.ll
@@ -57,26 +57,6 @@ define amdgpu_kernel void @fneg_fabsf_free_f32(ptr addrspace(1) %out, i32 %in) {
   ret void
 }
 
-define amdgpu_kernel void @fneg_fabsf_fn_free_f32(ptr addrspace(1) %out, i32 %in) {
-; R600-LABEL: fneg_fabsf_fn_free_f32:
-; R600:       ; %bb.0:
-; R600-NEXT:    ALU 4, @4, KC0[CB0:0-32], KC1[]
-; R600-NEXT:    MEM_RAT_CACHELESS STORE_RAW T0.X, T1.X, 1
-; R600-NEXT:    CF_END
-; R600-NEXT:    PAD
-; R600-NEXT:    ALU clause starting at 4:
-; R600-NEXT:     MOV * T0.W, KC0[2].Z,
-; R600-NEXT:     MOV * T0.W, |PV.W|,
-; R600-NEXT:     MOV T0.X, -PV.W,
-; R600-NEXT:     LSHR * T1.X, KC0[2].Y, literal.x,
-; R600-NEXT:    2(2.802597e-45), 0(0.000000e+00)
-  %bc = bitcast i32 %in to float
-  %fabs = call float @fabsf(float %bc)
-  %fsub = fsub float -0.000000e+00, %fabs
-  store float %fsub, ptr addrspace(1) %out
-  ret void
-}
-
 define amdgpu_kernel void @fneg_fabsf_f32(ptr addrspace(1) %out, float %in) {
 ; R600-LABEL: fneg_fabsf_f32:
 ; R600:       ; %bb.0:
@@ -171,7 +151,6 @@ define amdgpu_kernel void @fneg_fabsf_v4f32(ptr addrspace(1) %out, <4 x float> %
   ret void
 }
 
-declare float @fabsf(float) readnone
 declare float @llvm.fabs.f32(float) readnone
 declare <2 x float> @llvm.fabs.v2f32(<2 x float>) readnone
 declare <4 x float> @llvm.fabs.v4f32(<4 x float>) readnone
diff --git a/llvm/test/CodeGen/AMDGPU/fneg-fabs.f64.ll b/llvm/test/CodeGen/AMDGPU/fneg-fabs.f64.ll
index 52b6d2cbaa6eb..65c3917294baf 100644
--- a/llvm/test/CodeGen/AMDGPU/fneg-fabs.f64.ll
+++ b/llvm/test/CodeGen/AMDGPU/fneg-fabs.f64.ll
@@ -138,39 +138,6 @@ define amdgpu_kernel void @fneg_fabs_free_f64(ptr addrspace(1) %out, i64 %in) {
   ret void
 }
 
-define amdgpu_kernel void @fneg_fabs_fn_free_f64(ptr addrspace(1) %out, i64 %in) {
-; SI-LABEL: fneg_fabs_fn_free_f64:
-; SI:       ; %bb.0:
-; SI-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0x9
-; SI-NEXT:    s_mov_b32 s7, 0xf000
-; SI-NEXT:    s_waitcnt lgkmcnt(0)
-; SI-NEXT:    s_bitset1_b32 s3, 31
-; SI-NEXT:    s_mov_b32 s6, -1
-; SI-NEXT:    s_mov_b32 s4, s0
-; SI-NEXT:    s_mov_b32 s5, s1
-; SI-NEXT:    v_mov_b32_e32 v0, s2
-; SI-NEXT:    v_mov_b32_e32 v1, s3
-; SI-NEXT:    buffer_store_dwordx2 v[0:1], off, s[4:7], 0
-; SI-NEXT:    s_endpgm
-;
-; VI-LABEL: fneg_fabs_fn_free_f64:
-; VI:       ; %bb.0:
-; VI-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0x24
-; VI-NEXT:    s_waitcnt lgkmcnt(0)
-; VI-NEXT:    v_mov_b32_e32 v0, s0
-; VI-NEXT:    s_or_b32 s0, s3, 0x80000000
-; VI-NEXT:    v_mov_b32_e32 v1, s1
-; VI-NEXT:    v_mov_b32_e32 v2, s2
-; VI-NEXT:    v_mov_b32_e32 v3, s0
-; VI-NEXT:    flat_store_dwordx2 v[0:1], v[2:3]
-; VI-NEXT:    s_endpgm
-  %bc = bitcast i64 %in to double
-  %fabs = call double @fabs(double %bc)
-  %fsub = fsub double -0.000000e+00, %fabs
-  store double %fsub, ptr addrspace(1) %out
-  ret void
-}
-
 define amdgpu_kernel void @fneg_fabs_f64(ptr addrspace(1) %out, [8 x i32], double %in) {
 ; SI-LABEL: fneg_fabs_f64:
 ; SI:       ; %bb.0:
@@ -297,7 +264,6 @@ define amdgpu_kernel void @fneg_fabs_v4f64(ptr addrspace(1) %out, <4 x double> %
   ret void
 }
 
-declare double @fabs(double) readnone
 declare double @llvm.fabs.f64(double) readnone
 declare <2 x double> @llvm.fabs.v2f64(<2 x double>) readnone
 declare <4 x double> @llvm.fabs.v4f64(<4 x double>) readnone
diff --git a/llvm/test/CodeGen/AMDGPU/fneg-fabs.ll b/llvm/test/CodeGen/AMDGPU/fneg-fabs.ll
index 214ccedd75170..1264ac9096839 100644
--- a/llvm/test/CodeGen/AMDGPU/fneg-fabs.ll
+++ b/llvm/test/CodeGen/AMDGPU/fneg-fabs.ll
@@ -95,37 +95,6 @@ define amdgpu_kernel void @fneg_fabsf_free_f32(ptr addrspace(1) %out, i32 %in) {
   ret void
 }
 
-define amdgpu_kernel void @fneg_fabsf_fn_free_f32(ptr addrspace(1) %out, i32 %in) {
-; SI-LABEL: fneg_fabsf_fn_free_f32:
-; SI:       ; %bb.0:
-; SI-NEXT:    s_load_dword s2, s[4:5], 0xb
-; SI-NEXT:    s_load_dwordx2 s[0:1], s[4:5], 0x9
-; SI-NEXT:    s_mov_b32 s3, 0xf000
-; SI-NEXT:    s_waitcnt lgkmcnt(0)
-; SI-NEXT:    s_or_b32 s4, s2, 0x80000000
-; SI-NEXT:    s_mov_b32 s2, -1
-; SI-NEXT:    v_mov_b32_e32 v0, s4
-; SI-NEXT:    buffer_store_dword v0, off, s[0:3], 0
-; SI-NEXT:    s_endpgm
-;
-; VI-LABEL: fneg_fabsf_fn_free_f32:
-; VI:       ; %bb.0:
-; VI-NEXT:    s_load_dword s2, s[4:5], 0x2c
-; VI-NEXT:    s_load_dwordx2 s[0:1], s[4:5], 0x24
-; VI-NEXT:    s_waitcnt lgkmcnt(0)
-; VI-NEXT:    s_bitset1_b32 s2, 31
-; VI-NEXT:    v_mov_b32_e32 v0, s0
-; VI-NEXT:    v_mov_b32_e32 v1, s1
-; VI-NEXT:    v_mov_b32_e32 v2, s2
-; VI-NEXT:    flat_store_dword v[0:1], v2
-; VI-NEXT:    s_endpgm
-  %bc = bitcast i32 %in to float
-  %fabs = call float @fabsf(float %bc)
-  %fsub = fsub float -0.000000e+00, %fabs
-  store float %fsub, ptr addrspace(1) %out
-  ret void
-}
-
 define amdgpu_kernel void @fneg_fabsf_f32(ptr addrspace(1) %out, float %in) {
 ; SI-LABEL: fneg_fabsf_f32:
 ; SI:       ; %bb.0:
@@ -270,7 +239,6 @@ define amdgpu_kernel void @fneg_fabsf_v4f32(ptr addrspace(1) %out, <4 x float> %
   ret void
 }
 
-declare float @fabsf(float) readnone
 declare float @llvm.fabs.f32(float) readnone
 declare <2 x float> @llvm.fabs.v2f32(<2 x float>) readnone
 declare <4 x float> @llvm.fabs.v4f32(<4 x float>) readnone
diff --git a/llvm/test/CodeGen/AMDGPU/r600-infinite-loop-bug-while-reorganizing-vector.ll b/llvm/test/CodeGen/AMDGPU/r600-infinite-loop-bug-while-reorganizing-vector.ll
index d815c18a289e1..b2a925d8f7c05 100644
--- a/llvm/test/CodeGen/AMDGPU/r600-infinite-loop-bug-while-reorganizing-vector.ll
+++ b/llvm/test/CodeGen/AMDGPU/r600-infinite-loop-bug-while-reorganizing-vector.ll
@@ -15,7 +15,7 @@ main_body:
   %tmp11 = extractelement <4 x float> %tmp9, i32 1
   %tmp12 = extractelement <4 x float> %tmp9, i32 2
   %tmp13 = extractelement <4 x float> %tmp9, i32 3
-  %tmp14 = call float @fabsf(float %tmp12)
+  %tmp14 = call float @llvm.fabs.f32(float %tmp12)
   %tmp15 = fdiv float 1.000000e+00, %tmp14
   %tmp16 = fmul float %tmp10, %tmp15
   %tmp17 = fadd float %tmp16, 1.500000e+00
@@ -48,7 +48,7 @@ main_body:
 declare <4 x float> @llvm.r600.cube(<4 x float>) #0
 
 ; Function Attrs: readnone
-declare float @fabsf(float) #0
+declare float @llvm.fabs.f32(float) #0
 
 declare void @llvm.r600.store.swizzle(<4 x float>, i32, i32)
 
diff --git a/llvm/test/CodeGen/AMDGPU/schedule-if-2.ll b/llvm/test/CodeGen/AMDGPU/schedule-if-2.ll
index 2baa955ed8d06..089fe2fe1fed7 100644
--- a/llvm/test/CodeGen/AMDGPU/schedule-if-2.ll
+++ b/llvm/test/CodeGen/AMDGPU/schedule-if-2.ll
@@ -17,7 +17,7 @@ main_body:
   br i1 %10, label %IF, label %ELSE
 
 IF:                                               ; preds = %main_body
-  %11 = call float @fabsf(float %2)
+  %11 = call float @llvm.fabs.f32(float %2)
   %12 = fcmp ueq float %11, 0x7FF0000000000000
   %13 = select i1 %12, float 1.000000e+00, float 0.000000e+00
   %14 = fsub float -0.000000e+00, %13
@@ -87,7 +87,7 @@ IF23:                                             ; preds = %ELSE
   br label %ENDIF
 }
 
-declare float @fabsf(float) #0
+declare float @llvm.fabs.f32(float) #0
 
 declare void @llvm.r600.store.swizzle(<4 x float>, i32, i32)
 
diff --git a/llvm/test/CodeGen/ARM/fabs-to-bfc.ll b/llvm/test/CodeGen/ARM/fabs-to-bfc.ll
index 1a2e04584a913..8374dd79460e9 100644
--- a/llvm/test/CodeGen/ARM/fabs-to-bfc.ll
+++ b/llvm/test/CodeGen/ARM/fabs-to-bfc.ll
@@ -4,11 +4,11 @@
 
 define double @test(double %tx) {
 ;CHECK-LABEL: test:
-  %call = tail call double @fabs(double %tx)
+  %call = tail call double @llvm.fabs.f64(double %tx)
   ret double %call
 ;CHECK-VABS: vabs.f64
 ;CHECK-BFC: bfc
 }
 
-declare double @fabs(double) readnone
+declare double @llvm.fabs.f64(double) readnone
 
diff --git a/llvm/test/CodeGen/ARM/fabss.ll b/llvm/test/CodeGen/ARM/fabss.ll
index 77c21c5be91a7..28415efa138f4 100644
--- a/llvm/test/CodeGen/ARM/fabss.ll
+++ b/llvm/test/CodeGen/ARM/fabss.ll
@@ -6,12 +6,12 @@
 define float @test(float %a, float %b) {
 entry:
         %dum = fadd float %a, %b
-	%0 = tail call float @fabsf(float %dum) readnone
+	%0 = tail call float @llvm.fabs.f32(float %dum) readnone
         %dum1 = fadd float %0, %b
 	ret float %dum1
 }
 
-declare float @fabsf(float)
+declare float @llvm.fabs.f32(float)
 
 ; VFP2-LABEL: test:
 ; VFP2: 	vabs.f32	s
diff --git a/llvm/test/CodeGen/ARM/fparith.ll b/llvm/test/CodeGen/ARM/fparith.ll
index 824824429db17..9382a8871fc22 100644
--- a/llvm/test/CodeGen/ARM/fparith.ll
+++ b/llvm/test/CodeGen/ARM/fparith.ll
@@ -84,18 +84,18 @@ define float @f11(float %a) {
 ;CHECK-LABEL: f11:
 ;CHECK: bic
 entry:
-	%tmp1 = call float @fabsf( float %a ) readnone	; <float> [#uses=1]
+	%tmp1 = call float @llvm.fabs.f32( float %a ) readnone	; <float> [#uses=1]
 	ret float %tmp1
 }
 
-declare float @fabsf(float)
+declare float @llvm.fabs.f32(float)
 
 define arm_aapcs_vfpcc double @f12(double %a) {
 ;CHECK-LABEL: f12:
 ;CHECK: vabs.f64
 entry:
-	%tmp1 = call double @fabs( double %a ) readnone	; <double> [#uses=1]
+	%tmp1 = call double @llvm.fabs.f64( double %a ) readnone	; <double> [#uses=1]
 	ret double %tmp1
 }
 
-declare double @fabs(double)
+declare double @llvm.fabs.f64(double)
diff --git a/llvm/test/CodeGen/ARM/vfp.ll b/llvm/test/CodeGen/ARM/vfp.ll
index 6f5bfc9aac018..2ba7875a070dc 100644
--- a/llvm/test/CodeGen/ARM/vfp.ll
+++ b/llvm/test/CodeGen/ARM/vfp.ll
@@ -9,19 +9,19 @@ define void @test(ptr %P, ptr %D) {
 	ret void
 }
 
-declare float @fabsf(float)
+declare float @llvm.fabs.f32(float)
 
-declare double @fabs(double)
+declare double @llvm.fabs.f64(double)
 
 define void @test_abs(ptr %P, ptr %D) {
 ;CHECK-LABEL: test_abs:
 	%a = load float, ptr %P		; <float> [#uses=1]
 ;CHECK: vabs.f32
-	%b = call float @fabsf( float %a ) readnone	; <float> [#uses=1]
+	%b = call float @llvm.fabs.f32( float %a ) readnone	; <float> [#uses=1]
 	store float %b, ptr %P
 	%A = load double, ptr %D		; <double> [#uses=1]
 ;CHECK: vabs.f64
-	%B = call double @fabs( double %A ) readnone	; <double> [#uses=1]
+	%B = call double @llvm.fabs.f64( double %A ) readnone	; <double> [#uses=1]
 	store double %B, ptr %D
 	ret void
 }
diff --git a/llvm/test/CodeGen/Hexagon/bit-extract-off.ll b/llvm/test/CodeGen/Hexagon/bit-extract-off.ll
index 3396779737a42..2c00f52744b09 100644
--- a/llvm/test/...
[truncated]

``````````

</details>


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


More information about the llvm-commits mailing list