-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[clang] Add flag fallow-runtime-check-skip-hot-cutoff #145999
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2668,6 +2668,15 @@ def fsanitize_skip_hot_cutoff_EQ | |
|
|
||
| } // end -f[no-]sanitize* flags | ||
|
|
||
| def fallow_runtime_check_skip_hot_cutoff_EQ | ||
| : Joined<["-"], "fallow-runtime-check-skip-hot-cutoff=">, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it be more user-friendly (and possibly less code duplication) to add "allow_runtime_check" as one of the options for the existing
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not really about sanitizers though. Also if we want to teach this flag about kind=blah, that would become very messy. |
||
| Group<f_clang_Group>, | ||
| Visibility<[ClangOption, CC1Option]>, | ||
| HelpText<"Exclude __builtin_allow_runtime_check for the top hottest " | ||
| "code responsible for the given fraction of PGO counters " | ||
| "(0.0 [default] = skip none; 1.0 = skip all). " | ||
| "Argument format: <value>">; | ||
|
|
||
| def funsafe_math_optimizations : Flag<["-"], "funsafe-math-optimizations">, | ||
| Group<f_Group>, Visibility<[ClangOption, CC1Option]>, | ||
| HelpText<"Allow unsafe floating-point math optimizations which may decrease precision">, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| // RUN: %clang -fallow-runtime-check-skip-hot-cutoff=1.0 -S -emit-llvm %s -o - -O2 | FileCheck --check-prefix=ONE %s | ||
| // RUN: %clang -fallow-runtime-check-skip-hot-cutoff=0.0 -S -emit-llvm %s -o - -O2 | FileCheck --check-prefix=ZERO %s | ||
| // RUN: not %clang -fallow-runtime-check-skip-hot-cutoff=6.0 -S -emit-llvm %s -o - -O2 2>&1 | FileCheck --check-prefix=SIX %s | ||
| // RUN: not %clang -fallow-runtime-check-skip-hot-cutoff=-1.0 -S -emit-llvm %s -o - -O2 2>&1 | FileCheck --check-prefix=MINUSONE %s | ||
| // RUN: not %clang -fallow-runtime-check-skip-hot-cutoff=string -S -emit-llvm %s -o - -O2 2>&1 | FileCheck --check-prefix=STRING %s | ||
|
|
||
| // ONE: ret i32 0 | ||
| // ZERO: ret i32 1 | ||
| // SIX: invalid value '6.0' in '-fallow-runtime-check-skip-hot-cutoff=' | ||
| // MINUSONE: invalid value '-1.0' in '-fallow-runtime-check-skip-hot-cutoff=' | ||
| // STRING: invalid value 'string' in '-fallow-runtime-check-skip-hot-cutoff=' | ||
|
|
||
| int main(int argc, char** argv) { | ||
| return __builtin_allow_runtime_check("foo"); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| // RUN: %clang -### -fallow-runtime-check-skip-hot-cutoff=1.0 %s 2>&1 | FileCheck %s | ||
| // CHECK: -fallow-runtime-check-skip-hot-cutoff=1.0 | ||
|
|
||
| int main(int argc, char** argv) { | ||
| return __builtin_allow_runtime_check("foo"); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"fallow" is either unfortunate or brilliant naming, similar to fun safe math. (I'm looking forward to the "fallow_fields" flag.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks?