Repository navigation
cgen: Add portable SIMD-aware lowering for hot loops - #1280
Conversation
This updates the C code generator to emit `#pragma omp simd` for stepped loops with straight-line bodies when `_OPENMP` is defined, providing a portable compiler-independent SIMD vectorization hint before falling back to the clang or GCC specific `#pragma clang loop vectorize` or `#pragma GCC ivdep`. The golden tests `for_vectorize_pragma` and `for_vectorize_pragma_skip` were updated to reflect the new output. Bootstrap C has been regenerated and verified. Part of #739 Co-authored-by: godofecht <[email protected]>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Adds
#pragma omp simdas a portable SIMD vectorization hint for hot loops with straight-line bodies on the C backend.This PR targets the C generation step, wrapping the vectorization pragmas under conditional compilation macros (
#if defined(_OPENMP),#elif defined(__clang__), etc.) to generate portable code that can take advantage of#pragma omp simdacross compilers while still falling back toclang loop vectorize(enable)orGCC ivdepdepending on the environment. Golden tests were updated accordingly.Part of #739
PR created automatically by Jules for task 11619965655346489604 started by @godofecht