Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "[compiler-rt][nsan] Add support for nan detection" #105909

Merged
merged 1 commit into from
Aug 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading