Skip to content

Commit

Permalink
Revert "[compiler-rt][nsan] Add support for nan detection" (#105909)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalybuka authored and 5chmidti committed Aug 24, 2024
1 parent 231ef2c commit 4fa82d4
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 166 deletions.
26 changes: 0 additions & 26 deletions compiler-rt/lib/nsan/nsan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,32 +445,6 @@ int32_t checkFT(const FT value, ShadowFT Shadow, CheckTypeT CheckType,
const InternalFT check_value = value;
const InternalFT check_shadow = Shadow;

// We only check for NaNs in the value, not the shadow.
if (flags().check_nan && isnan(check_value)) {
GET_CALLER_PC_BP;
BufferedStackTrace stack;
stack.Unwind(pc, bp, nullptr, false);
if (GetSuppressionForStack(&stack, CheckKind::Consistency)) {
// FIXME: optionally print.
return flags().resume_after_suppression ? kResumeFromValue
: kContinueWithShadow;
}
Decorator D;
Printf("%s", D.Warning());
Printf("WARNING: NumericalStabilitySanitizer: NaN detected\n");
Printf("%s", D.Default());
stack.Print();
if (flags().halt_on_error) {
if (common_flags()->abort_on_error)
Printf("ABORTING\n");
else
Printf("Exiting\n");
Die();
}
// Performing other tests for NaN values is meaningless when dealing with numbers.
return kResumeFromValue;
}

// See this article for an interesting discussion of how to compare floats:
// https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
static constexpr const FT Eps = FTInfo<FT>::kEpsilon;
Expand Down
2 changes: 0 additions & 2 deletions compiler-rt/lib/nsan/nsan_flags.inc
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,3 @@ NSAN_FLAG(bool, enable_loadtracking_stats, false,
"due to invalid or unknown types.")
NSAN_FLAG(bool, poison_in_free, true, "")
NSAN_FLAG(bool, print_stats_on_exit, false, "If true, print stats on exit.")
NSAN_FLAG(bool, check_nan, false,
"If true, check the floating-point number is nan")
25 changes: 0 additions & 25 deletions compiler-rt/test/nsan/nan.cpp

This file was deleted.

54 changes: 0 additions & 54 deletions compiler-rt/test/nsan/softmax.cpp

This file was deleted.

34 changes: 0 additions & 34 deletions compiler-rt/test/nsan/vec_sqrt.cpp

This file was deleted.

25 changes: 0 additions & 25 deletions compiler-rt/test/nsan/vec_sqrt_ext.cpp

This file was deleted.

0 comments on commit 4fa82d4

Please sign in to comment.