Skip to content

Commit 1f89cd4

Browse files
authored
Revert "[compiler-rt][nsan] Add support for nan detection" (#105909)
Reverts #101531 Fails https://lab.llvm.org/buildbot/#/builders/66/builds/3051
1 parent dbd7ce0 commit 1f89cd4

File tree

6 files changed

+0
-166
lines changed

6 files changed

+0
-166
lines changed

compiler-rt/lib/nsan/nsan.cpp

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -445,32 +445,6 @@ int32_t checkFT(const FT value, ShadowFT Shadow, CheckTypeT CheckType,
445445
const InternalFT check_value = value;
446446
const InternalFT check_shadow = Shadow;
447447

448-
// We only check for NaNs in the value, not the shadow.
449-
if (flags().check_nan && isnan(check_value)) {
450-
GET_CALLER_PC_BP;
451-
BufferedStackTrace stack;
452-
stack.Unwind(pc, bp, nullptr, false);
453-
if (GetSuppressionForStack(&stack, CheckKind::Consistency)) {
454-
// FIXME: optionally print.
455-
return flags().resume_after_suppression ? kResumeFromValue
456-
: kContinueWithShadow;
457-
}
458-
Decorator D;
459-
Printf("%s", D.Warning());
460-
Printf("WARNING: NumericalStabilitySanitizer: NaN detected\n");
461-
Printf("%s", D.Default());
462-
stack.Print();
463-
if (flags().halt_on_error) {
464-
if (common_flags()->abort_on_error)
465-
Printf("ABORTING\n");
466-
else
467-
Printf("Exiting\n");
468-
Die();
469-
}
470-
// Performing other tests for NaN values is meaningless when dealing with numbers.
471-
return kResumeFromValue;
472-
}
473-
474448
// See this article for an interesting discussion of how to compare floats:
475449
// https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
476450
static constexpr const FT Eps = FTInfo<FT>::kEpsilon;

compiler-rt/lib/nsan/nsan_flags.inc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,3 @@ NSAN_FLAG(bool, enable_loadtracking_stats, false,
4848
"due to invalid or unknown types.")
4949
NSAN_FLAG(bool, poison_in_free, true, "")
5050
NSAN_FLAG(bool, print_stats_on_exit, false, "If true, print stats on exit.")
51-
NSAN_FLAG(bool, check_nan, false,
52-
"If true, check the floating-point number is nan")

compiler-rt/test/nsan/nan.cpp

Lines changed: 0 additions & 25 deletions
This file was deleted.

compiler-rt/test/nsan/softmax.cpp

Lines changed: 0 additions & 54 deletions
This file was deleted.

compiler-rt/test/nsan/vec_sqrt.cpp

Lines changed: 0 additions & 34 deletions
This file was deleted.

compiler-rt/test/nsan/vec_sqrt_ext.cpp

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)