[all-commits] [llvm/llvm-project] 16b75c: [mlir][OpenMP] implement SIMD reduction (#146671)
Tom Eccles via All-commits
all-commits at lists.llvm.org
Wed Jul 2 08:49:55 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 16b75c819dde5670f3b086f3c664e6b9e75cb40b
https://github.com/llvm/llvm-project/commit/16b75c819dde5670f3b086f3c664e6b9e75cb40b
Author: Tom Eccles <tom.eccles at arm.com>
Date: 2025-07-02 (Wed, 02 Jul 2025)
Changed paths:
M mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
A mlir/test/Target/LLVMIR/openmp-simd-reduction-byref.mlir
A mlir/test/Target/LLVMIR/openmp-simd-reduction-simple.mlir
M mlir/test/Target/LLVMIR/openmp-todo.mlir
Log Message:
-----------
[mlir][OpenMP] implement SIMD reduction (#146671)
This replicates clang's implementation. Basically:
- A private copy of the reduction variable is created, initialized to
the reduction neutral value (using regions from the reduction
declaration op).
- The body of the loop is lowered as usual, with accesses to the
reduction variable mapped to the private copy.
- After the loop, we inline the reduction region from the declaration op
to combine the privatized variable into the original variable.
- As usual with the SIMD construct, attributes are added to encourage
vectorization of the loop and to assert that memory accesses in the loop
don't alias across iterations.
I have verified that simple scalar examples do vectorize at -O3 and the
tests I could find in the Fujitsu test suite produce correct results. I
tested on top of #146097 and this seemed to work for composite
constructs as well.
Fixes #144290
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list