[llvm] 677b5ac - ValueTracking: Add more tests for trunc handling in computeKnownFPClass
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 19 17:11:44 PDT 2023
Author: Matt Arsenault
Date: 2023-04-19T20:11:31-04:00
New Revision: 677b5aca8e840361ea5f9ebbaa729c1e9ac8da49
URL: https://github.com/llvm/llvm-project/commit/677b5aca8e840361ea5f9ebbaa729c1e9ac8da49
DIFF: https://github.com/llvm/llvm-project/commit/677b5aca8e840361ea5f9ebbaa729c1e9ac8da49.diff
LOG: ValueTracking: Add more tests for trunc handling in computeKnownFPClass
Added:
Modified:
llvm/test/Transforms/Attributor/nofpclass-trunc.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/Attributor/nofpclass-trunc.ll b/llvm/test/Transforms/Attributor/nofpclass-trunc.ll
index ae5c0795eb89..eda3bdf379af 100644
--- a/llvm/test/Transforms/Attributor/nofpclass-trunc.ll
+++ b/llvm/test/Transforms/Attributor/nofpclass-trunc.ll
@@ -114,6 +114,86 @@ define float @ret_trunc_nonorm(float nofpclass(norm) %arg0) {
ret float %call
}
+define float @ret_trunc_nonnorm(float nofpclass(nnorm) %arg0) {
+; CHECK-LABEL: define nofpclass(sub) float @ret_trunc_nonnorm
+; CHECK-SAME: (float nofpclass(nnorm) [[ARG0:%.*]]) #[[ATTR1]] {
+; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(sub) float @llvm.trunc.f32(float [[ARG0]]) #[[ATTR2]]
+; CHECK-NEXT: ret float [[CALL]]
+;
+ %call = call float @llvm.trunc.f32(float %arg0)
+ ret float %call
+}
+
+define float @ret_trunc_nopnorm(float nofpclass(pnorm) %arg0) {
+; CHECK-LABEL: define nofpclass(sub) float @ret_trunc_nopnorm
+; CHECK-SAME: (float nofpclass(pnorm) [[ARG0:%.*]]) #[[ATTR1]] {
+; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(sub) float @llvm.trunc.f32(float [[ARG0]]) #[[ATTR2]]
+; CHECK-NEXT: ret float [[CALL]]
+;
+ %call = call float @llvm.trunc.f32(float %arg0)
+ ret float %call
+}
+
+define float @ret_trunc_nonsub(float nofpclass(nsub) %arg0) {
+; CHECK-LABEL: define nofpclass(sub) float @ret_trunc_nonsub
+; CHECK-SAME: (float nofpclass(nsub) [[ARG0:%.*]]) #[[ATTR1]] {
+; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(sub) float @llvm.trunc.f32(float [[ARG0]]) #[[ATTR2]]
+; CHECK-NEXT: ret float [[CALL]]
+;
+ %call = call float @llvm.trunc.f32(float %arg0)
+ ret float %call
+}
+
+define float @ret_trunc_nopsub(float nofpclass(psub) %arg0) {
+; CHECK-LABEL: define nofpclass(sub) float @ret_trunc_nopsub
+; CHECK-SAME: (float nofpclass(psub) [[ARG0:%.*]]) #[[ATTR1]] {
+; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(sub) float @llvm.trunc.f32(float [[ARG0]]) #[[ATTR2]]
+; CHECK-NEXT: ret float [[CALL]]
+;
+ %call = call float @llvm.trunc.f32(float %arg0)
+ ret float %call
+}
+
+define float @ret_trunc_nonorm_nosub(float nofpclass(norm sub) %arg0) {
+; CHECK-LABEL: define nofpclass(sub) float @ret_trunc_nonorm_nosub
+; CHECK-SAME: (float nofpclass(sub norm) [[ARG0:%.*]]) #[[ATTR1]] {
+; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(sub) float @llvm.trunc.f32(float [[ARG0]]) #[[ATTR2]]
+; CHECK-NEXT: ret float [[CALL]]
+;
+ %call = call float @llvm.trunc.f32(float %arg0)
+ ret float %call
+}
+
+define float @ret_trunc_nopnorm_nopsub(float nofpclass(pnorm psub) %arg0) {
+; CHECK-LABEL: define nofpclass(sub) float @ret_trunc_nopnorm_nopsub
+; CHECK-SAME: (float nofpclass(psub pnorm) [[ARG0:%.*]]) #[[ATTR1]] {
+; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(sub) float @llvm.trunc.f32(float [[ARG0]]) #[[ATTR2]]
+; CHECK-NEXT: ret float [[CALL]]
+;
+ %call = call float @llvm.trunc.f32(float %arg0)
+ ret float %call
+}
+
+define float @ret_trunc_nonnorm_nonsub(float nofpclass(nnorm nsub) %arg0) {
+; CHECK-LABEL: define nofpclass(sub) float @ret_trunc_nonnorm_nonsub
+; CHECK-SAME: (float nofpclass(nsub nnorm) [[ARG0:%.*]]) #[[ATTR1]] {
+; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(sub) float @llvm.trunc.f32(float [[ARG0]]) #[[ATTR2]]
+; CHECK-NEXT: ret float [[CALL]]
+;
+ %call = call float @llvm.trunc.f32(float %arg0)
+ ret float %call
+}
+
+define float @ret_trunc_nopnorm_nonsub(float nofpclass(pnorm nsub) %arg0) {
+; CHECK-LABEL: define nofpclass(sub) float @ret_trunc_nopnorm_nonsub
+; CHECK-SAME: (float nofpclass(nsub pnorm) [[ARG0:%.*]]) #[[ATTR1]] {
+; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(sub) float @llvm.trunc.f32(float [[ARG0]]) #[[ATTR2]]
+; CHECK-NEXT: ret float [[CALL]]
+;
+ %call = call float @llvm.trunc.f32(float %arg0)
+ ret float %call
+}
+
define ppc_fp128 @ret_trunc_ppcf128(ppc_fp128 %arg0) {
; CHECK-LABEL: define nofpclass(sub) ppc_fp128 @ret_trunc_ppcf128
; CHECK-SAME: (ppc_fp128 [[ARG0:%.*]]) #[[ATTR1]] {
More information about the llvm-commits
mailing list