From 2affdc41f30f9cb77a3d659081c95468174749d9 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Sat, 8 Apr 2023 19:44:22 -0400 Subject: [PATCH] ValueTracking: Add baseline test for computeKnownFPClass for canonicalize --- .../Attributor/nofpclass-canonicalize.ll | 106 +++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 llvm/test/Transforms/Attributor/nofpclass-canonicalize.ll diff --git a/llvm/test/Transforms/Attributor/nofpclass-canonicalize.ll b/llvm/test/Transforms/Attributor/nofpclass-canonicalize.ll new file mode 100644 index 0000000..26022a8 --- /dev/null +++ b/llvm/test/Transforms/Attributor/nofpclass-canonicalize.ll @@ -0,0 +1,106 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2 +; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -S < %s | FileCheck %s --check-prefixes=CHECK,TUNIT + +declare float @llvm.canonicalize.f32(float) + +define float @ret_canonicalize(float %arg0) { +; CHECK-LABEL: define float @ret_canonicalize +; CHECK-SAME: (float [[ARG0:%.*]]) #[[ATTR1:[0-9]+]] { +; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.canonicalize.f32(float [[ARG0]]) #[[ATTR10:[0-9]+]] +; CHECK-NEXT: ret float [[CALL]] +; + %call = call float @llvm.canonicalize.f32(float %arg0) + ret float %call +} + +define float @ret_canonicalize_noinf(float nofpclass(inf) %arg0) { +; CHECK-LABEL: define float @ret_canonicalize_noinf +; CHECK-SAME: (float nofpclass(inf) [[ARG0:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.canonicalize.f32(float [[ARG0]]) #[[ATTR10]] +; CHECK-NEXT: ret float [[CALL]] +; + %call = call float @llvm.canonicalize.f32(float %arg0) + ret float %call +} + +define float @ret_canonicalize_dynamic_denormal(float nofpclass(inf) %arg0) "denormal-fp-math"="dynamic,dynamic" { +; CHECK-LABEL: define float @ret_canonicalize_dynamic_denormal +; CHECK-SAME: (float nofpclass(inf) [[ARG0:%.*]]) #[[ATTR2:[0-9]+]] { +; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.canonicalize.f32(float [[ARG0]]) #[[ATTR10]] +; CHECK-NEXT: ret float [[CALL]] +; + %call = call float @llvm.canonicalize.f32(float %arg0) + ret float %call +} + +define float @ret_canonicalize_daz_denormal(float nofpclass(inf) %arg0) "denormal-fp-math"="dynamic,preserve-sign" { +; CHECK-LABEL: define float @ret_canonicalize_daz_denormal +; CHECK-SAME: (float nofpclass(inf) [[ARG0:%.*]]) #[[ATTR3:[0-9]+]] { +; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.canonicalize.f32(float [[ARG0]]) #[[ATTR10]] +; CHECK-NEXT: ret float [[CALL]] +; + %call = call float @llvm.canonicalize.f32(float %arg0) + ret float %call +} + +define float @ret_canonicalize_dapz_denormal(float nofpclass(inf) %arg0) "denormal-fp-math"="dynamic,positive-zero" { +; CHECK-LABEL: define float @ret_canonicalize_dapz_denormal +; CHECK-SAME: (float nofpclass(inf) [[ARG0:%.*]]) #[[ATTR4:[0-9]+]] { +; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.canonicalize.f32(float [[ARG0]]) #[[ATTR10]] +; CHECK-NEXT: ret float [[CALL]] +; + %call = call float @llvm.canonicalize.f32(float %arg0) + ret float %call +} + +define float @ret_canonicalize_ftpz_dapz_denormal(float nofpclass(inf) %arg0) "denormal-fp-math"="positive-zero,preserve-sign" { +; CHECK-LABEL: define float @ret_canonicalize_ftpz_dapz_denormal +; CHECK-SAME: (float nofpclass(inf) [[ARG0:%.*]]) #[[ATTR5:[0-9]+]] { +; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.canonicalize.f32(float [[ARG0]]) #[[ATTR10]] +; CHECK-NEXT: ret float [[CALL]] +; + %call = call float @llvm.canonicalize.f32(float %arg0) + ret float %call +} + +define float @ret_canonicalize_ftpz_ieee_denormal(float nofpclass(inf) %arg0) "denormal-fp-math"="positive-zero,ieee" { +; CHECK-LABEL: define float @ret_canonicalize_ftpz_ieee_denormal +; CHECK-SAME: (float nofpclass(inf) [[ARG0:%.*]]) #[[ATTR6:[0-9]+]] { +; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.canonicalize.f32(float [[ARG0]]) #[[ATTR10]] +; CHECK-NEXT: ret float [[CALL]] +; + %call = call float @llvm.canonicalize.f32(float %arg0) + ret float %call +} + +define float @ret_canonicalize_ftpz_dynamic_denormal(float nofpclass(inf) %arg0) "denormal-fp-math"="positive-zero,dynamic" { +; CHECK-LABEL: define float @ret_canonicalize_ftpz_dynamic_denormal +; CHECK-SAME: (float nofpclass(inf) [[ARG0:%.*]]) #[[ATTR7:[0-9]+]] { +; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.canonicalize.f32(float [[ARG0]]) #[[ATTR10]] +; CHECK-NEXT: ret float [[CALL]] +; + %call = call float @llvm.canonicalize.f32(float %arg0) + ret float %call +} + +define float @ret_canonicalize_ftz_denormal(float nofpclass(inf) %arg0) "denormal-fp-math"="preserve-sign,dynamic" { +; CHECK-LABEL: define float @ret_canonicalize_ftz_denormal +; CHECK-SAME: (float nofpclass(inf) [[ARG0:%.*]]) #[[ATTR8:[0-9]+]] { +; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.canonicalize.f32(float [[ARG0]]) #[[ATTR10]] +; CHECK-NEXT: ret float [[CALL]] +; + %call = call float @llvm.canonicalize.f32(float %arg0) + ret float %call +} + +define float @ret_canonicalize_ieee_denormal(float nofpclass(inf) %arg0) "denormal-fp-math"="ieee,ieee" { +; CHECK-LABEL: define float @ret_canonicalize_ieee_denormal +; CHECK-SAME: (float nofpclass(inf) [[ARG0:%.*]]) #[[ATTR9:[0-9]+]] { +; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.canonicalize.f32(float [[ARG0]]) #[[ATTR10]] +; CHECK-NEXT: ret float [[CALL]] +; + %call = call float @llvm.canonicalize.f32(float %arg0) + ret float %call +} +;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: +; TUNIT: {{.*}} -- 2.7.4