[clang] 916e2ca - Revert "[FPEnv][Clang][Driver] Disable constrained floating point on targets lacking support."
Kevin P. Neal via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 6 12:00:30 PDT 2020
Author: Kevin P. Neal
Date: 2020-07-06T14:57:45-04:00
New Revision: 916e2ca99785d34db73945940923a487efad32ad
URL: https://github.com/llvm/llvm-project/commit/916e2ca99785d34db73945940923a487efad32ad
DIFF: https://github.com/llvm/llvm-project/commit/916e2ca99785d34db73945940923a487efad32ad.diff
LOG: Revert "[FPEnv][Clang][Driver] Disable constrained floating point on targets lacking support."
My mistake, I had a blocking reviewer.
This reverts commit 39d2ae0afb2312a15e4d15a0855b35b4e1c49fc4.
This reverts commit bfdafa32a0fa4b2745627fe57dd253db10ac3fcf.
This reverts commit 2b35511350454dd22997f129ee529e3fdb129ac2.
Differential Revision: https://reviews.llvm.org/D80952
Added:
Modified:
clang/include/clang/Basic/DiagnosticFrontendKinds.td
clang/include/clang/Basic/DiagnosticGroups.td
clang/include/clang/Basic/TargetInfo.h
clang/lib/Basic/TargetInfo.cpp
clang/lib/Basic/Targets/SystemZ.h
clang/lib/Basic/Targets/X86.h
clang/lib/Frontend/CompilerInstance.cpp
clang/test/CodeGen/aarch64-neon-misc-constrained.c
clang/test/CodeGen/aarch64-neon-scalar-x-indexed-elem-constrained.c
clang/test/CodeGen/aarch64-v8.2a-neon-intrinsics-constrained.c
clang/test/CodeGen/arm-neon-directed-rounding-constrained.c
clang/test/CodeGen/arm64-vrnd-constrained.c
clang/test/CodeGen/builtins-ppc-fpconstrained.c
clang/test/CodeGen/fpconstrained-cmp-double.c
clang/test/CodeGen/fpconstrained-cmp-float.c
clang/test/CodeGen/fpconstrained.c
clang/test/CodeGen/fpconstrained.cpp
Removed:
clang/test/CodeGen/fp-strictfp.cpp
################################################################################
diff --git a/clang/include/clang/Basic/DiagnosticFrontendKinds.td b/clang/include/clang/Basic/DiagnosticFrontendKinds.td
index db334a7899c4..83c13e0dbbe0 100644
--- a/clang/include/clang/Basic/DiagnosticFrontendKinds.td
+++ b/clang/include/clang/Basic/DiagnosticFrontendKinds.td
@@ -37,12 +37,6 @@ def note_fe_backend_plugin: Note<"%0">, BackendInfo;
def warn_fe_override_module : Warning<
"overriding the module target triple with %0">,
InGroup<DiagGroup<"override-module">>;
-def warn_fe_backend_unsupported_fp_rounding : Warning<
- "overriding currently unsupported rounding mode on this target">,
- InGroup<UnsupportedFPOpt>;
-def warn_fe_backend_unsupported_fp_exceptions : Warning<
- "overriding currently unsupported use of floating point exceptions "
- "on this target">, InGroup<UnsupportedFPOpt>;
def remark_fe_backend_optimization_remark : Remark<"%0">, BackendInfo,
InGroup<BackendOptimizationRemark>;
diff --git a/clang/include/clang/Basic/DiagnosticGroups.td b/clang/include/clang/Basic/DiagnosticGroups.td
index ff07608c81e4..37e0b77e79ed 100644
--- a/clang/include/clang/Basic/DiagnosticGroups.td
+++ b/clang/include/clang/Basic/DiagnosticGroups.td
@@ -107,7 +107,6 @@ def DoublePromotion : DiagGroup<"double-promotion">;
def EnumTooLarge : DiagGroup<"enum-too-large">;
def UnsupportedNan : DiagGroup<"unsupported-nan">;
def UnsupportedAbs : DiagGroup<"unsupported-abs">;
-def UnsupportedFPOpt : DiagGroup<"unsupported-floating-point-opt">;
def UnsupportedCB : DiagGroup<"unsupported-cb">;
def UnsupportedGPOpt : DiagGroup<"unsupported-gpopt">;
def UnsupportedTargetOpt : DiagGroup<"unsupported-target-opt">;
diff --git a/clang/include/clang/Basic/TargetInfo.h b/clang/include/clang/Basic/TargetInfo.h
index 2ee3b1659630..140f55ff66b1 100644
--- a/clang/include/clang/Basic/TargetInfo.h
+++ b/clang/include/clang/Basic/TargetInfo.h
@@ -192,7 +192,6 @@ class TargetInfo : public virtual TransferrableTargetInfo,
bool HasFloat128;
bool HasFloat16;
bool HasBFloat16;
- bool HasStrictFP;
unsigned char MaxAtomicPromoteWidth, MaxAtomicInlineWidth;
unsigned short SimdDefaultAlign;
@@ -578,9 +577,6 @@ class TargetInfo : public virtual TransferrableTargetInfo,
/// Determine whether the _BFloat16 type is supported on this target.
virtual bool hasBFloat16Type() const { return HasBFloat16; }
- /// Determine whether constrained floating point is supported on this target.
- virtual bool hasStrictFP() const { return HasStrictFP; }
-
/// Return the alignment that is suitable for storing any
/// object with a fundamental alignment requirement.
unsigned getSuitableAlign() const { return SuitableAlign; }
diff --git a/clang/lib/Basic/TargetInfo.cpp b/clang/lib/Basic/TargetInfo.cpp
index eccdc21d724a..7f360b715da9 100644
--- a/clang/lib/Basic/TargetInfo.cpp
+++ b/clang/lib/Basic/TargetInfo.cpp
@@ -37,7 +37,6 @@ TargetInfo::TargetInfo(const llvm::Triple &T) : TargetOpts(), Triple(T) {
HasFloat128 = false;
HasFloat16 = false;
HasBFloat16 = false;
- HasStrictFP = false;
PointerWidth = PointerAlign = 32;
BoolWidth = BoolAlign = 8;
IntWidth = IntAlign = 32;
diff --git a/clang/lib/Basic/Targets/SystemZ.h b/clang/lib/Basic/Targets/SystemZ.h
index d7869e3754a8..134b0313b86a 100644
--- a/clang/lib/Basic/Targets/SystemZ.h
+++ b/clang/lib/Basic/Targets/SystemZ.h
@@ -48,7 +48,6 @@ class LLVM_LIBRARY_VISIBILITY SystemZTargetInfo : public TargetInfo {
MinGlobalAlign = 16;
resetDataLayout("E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-a:8:16-n32:64");
MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64;
- HasStrictFP = true;
}
void getTargetDefines(const LangOptions &Opts,
diff --git a/clang/lib/Basic/Targets/X86.h b/clang/lib/Basic/Targets/X86.h
index d6c9b3fd3fe9..c33c608e27c8 100644
--- a/clang/lib/Basic/Targets/X86.h
+++ b/clang/lib/Basic/Targets/X86.h
@@ -138,7 +138,6 @@ class LLVM_LIBRARY_VISIBILITY X86TargetInfo : public TargetInfo {
: TargetInfo(Triple) {
LongDoubleFormat = &llvm::APFloat::x87DoubleExtended();
AddrSpaceMap = &X86AddrSpaceMap;
- HasStrictFP = true;
}
const char *getLongDoubleMangling() const override {
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index 189a030eb7f6..9dc9c42297ed 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -933,19 +933,6 @@ bool CompilerInstance::ExecuteAction(FrontendAction &Act) {
setAuxTarget(TargetInfo::CreateTargetInfo(getDiagnostics(), TO));
}
- if (!getTarget().hasStrictFP()) {
- if (getLangOpts().getFPRoundingMode() !=
- llvm::RoundingMode::NearestTiesToEven) {
- getDiagnostics().Report(diag::warn_fe_backend_unsupported_fp_rounding);
- getLangOpts().setFPRoundingMode(llvm::RoundingMode::NearestTiesToEven);
- }
- if (getLangOpts().getFPExceptionMode() != LangOptions::FPE_Ignore) {
- getDiagnostics().Report(diag::warn_fe_backend_unsupported_fp_exceptions);
- getLangOpts().setFPExceptionMode(LangOptions::FPE_Ignore);
- }
- // FIXME: can we disable FEnvAccess?
- }
-
// Inform the target of the language options.
//
// FIXME: We shouldn't need to do this, the target should be immutable once
diff --git a/clang/test/CodeGen/aarch64-neon-misc-constrained.c b/clang/test/CodeGen/aarch64-neon-misc-constrained.c
index db4474efd115..0385358291c9 100644
--- a/clang/test/CodeGen/aarch64-neon-misc-constrained.c
+++ b/clang/test/CodeGen/aarch64-neon-misc-constrained.c
@@ -15,9 +15,6 @@
// REQUIRES: aarch64-registered-target
-// Disabled until constrained floating point is implemented for arm64.
-// XFAIL: *
-
// Test new aarch64 intrinsics and types but constrained
#include <arm_neon.h>
diff --git a/clang/test/CodeGen/aarch64-neon-scalar-x-indexed-elem-constrained.c b/clang/test/CodeGen/aarch64-neon-scalar-x-indexed-elem-constrained.c
index c6fa81e894c8..cbe5627337fd 100644
--- a/clang/test/CodeGen/aarch64-neon-scalar-x-indexed-elem-constrained.c
+++ b/clang/test/CodeGen/aarch64-neon-scalar-x-indexed-elem-constrained.c
@@ -15,9 +15,6 @@
// REQUIRES: aarch64-registered-target
-// Disabled until constrained floating point is implemented for arm64.
-// XFAIL: *
-
// Test new aarch64 intrinsics and types but constrained
#include <arm_neon.h>
diff --git a/clang/test/CodeGen/aarch64-v8.2a-neon-intrinsics-constrained.c b/clang/test/CodeGen/aarch64-v8.2a-neon-intrinsics-constrained.c
index dd3e92d0fde9..6058e6f92832 100644
--- a/clang/test/CodeGen/aarch64-v8.2a-neon-intrinsics-constrained.c
+++ b/clang/test/CodeGen/aarch64-v8.2a-neon-intrinsics-constrained.c
@@ -19,9 +19,6 @@
// REQUIRES: aarch64-registered-target
-// Disabled until constrained floating point is implemented for arm64.
-// XFAIL: *
-
#include <arm_neon.h>
// COMMON-LABEL: test_vsqrt_f16
diff --git a/clang/test/CodeGen/arm-neon-directed-rounding-constrained.c b/clang/test/CodeGen/arm-neon-directed-rounding-constrained.c
index 493f7924ec14..5246993173f8 100644
--- a/clang/test/CodeGen/arm-neon-directed-rounding-constrained.c
+++ b/clang/test/CodeGen/arm-neon-directed-rounding-constrained.c
@@ -32,9 +32,6 @@
// REQUIRES: arm-registered-target,aarch64-registered-target
-// Disabled until constrained floating point is implemented for arm64.
-// XFAIL: *
-
#include <arm_neon.h>
// COMMON-LABEL: test_vrndi_f32
diff --git a/clang/test/CodeGen/arm64-vrnd-constrained.c b/clang/test/CodeGen/arm64-vrnd-constrained.c
index f46b1abfa4e3..bbded8f2c7f6 100644
--- a/clang/test/CodeGen/arm64-vrnd-constrained.c
+++ b/clang/test/CodeGen/arm64-vrnd-constrained.c
@@ -9,9 +9,6 @@
// REQUIRES: aarch64-registered-target
-// Disabled until constrained floating point is implemented for arm64.
-// XFAIL: *
-
#include <arm_neon.h>
float64x2_t rnd5(float64x2_t a) { return vrndq_f64(a); }
diff --git a/clang/test/CodeGen/builtins-ppc-fpconstrained.c b/clang/test/CodeGen/builtins-ppc-fpconstrained.c
index 1e6da685b3d2..38cdfb6aab38 100644
--- a/clang/test/CodeGen/builtins-ppc-fpconstrained.c
+++ b/clang/test/CodeGen/builtins-ppc-fpconstrained.c
@@ -12,9 +12,6 @@
// RUN: -o - %s | FileCheck --check-prefix=CHECK-ASM \
// RUN: --check-prefix=FIXME-CHECK %s
-// Disabled until constrained floating point is completed for PowerPC.
-// XFAIL: *
-
typedef __attribute__((vector_size(4 * sizeof(float)))) float vec_float;
typedef __attribute__((vector_size(2 * sizeof(double)))) double vec_double;
diff --git a/clang/test/CodeGen/fp-strictfp.cpp b/clang/test/CodeGen/fp-strictfp.cpp
deleted file mode 100644
index 1a88a545fbd3..000000000000
--- a/clang/test/CodeGen/fp-strictfp.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-// RUN: %clang_cc1 -triple mips64-linux-gnu -frounding-math -ffp-exception-behavior=strict -O2 -verify=rounding,exception -emit-llvm -o - %s | FileCheck %s
-// RUN: %clang_cc1 -triple mips64-linux-gnu -ffp-exception-behavior=strict -O2 -verify=exception -emit-llvm -o - %s | FileCheck %s
-// RUN: %clang_cc1 -triple mips64-linux-gnu -frounding-math -O2 -verify=rounding -emit-llvm -o - %s | FileCheck %s
-//
-// Verify that constrained intrinsics are not used.
-// As more targets gain support for constrained intrinsics the triple
-// in this test will need to change.
-
-// rounding-warning@* {{overriding currently unsupported rounding mode on this target}}
-// exception-warning@* {{overriding currently unsupported use of floating point exceptions on this target}}
-float fp_precise_1(float a, float b, float c) {
-// CHECK: _Z12fp_precise_1fff
-// CHECK: %[[M:.+]] = fmul float{{.*}}
-// CHECK: fadd float %[[M]], %c
- return a * b + c;
-}
-
-
diff --git a/clang/test/CodeGen/fpconstrained-cmp-double.c b/clang/test/CodeGen/fpconstrained-cmp-double.c
index 7c4d04677842..2819970a3fcf 100644
--- a/clang/test/CodeGen/fpconstrained-cmp-double.c
+++ b/clang/test/CodeGen/fpconstrained-cmp-double.c
@@ -5,9 +5,6 @@
// RUN: %clang_cc1 -frounding-math -ffp-exception-behavior=strict -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK -check-prefix=EXCEPT
// RUN: %clang_cc1 -frounding-math -ffp-exception-behavior=maytrap -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK -check-prefix=MAYTRAP
-// Disabled until constrained floating point is completed for PowerPC.
-// XFAIL: powerpc, powerpc64, powerpc64le
-
_Bool QuietEqual(double f1, double f2) {
// CHECK-LABEL: define {{.*}}i1 @QuietEqual(double %f1, double %f2)
diff --git a/clang/test/CodeGen/fpconstrained-cmp-float.c b/clang/test/CodeGen/fpconstrained-cmp-float.c
index 964725080a7e..0265fc54c02b 100644
--- a/clang/test/CodeGen/fpconstrained-cmp-float.c
+++ b/clang/test/CodeGen/fpconstrained-cmp-float.c
@@ -5,9 +5,6 @@
// RUN: %clang_cc1 -frounding-math -ffp-exception-behavior=strict -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK -check-prefix=EXCEPT
// RUN: %clang_cc1 -frounding-math -ffp-exception-behavior=maytrap -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK -check-prefix=MAYTRAP
-// Disabled until constrained floating point is completed for PowerPC.
-// XFAIL: powerpc, powerpc64, powerpc64le
-
_Bool QuietEqual(float f1, float f2) {
// CHECK-LABEL: define {{.*}}i1 @QuietEqual(float %f1, float %f2)
diff --git a/clang/test/CodeGen/fpconstrained.c b/clang/test/CodeGen/fpconstrained.c
index 3ce9b6fa1a55..902d6b5baf49 100644
--- a/clang/test/CodeGen/fpconstrained.c
+++ b/clang/test/CodeGen/fpconstrained.c
@@ -5,10 +5,6 @@
// RUN: %clang_cc1 -ffast-math -ffp-contract=fast -ffp-exception-behavior=ignore -emit-llvm -o - %s | FileCheck %s -check-prefix=FAST
// RUN: %clang_cc1 -ffast-math -ffp-contract=fast -ffp-exception-behavior=strict -emit-llvm -o - %s | FileCheck %s -check-prefix=EXCEPT
// RUN: %clang_cc1 -ffast-math -ffp-contract=fast -ffp-exception-behavior=maytrap -emit-llvm -o - %s | FileCheck %s -check-prefix=MAYTRAP
-
-// Disabled until constrained floating point is completed for PowerPC.
-// XFAIL: powerpc, powerpc64, powerpc664le
-
float f0, f1, f2;
void foo() {
diff --git a/clang/test/CodeGen/fpconstrained.cpp b/clang/test/CodeGen/fpconstrained.cpp
index 39634dd96994..e914abcc6926 100644
--- a/clang/test/CodeGen/fpconstrained.cpp
+++ b/clang/test/CodeGen/fpconstrained.cpp
@@ -5,10 +5,6 @@
// RUN: %clang_cc1 -x c++ -ffast-math -fexceptions -fcxx-exceptions -ffp-contract=fast -ffp-exception-behavior=ignore -emit-llvm -o - %s | FileCheck %s -check-prefix=FAST
// RUN: %clang_cc1 -x c++ -ffast-math -fexceptions -fcxx-exceptions -ffp-contract=fast -ffp-exception-behavior=strict -emit-llvm -o - %s | FileCheck %s -check-prefix=EXCEPT
// RUN: %clang_cc1 -x c++ -ffast-math -fexceptions -fcxx-exceptions -ffp-contract=fast -ffp-exception-behavior=maytrap -emit-llvm -o - %s | FileCheck %s -check-prefix=MAYTRAP
-
-// Disabled until constrained floating point is completed for PowerPC.
-// XFAIL: powerpc, powerpc64, powerpc64le
-
float f0, f1, f2;
template <class>
More information about the cfe-commits
mailing list