alamb commented on code in PR #6554: URL: https://github.com/apache/arrow-rs/pull/6554#discussion_r1803041762
########## arrow/CONTRIBUTING.md: ########## @@ -109,6 +109,36 @@ specific JIRA issues and reference them in these code comments. For example: // This is not sound because .... see https://issues.apache.org/jira/browse/ARROW-nnnnn ``` +### Usage if SIMD / Auto vectorization + +This create does not use SIMD intrinsics (e.g. [`std::simd`] directly, but +instead relies on LLVM's auto-vectorization. + +SIMD intrinsics are difficult to maintain and can be difficult to reason about. +The auto-vectorizer in LLVM is quite good and often produces better code than +hand-written manual uses of SIMD. In fact, this crate used to to have a fair +amount of manual SIMD, and over time we've removed it as the auto-vectorized +code was faster. + +[`std::simd`]: https://doc.rust-lang.org/std/simd/index.html + +LLVM is relatively good at vectorizing vertical operations provided: + +1. No conditionals within the loop body +2. Not too much inlining , as the vectorizer gives up if the code is too complex Review Comment: 🤔 How about "not too much inlining (judicious use of `#[inline]` and `#[inline(never)]` as the vectorizer gives up if the code is too complex) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
