Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 80906ce

Browse files
committed
[OpenMP] Disable early vectorization of loads/stores in the runtime
We are having a hard time optimizing some vectorized loads/stores later on which causes this optimization to degrade performance. Differential Revision: https://reviews.llvm.org/D158656
1 parent 283998d commit 80906ce

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

openmp/libomptarget/DeviceRTL/CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,14 @@ set(src_files
109109
${source_directory}/Workshare.cpp
110110
)
111111

112-
set(clang_opt_flags -O3 -mllvm -openmp-opt-disable -DSHARED_SCRATCHPAD_SIZE=512)
113-
set(link_opt_flags -O3 -openmp-opt-disable -attributor-enable=module)
112+
# We disable the slp vectorizer during the runtime optimization to avoid
113+
# vectorized accesses to the shared state. Generally, those are "good" but
114+
# the optimizer pipeline (esp. Attributor) does not fully support vectorized
115+
# instructions yet and we end up missing out on way more important constant
116+
# propagation. That said, we will run the vectorizer again after the runtime
117+
# has been linked into the user program.
118+
set(clang_opt_flags -O3 -mllvm -openmp-opt-disable -DSHARED_SCRATCHPAD_SIZE=512 -mllvm -vectorize-slp=false )
119+
set(link_opt_flags -O3 -openmp-opt-disable -attributor-enable=module -vectorize-slp=false )
114120
set(link_export_flag -passes=internalize -internalize-public-api-file=${source_directory}/exports)
115121

116122
# Prepend -I to each list element

0 commit comments

Comments
 (0)