[llvm] [SDAG] Remove most non-canonical libcall handing (PR #171288)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 9 00:24:04 PST 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-backend-arm
Author: Nikita Popov (nikic)
<details>
<summary>Changes</summary>
This is a followup to https://github.com/llvm/llvm-project/pull/171114, removing the handling for most libcalls that are already canonicalized to intrinsics in the middle-end. The only remaining one is fabs, which has more test coverage than the others.
---
Patch is 78.21 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/171288.diff
22 Files Affected:
- (modified) llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp (-63)
- (modified) llvm/test/CodeGen/AArch64/arm64-rounding.ll (+18-38)
- (modified) llvm/test/CodeGen/AArch64/floatdp_1source.ll (+8-20)
- (modified) llvm/test/CodeGen/AArch64/round-conv.ll (+32-41)
- (modified) llvm/test/CodeGen/AArch64/round-fptosi-sat-scalar.ll (+24-24)
- (modified) llvm/test/CodeGen/AArch64/round-fptoui-sat-scalar.ll (+24-24)
- (modified) llvm/test/CodeGen/AMDGPU/floor.ll (+2-2)
- (modified) llvm/test/CodeGen/ARM/arm32-round-conv.ll (+16-18)
- (modified) llvm/test/CodeGen/ARM/arm32-rounding.ll (+20-20)
- (modified) llvm/test/CodeGen/ARM/floorf.ll (+6-6)
- (modified) llvm/test/CodeGen/Mips/mips64-f128.ll (+3-9)
- (modified) llvm/test/CodeGen/PowerPC/ctr-minmaxnum.ll (-97)
- (modified) llvm/test/CodeGen/PowerPC/fminnum.ll (+32-32)
- (modified) llvm/test/CodeGen/PowerPC/rounding-ops.ll (+16-16)
- (modified) llvm/test/CodeGen/RISCV/double-zfa.ll (+10-10)
- (modified) llvm/test/CodeGen/RISCV/float-zfa.ll (+10-10)
- (modified) llvm/test/CodeGen/SystemZ/vec-max-05.ll (-36)
- (modified) llvm/test/CodeGen/SystemZ/vec-min-05.ll (-36)
- (modified) llvm/test/CodeGen/X86/fmaxnum.ll (+22-71)
- (modified) llvm/test/CodeGen/X86/fminnum.ll (+22-71)
- (modified) llvm/test/CodeGen/X86/pr31143.ll (+4-4)
- (modified) llvm/test/CodeGen/X86/rounding-ops.ll (+20-20)
``````````diff
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 71345509ea429..05aec6353f924 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -9590,34 +9590,6 @@ void SelectionDAGBuilder::visitCall(const CallInst &I) {
if (visitUnaryFloatCall(I, ISD::FABS))
return;
break;
- case LibFunc_fmin:
- case LibFunc_fminf:
- case LibFunc_fminl:
- // TODO: Remove this, already canonicalized by the middle-end.
- if (visitBinaryFloatCall(I, ISD::FMINNUM))
- return;
- break;
- case LibFunc_fmax:
- case LibFunc_fmaxf:
- case LibFunc_fmaxl:
- // TODO: Remove this, already canonicalized by the middle-end.
- if (visitBinaryFloatCall(I, ISD::FMAXNUM))
- return;
- break;
- case LibFunc_fminimum_num:
- case LibFunc_fminimum_numf:
- case LibFunc_fminimum_numl:
- // TODO: Remove this, already canonicalized by the middle-end.
- if (visitBinaryFloatCall(I, ISD::FMINIMUMNUM))
- return;
- break;
- case LibFunc_fmaximum_num:
- case LibFunc_fmaximum_numf:
- case LibFunc_fmaximum_numl:
- // TODO: Remove this, already canonicalized by the middle-end.
- if (visitBinaryFloatCall(I, ISD::FMAXIMUMNUM))
- return;
- break;
case LibFunc_sin:
case LibFunc_sinf:
case LibFunc_sinl:
@@ -9687,41 +9659,6 @@ void SelectionDAGBuilder::visitCall(const CallInst &I) {
if (visitUnaryFloatCall(I, ISD::FSQRT))
return;
break;
- case LibFunc_floor:
- case LibFunc_floorf:
- case LibFunc_floorl:
- // TODO: Remove this, already canonicalized by the middle-end.
- if (visitUnaryFloatCall(I, ISD::FFLOOR))
- return;
- break;
- case LibFunc_ceil:
- case LibFunc_ceilf:
- case LibFunc_ceill:
- // TODO: Remove this, already canonicalized by the middle-end.
- if (visitUnaryFloatCall(I, ISD::FCEIL))
- return;
- break;
- case LibFunc_rint:
- case LibFunc_rintf:
- case LibFunc_rintl:
- // TODO: Remove this, already canonicalized by the middle-end.
- if (visitUnaryFloatCall(I, ISD::FRINT))
- return;
- break;
- case LibFunc_round:
- case LibFunc_roundf:
- case LibFunc_roundl:
- // TODO: Remove this, already canonicalized by the middle-end.
- if (visitUnaryFloatCall(I, ISD::FROUND))
- return;
- break;
- case LibFunc_trunc:
- case LibFunc_truncf:
- case LibFunc_truncl:
- // TODO: Remove this, already canonicalized by the middle-end.
- if (visitUnaryFloatCall(I, ISD::FTRUNC))
- return;
- break;
case LibFunc_log2:
case LibFunc_log2f:
case LibFunc_log2l:
diff --git a/llvm/test/CodeGen/AArch64/arm64-rounding.ll b/llvm/test/CodeGen/AArch64/arm64-rounding.ll
index 618731fb001ca..7ade2fd497746 100644
--- a/llvm/test/CodeGen/AArch64/arm64-rounding.ll
+++ b/llvm/test/CodeGen/AArch64/arm64-rounding.ll
@@ -5,23 +5,19 @@
; CHECK-NOT: frintx
define float @test1(float %a) #0 {
entry:
- %call = tail call float @floorf(float %a) nounwind readnone
+ %call = tail call float @llvm.floor.f32(float %a) nounwind readnone
ret float %call
}
-declare float @floorf(float) nounwind readnone
-
; CHECK-LABEL: test2:
; CHECK: frintm
; CHECK-NOT: frintx
define double @test2(double %a) #0 {
entry:
- %call = tail call double @floor(double %a) nounwind readnone
+ %call = tail call double @llvm.floor.f64(double %a) nounwind readnone
ret double %call
}
-declare double @floor(double) nounwind readnone
-
; CHECK-LABEL: test3:
; CHECK: frinti
define float @test3(float %a) #0 {
@@ -43,93 +39,77 @@ entry:
; CHECK-NOT: frintx
define float @test5(float %a) #0 {
entry:
- %call = tail call float @ceilf(float %a) nounwind readnone
+ %call = tail call float @llvm.ceil.f32(float %a) nounwind readnone
ret float %call
}
-declare float @ceilf(float) nounwind readnone
-
; CHECK-LABEL: test6:
; CHECK: frintp
; CHECK-NOT: frintx
define double @test6(double %a) #0 {
entry:
- %call = tail call double @ceil(double %a) nounwind readnone
+ %call = tail call double @llvm.ceil.f64(double %a) nounwind readnone
ret double %call
}
-declare double @ceil(double) nounwind readnone
-
; CHECK-LABEL: test7:
; CHECK: frintx
define float @test7(float %a) #0 {
entry:
- %call = tail call float @rintf(float %a) nounwind readnone
+ %call = tail call float @llvm.rint.f32(float %a) nounwind readnone
ret float %call
}
-declare float @rintf(float) nounwind readnone
-
; CHECK-LABEL: test8:
; CHECK: frintx
define double @test8(double %a) #0 {
entry:
- %call = tail call double @rint(double %a) nounwind readnone
+ %call = tail call double @llvm.rint.f64(double %a) nounwind readnone
ret double %call
}
-declare double @rint(double) nounwind readnone
-
; CHECK-LABEL: test9:
; CHECK: frintz
; CHECK-NOT: frintx
define float @test9(float %a) #0 {
entry:
- %call = tail call float @truncf(float %a) nounwind readnone
+ %call = tail call float @llvm.trunc.f32(float %a) nounwind readnone
ret float %call
}
-declare float @truncf(float) nounwind readnone
-
; CHECK-LABEL: test10:
; CHECK: frintz
; CHECK-NOT: frintx
define double @test10(double %a) #0 {
entry:
- %call = tail call double @trunc(double %a) nounwind readnone
+ %call = tail call double @llvm.trunc.f64(double %a) nounwind readnone
ret double %call
}
-declare double @trunc(double) nounwind readnone
-
; CHECK-LABEL: test11:
; CHECK: frinta
; CHECK-NOT: frintx
define float @test11(float %a) #0 {
entry:
- %call = tail call float @roundf(float %a) nounwind readnone
+ %call = tail call float @llvm.round.f32(float %a) nounwind readnone
ret float %call
}
-declare float @roundf(float %a) nounwind readnone
-
; CHECK-LABEL: test12:
; CHECK: frinta
; CHECK-NOT: frintx
define double @test12(double %a) #0 {
entry:
- %call = tail call double @round(double %a) nounwind readnone
+ %call = tail call double @llvm.round.f64(double %a) nounwind readnone
ret double %call
}
-declare double @round(double %a) nounwind readnone
-
; CHECK-LABEL: test13:
; CHECK-NOT: frintx
; CHECK: frintm
define float @test13(float %a) #1 {
entry:
- %call = tail call float @floorf(float %a) nounwind readnone
+ %call = tail call float @llvm.floor.f32(float %a) nounwind readnone
ret float %call
}
@@ -138,7 +118,7 @@ entry:
; CHECK: frintm
define double @test14(double %a) #1 {
entry:
- %call = tail call double @floor(double %a) nounwind readnone
+ %call = tail call double @llvm.floor.f64(double %a) nounwind readnone
ret double %call
}
@@ -147,7 +127,7 @@ entry:
; CHECK: frintp
define float @test15(float %a) #1 {
entry:
- %call = tail call float @ceilf(float %a) nounwind readnone
+ %call = tail call float @llvm.ceil.f32(float %a) nounwind readnone
ret float %call
}
@@ -156,7 +136,7 @@ entry:
; CHECK: frintp
define double @test16(double %a) #1 {
entry:
- %call = tail call double @ceil(double %a) nounwind readnone
+ %call = tail call double @llvm.ceil.f64(double %a) nounwind readnone
ret double %call
}
@@ -165,7 +145,7 @@ entry:
; CHECK: frintz
define float @test17(float %a) #1 {
entry:
- %call = tail call float @truncf(float %a) nounwind readnone
+ %call = tail call float @llvm.trunc.f32(float %a) nounwind readnone
ret float %call
}
@@ -174,7 +154,7 @@ entry:
; CHECK: frintz
define double @test18(double %a) #1 {
entry:
- %call = tail call double @trunc(double %a) nounwind readnone
+ %call = tail call double @llvm.trunc.f64(double %a) nounwind readnone
ret double %call
}
@@ -183,7 +163,7 @@ entry:
; CHECK: frinta
define float @test19(float %a) #1 {
entry:
- %call = tail call float @roundf(float %a) nounwind readnone
+ %call = tail call float @llvm.round.f32(float %a) nounwind readnone
ret float %call
}
@@ -192,7 +172,7 @@ entry:
; CHECK: frinta
define double @test20(double %a) #1 {
entry:
- %call = tail call double @round(double %a) nounwind readnone
+ %call = tail call double @llvm.round.f64(double %a) nounwind readnone
ret double %call
}
diff --git a/llvm/test/CodeGen/AArch64/floatdp_1source.ll b/llvm/test/CodeGen/AArch64/floatdp_1source.ll
index 8d1620d62ab01..32d73d9e830f8 100644
--- a/llvm/test/CodeGen/AArch64/floatdp_1source.ll
+++ b/llvm/test/CodeGen/AArch64/floatdp_1source.ll
@@ -7,18 +7,6 @@ declare double @fabs(double) readonly
declare float @llvm.sqrt.f32(float %Val)
declare double @llvm.sqrt.f64(double %Val)
-declare float @ceilf(float) readonly
-declare double @ceil(double) readonly
-
-declare float @floorf(float) readonly
-declare double @floor(double) readonly
-
-declare float @truncf(float) readonly
-declare double @trunc(double) readonly
-
-declare float @rintf(float) readonly
-declare double @rint(double) readonly
-
define float @fabs_f(float %v) {
; CHECK-LABEL: fabs_f:
; CHECK: ; %bb.0:
@@ -51,7 +39,7 @@ define float @ceil_f(float %v) {
; CHECK: ; %bb.0:
; CHECK-NEXT: frintp s0, s0
; CHECK-NEXT: ret
- %r = call float @ceilf(float %v)
+ %r = call float @llvm.ceil.f32(float %v)
ret float %r
}
@@ -60,7 +48,7 @@ define float @floor_f(float %v) {
; CHECK: ; %bb.0:
; CHECK-NEXT: frintm s0, s0
; CHECK-NEXT: ret
- %r = call float @floorf(float %v)
+ %r = call float @llvm.floor.f32(float %v)
ret float %r
}
@@ -69,7 +57,7 @@ define float @trunc_f(float %v) {
; CHECK: ; %bb.0:
; CHECK-NEXT: frintz s0, s0
; CHECK-NEXT: ret
- %r = call float @truncf(float %v)
+ %r = call float @llvm.trunc.f32(float %v)
ret float %r
}
@@ -78,7 +66,7 @@ define float @rint_f(float %v) {
; CHECK: ; %bb.0:
; CHECK-NEXT: frintx s0, s0
; CHECK-NEXT: ret
- %r = call float @rintf(float %v)
+ %r = call float @llvm.rint.f32(float %v)
ret float %r
}
@@ -123,7 +111,7 @@ define double @ceil_d(double %v) {
; CHECK: ; %bb.0:
; CHECK-NEXT: frintp d0, d0
; CHECK-NEXT: ret
- %r = call double @ceil(double %v)
+ %r = call double @llvm.ceil.f64(double %v)
ret double %r
}
@@ -132,7 +120,7 @@ define double @floor_d(double %v) {
; CHECK: ; %bb.0:
; CHECK-NEXT: frintm d0, d0
; CHECK-NEXT: ret
- %r = call double @floor(double %v)
+ %r = call double @llvm.floor.f64(double %v)
ret double %r
}
@@ -141,7 +129,7 @@ define double @trunc_d(double %v) {
; CHECK: ; %bb.0:
; CHECK-NEXT: frintz d0, d0
; CHECK-NEXT: ret
- %r = call double @trunc(double %v)
+ %r = call double @llvm.trunc.f64(double %v)
ret double %r
}
@@ -150,7 +138,7 @@ define double @rint_d(double %v) {
; CHECK: ; %bb.0:
; CHECK-NEXT: frintx d0, d0
; CHECK-NEXT: ret
- %r = call double @rint(double %v)
+ %r = call double @llvm.rint.f64(double %v)
ret double %r
}
diff --git a/llvm/test/CodeGen/AArch64/round-conv.ll b/llvm/test/CodeGen/AArch64/round-conv.ll
index 5ed7d9409e3dd..d78aa207925a4 100644
--- a/llvm/test/CodeGen/AArch64/round-conv.ll
+++ b/llvm/test/CodeGen/AArch64/round-conv.ll
@@ -5,7 +5,7 @@
; CHECK-NOT: frintx {{s[0-9]+}}, s0
define i32 @testmsws(float %a) {
entry:
- %call = call float @floorf(float %a) nounwind readnone
+ %call = call float @llvm.floor.f32(float %a) nounwind readnone
%conv = fptosi float %call to i32
ret i32 %conv
}
@@ -15,7 +15,7 @@ entry:
; CHECK-NOT: frintx {{s[0-9]+}}, s0
define i64 @testmsxs(float %a) {
entry:
- %call = call float @floorf(float %a) nounwind readnone
+ %call = call float @llvm.floor.f32(float %a) nounwind readnone
%conv = fptosi float %call to i64
ret i64 %conv
}
@@ -25,7 +25,7 @@ entry:
; CHECK-NOT: frintx {{d[0-9]+}}, d0
define i32 @testmswd(double %a) {
entry:
- %call = call double @floor(double %a) nounwind readnone
+ %call = call double @llvm.floor.f64(double %a) nounwind readnone
%conv = fptosi double %call to i32
ret i32 %conv
}
@@ -35,7 +35,7 @@ entry:
; CHECK-NOT: frintx {{d[0-9]+}}, d0
define i64 @testmsxd(double %a) {
entry:
- %call = call double @floor(double %a) nounwind readnone
+ %call = call double @llvm.floor.f64(double %a) nounwind readnone
%conv = fptosi double %call to i64
ret i64 %conv
}
@@ -45,7 +45,7 @@ entry:
; CHECK-NOT: frintx {{s[0-9]+}}, s0
define i32 @testmuws(float %a) {
entry:
- %call = call float @floorf(float %a) nounwind readnone
+ %call = call float @llvm.floor.f32(float %a) nounwind readnone
%conv = fptoui float %call to i32
ret i32 %conv
}
@@ -55,7 +55,7 @@ entry:
; CHECK-NOT: frintx {{s[0-9]+}}, s0
define i64 @testmuxs(float %a) {
entry:
- %call = call float @floorf(float %a) nounwind readnone
+ %call = call float @llvm.floor.f32(float %a) nounwind readnone
%conv = fptoui float %call to i64
ret i64 %conv
}
@@ -65,7 +65,7 @@ entry:
; CHECK-NOT: frintx {{d[0-9]+}}, d0
define i32 @testmuwd(double %a) {
entry:
- %call = call double @floor(double %a) nounwind readnone
+ %call = call double @llvm.floor.f64(double %a) nounwind readnone
%conv = fptoui double %call to i32
ret i32 %conv
}
@@ -75,7 +75,7 @@ entry:
; CHECK-NOT: frintx {{d[0-9]+}}, d0
define i64 @testmuxd(double %a) {
entry:
- %call = call double @floor(double %a) nounwind readnone
+ %call = call double @llvm.floor.f64(double %a) nounwind readnone
%conv = fptoui double %call to i64
ret i64 %conv
}
@@ -85,7 +85,7 @@ entry:
; CHECK-NOT: frintx {{s[0-9]+}}, s0
define i32 @testpsws(float %a) {
entry:
- %call = call float @ceilf(float %a) nounwind readnone
+ %call = call float @llvm.ceil.f32(float %a) nounwind readnone
%conv = fptosi float %call to i32
ret i32 %conv
}
@@ -95,7 +95,7 @@ entry:
; CHECK-NOT: frintx {{s[0-9]+}}, s0
define i64 @testpsxs(float %a) {
entry:
- %call = call float @ceilf(float %a) nounwind readnone
+ %call = call float @llvm.ceil.f32(float %a) nounwind readnone
%conv = fptosi float %call to i64
ret i64 %conv
}
@@ -105,7 +105,7 @@ entry:
; CHECK-NOT: frintx {{d[0-9]+}}, d0
define i32 @testpswd(double %a) {
entry:
- %call = call double @ceil(double %a) nounwind readnone
+ %call = call double @llvm.ceil.f64(double %a) nounwind readnone
%conv = fptosi double %call to i32
ret i32 %conv
}
@@ -115,7 +115,7 @@ entry:
; CHECK-NOT: frintx {{d[0-9]+}}, d0
define i64 @testpsxd(double %a) {
entry:
- %call = call double @ceil(double %a) nounwind readnone
+ %call = call double @llvm.ceil.f64(double %a) nounwind readnone
%conv = fptosi double %call to i64
ret i64 %conv
}
@@ -125,7 +125,7 @@ entry:
; CHECK-NOT: frintx {{s[0-9]+}}, s0
define i32 @testpuws(float %a) {
entry:
- %call = call float @ceilf(float %a) nounwind readnone
+ %call = call float @llvm.ceil.f32(float %a) nounwind readnone
%conv = fptoui float %call to i32
ret i32 %conv
}
@@ -135,7 +135,7 @@ entry:
; CHECK-NOT: frintx {{s[0-9]+}}, s0
define i64 @testpuxs(float %a) {
entry:
- %call = call float @ceilf(float %a) nounwind readnone
+ %call = call float @llvm.ceil.f32(float %a) nounwind readnone
%conv = fptoui float %call to i64
ret i64 %conv
}
@@ -145,7 +145,7 @@ entry:
; CHECK-NOT: frintx {{d[0-9]+}}, d0
define i32 @testpuwd(double %a) {
entry:
- %call = call double @ceil(double %a) nounwind readnone
+ %call = call double @llvm.ceil.f64(double %a) nounwind readnone
%conv = fptoui double %call to i32
ret i32 %conv
}
@@ -155,7 +155,7 @@ entry:
; CHECK-NOT: frintx {{d[0-9]+}}, d0
define i64 @testpuxd(double %a) {
entry:
- %call = call double @ceil(double %a) nounwind readnone
+ %call = call double @llvm.ceil.f64(double %a) nounwind readnone
%conv = fptoui double %call to i64
ret i64 %conv
}
@@ -165,7 +165,7 @@ entry:
; CHECK-NOT: frintx {{s[0-9]+}}, s0
define i32 @testzsws(float %a) {
entry:
- %call = call float @truncf(float %a) nounwind readnone
+ %call = call float @llvm.trunc.f32(float %a) nounwind readnone
%conv = fptosi float %call to i32
ret i32 %conv
}
@@ -175,7 +175,7 @@ entry:
; CHECK-NOT: frintx {{s[0-9]+}}, s0
define i64 @testzsxs(float %a) {
entry:
- %call = call float @truncf(float %a) nounwind readnone
+ %call = call float @llvm.trunc.f32(float %a) nounwind readnone
%conv = fptosi float %call to i64
ret i64 %conv
}
@@ -185,7 +185,7 @@ entry:
; CHECK-NOT: frintx {{d[0-9]+}}, d0
define i32 @testzswd(double %a) {
entry:
- %call = call double @trunc(double %a) nounwind readnone
+ %call = call double @llvm.trunc.f64(double %a) nounwind readnone
%conv = fptosi double %call to i32
ret i32 %conv
}
@@ -195,7 +195,7 @@ entry:
; CHECK-NOT: frintx {{d[0-9]+}}, d0
define i64 @testzsxd(double %a) {
entry:
- %call = call double @trunc(double %a) nounwind readnone
+ %call = call double @llvm.trunc.f64(double %a) nounwind readnone
%conv = fptosi double %call to i64
ret i64 %conv
}
@@ -205,7 +205,7 @@ entry:
; CHECK-NOT: frintx {{s[0-9]+}}, s0
define i32 @testzuws(float %a) {
entry:
- %call = call float @truncf(float %a) nounwind readnone
+ %call = call float @llvm.trunc.f32(float %a) nounwind readnone
%conv = fptoui float %call to i32
ret i32 %conv
}
@@ -215,7 +215,7 @@ entry:
; CHECK-NOT: frintx {{s[0-9]+}}, s0
define i64 @testzuxs(float %a) {
entry:
- %call = call float @truncf(float %a) nounwind readnone
+ %call = call float @llvm.trunc.f32(float %a) nounwind readnone
%conv = fptoui float %call to i64
ret i64 %conv
}
@@ -225,7 +225,7 @@ entry:
; CHECK-NOT: frintx {{d[0-9]+}}, d0
define i32 @testzuwd(double %a) {
entry:
- %call = call double @trunc(double %a) nounwind readnone
+ %call = call double @llvm.trunc.f64(double %a) nounwind readnone
%conv = fptoui double %call to i32
ret i32 %conv
}
@@ -235,7 +235,7 @@ entry:
; CHECK-NOT: frintx {{d[0-9]+}}, d0
define i64 @testzuxd(double %a) {
entry:
- %call = call double @trunc(double %a) nounwind readnone
+ %call = call double @llvm.trunc.f64(double %a) nounwind readnone
%conv = fptoui double %call to i64
ret i64 %conv
}
@@ -245,7 +245,7 @@ entry:
; CHECK-NOT: frintx {{s[0-9]+}}, s0
define i32 @testasws(float %a) {
entry:
- %call = call float @roundf(float %a) nounwind readnone
+ %call = call float @llvm.round.f32(float %a) nounwind readnone
%conv = fptosi float %call to i32
ret i32 %conv
}
@@ -255,7 +255,7 @@ entry:
; CHECK-NOT: frintx {{s[0-9]+}}, s0
define i64 @testasxs(float %a) {
entry:
- %call = call float @roundf(float %a) nounwind readnone
+ %call = call float @llvm.round.f32(float %a) nounwind readnone
%conv = fptosi float %call to i64
ret i64 %conv
}
@@ -265,7 +265,7 @@ entry:
; CHECK-NOT: frintx {{d[0-9]+}}, d0
define i32 @testaswd(double %a) {
entry:
- %call = call double @round(double %a) nounwind readnone
+ %call = call double @llvm.round.f64(double %a) nounwind readnone
%conv = fptosi double %call to i32
ret i32 %conv
}
@@ -275,7 +275,7 @@ entry:
; CHECK-NOT: frintx {{d[0-9]+}}, d0
define i64 @testasxd(double %a) {
entry:
- %call = call double @round(double %a) nounwind readnone
+ %call = call double @llvm.round.f64(double %a) nounwind readnone
%conv = fptosi double %call to i64
ret i64 %conv
}
@@ -285,7 +285,7 @@ entry:
; CHECK-NOT: frintx {{s[0-9]+}}, s0
define i32 @testauws(float %a) {
entry:
- %call = call float @roundf(float %a) nounwind readnone
+ %call = call float @llvm.round.f32(float %a) nounwind readnone
%conv = fptoui float %call to i32
ret i32 %conv
}
@@ -295,7 +295,7 @@ entry:
; CHECK-NOT: frintx {{s[0-9]+}}, s0
define i64 @testauxs(float %a) {
entry:
- %call = call float @roundf(float %a) nounwind readnone
+ %call = call float @llvm.round.f32(float %a) nounwind readnone
%conv = fptoui float %call to i64
ret i64 %conv
}
@@ -305,7 +305,7 @@ entry:
; CHECK-NOT: frintx {{d[0-9]+}}, d0
define i32 @testauwd(double %a) {
entry:
- %call = call double @round(double %a) nounwind readnone
+ %call = call double @llvm.round.f64(double %a) nounwind readnone
%conv = fptoui double %call to i32
ret i32 %conv
}
@@ -315,16 +315,7 @@ entry:
; CHECK-NOT: frintx {{d[0-9]+}}, d0
define i64 @testauxd(double %a) {
entry:
- %call = call double @round(double %a) nounwind readnone
+ %call = call double @llvm.round.f64(double %a) nounwind readnone
%co...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/171288
More information about the llvm-commits
mailing list