-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[C++] Introduce portable compiler assumptions #41020
Comments
felipecrv
added a commit
that referenced
this issue
Apr 9, 2024
### Rationale for this change Allow portable use of the "assumption" feature of modern GCC, Clang, and MSVC compilers. ### What changes are included in this PR? - Documenting of macros in `macros.h` - Addition of `ARROW_COMPILER_ASSUME` - One simple change where this macro simplifies the existing code while keeping the common case of a loop branch dependent only on local variables ### Are these changes tested? By existing tests. * GitHub Issue: #41020 Authored-by: Felipe Oliveira Carvalho <felipekde@gmail.com> Signed-off-by: Felipe Oliveira Carvalho <felipekde@gmail.com>
Issue resolved by pull request 41021 |
verma-kartik
pushed a commit
to verma-kartik/arrow
that referenced
this issue
Apr 11, 2024
…#41021) ### Rationale for this change Allow portable use of the "assumption" feature of modern GCC, Clang, and MSVC compilers. ### What changes are included in this PR? - Documenting of macros in `macros.h` - Addition of `ARROW_COMPILER_ASSUME` - One simple change where this macro simplifies the existing code while keeping the common case of a loop branch dependent only on local variables ### Are these changes tested? By existing tests. * GitHub Issue: apache#41020 Authored-by: Felipe Oliveira Carvalho <felipekde@gmail.com> Signed-off-by: Felipe Oliveira Carvalho <felipekde@gmail.com>
vibhatha
pushed a commit
to vibhatha/arrow
that referenced
this issue
Apr 15, 2024
…#41021) ### Rationale for this change Allow portable use of the "assumption" feature of modern GCC, Clang, and MSVC compilers. ### What changes are included in this PR? - Documenting of macros in `macros.h` - Addition of `ARROW_COMPILER_ASSUME` - One simple change where this macro simplifies the existing code while keeping the common case of a loop branch dependent only on local variables ### Are these changes tested? By existing tests. * GitHub Issue: apache#41020 Authored-by: Felipe Oliveira Carvalho <felipekde@gmail.com> Signed-off-by: Felipe Oliveira Carvalho <felipekde@gmail.com>
tolleybot
pushed a commit
to tmct/arrow
that referenced
this issue
May 2, 2024
…#41021) ### Rationale for this change Allow portable use of the "assumption" feature of modern GCC, Clang, and MSVC compilers. ### What changes are included in this PR? - Documenting of macros in `macros.h` - Addition of `ARROW_COMPILER_ASSUME` - One simple change where this macro simplifies the existing code while keeping the common case of a loop branch dependent only on local variables ### Are these changes tested? By existing tests. * GitHub Issue: apache#41020 Authored-by: Felipe Oliveira Carvalho <felipekde@gmail.com> Signed-off-by: Felipe Oliveira Carvalho <felipekde@gmail.com>
tolleybot
pushed a commit
to tmct/arrow
that referenced
this issue
May 4, 2024
…#41021) ### Rationale for this change Allow portable use of the "assumption" feature of modern GCC, Clang, and MSVC compilers. ### What changes are included in this PR? - Documenting of macros in `macros.h` - Addition of `ARROW_COMPILER_ASSUME` - One simple change where this macro simplifies the existing code while keeping the common case of a loop branch dependent only on local variables ### Are these changes tested? By existing tests. * GitHub Issue: apache#41020 Authored-by: Felipe Oliveira Carvalho <felipekde@gmail.com> Signed-off-by: Felipe Oliveira Carvalho <felipekde@gmail.com>
rok
pushed a commit
to tmct/arrow
that referenced
this issue
May 8, 2024
…#41021) ### Rationale for this change Allow portable use of the "assumption" feature of modern GCC, Clang, and MSVC compilers. ### What changes are included in this PR? - Documenting of macros in `macros.h` - Addition of `ARROW_COMPILER_ASSUME` - One simple change where this macro simplifies the existing code while keeping the common case of a loop branch dependent only on local variables ### Are these changes tested? By existing tests. * GitHub Issue: apache#41020 Authored-by: Felipe Oliveira Carvalho <felipekde@gmail.com> Signed-off-by: Felipe Oliveira Carvalho <felipekde@gmail.com>
rok
pushed a commit
to tmct/arrow
that referenced
this issue
May 8, 2024
…#41021) ### Rationale for this change Allow portable use of the "assumption" feature of modern GCC, Clang, and MSVC compilers. ### What changes are included in this PR? - Documenting of macros in `macros.h` - Addition of `ARROW_COMPILER_ASSUME` - One simple change where this macro simplifies the existing code while keeping the common case of a loop branch dependent only on local variables ### Are these changes tested? By existing tests. * GitHub Issue: apache#41020 Authored-by: Felipe Oliveira Carvalho <felipekde@gmail.com> Signed-off-by: Felipe Oliveira Carvalho <felipekde@gmail.com>
vibhatha
pushed a commit
to vibhatha/arrow
that referenced
this issue
May 25, 2024
…#41021) ### Rationale for this change Allow portable use of the "assumption" feature of modern GCC, Clang, and MSVC compilers. ### What changes are included in this PR? - Documenting of macros in `macros.h` - Addition of `ARROW_COMPILER_ASSUME` - One simple change where this macro simplifies the existing code while keeping the common case of a loop branch dependent only on local variables ### Are these changes tested? By existing tests. * GitHub Issue: apache#41020 Authored-by: Felipe Oliveira Carvalho <felipekde@gmail.com> Signed-off-by: Felipe Oliveira Carvalho <felipekde@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the enhancement requested
Compiler assumptions (standardized in C++23) [1] are supported in today's compilers via macros.
When used well they can hint the optimizer in ways that can improve performance, but more importantly, reduce binary-size in compute kernel loops that have to be specialized for many different types [2]
Like other features compiler features, this could become usable via a macro in
macros.h
.[1] https://en.cppreference.com/w/cpp/language/attributes/assume
[2] While working on a refactoring of
Take
I was able to shave-off ~13Kbytes offcompute/kernels/vector_selection_take_internal.cc.o
on macOS.Component(s)
C++
The text was updated successfully, but these errors were encountered: