[all-commits] [llvm/llvm-project] 2d697f: [OpenMP] Restore loop variable values after loop-t...

Zahira Ammarguellat via All-commits all-commits at lists.llvm.org
Thu Jul 30 07:08:09 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2d697f8562d7845d5554cc1d2cd2264401b9d68f
      https://github.com/llvm/llvm-project/commit/2d697f8562d7845d5554cc1d2cd2264401b9d68f
  Author: Zahira Ammarguellat <zahira.ammarguellat at intel.com>
  Date:   2026-07-30 (Thu, 30 Jul 2026)

  Changed paths:
    M clang/include/clang/AST/StmtOpenMP.h
    M clang/lib/AST/StmtOpenMP.cpp
    M clang/lib/CodeGen/CGStmtOpenMP.cpp
    M clang/lib/Sema/SemaOpenMP.cpp
    M clang/test/OpenMP/fuse_codegen.cpp
    M clang/test/OpenMP/interchange_codegen.cpp
    A clang/test/OpenMP/loop_transform_final_iv.c
    M clang/test/OpenMP/reverse_codegen.cpp
    M clang/test/OpenMP/stripe_codegen.cpp
    M clang/test/OpenMP/tile_codegen.cpp

  Log Message:
  -----------
  [OpenMP] Restore loop variable values after loop-transformation constructs. (#212853)

This PR relands #208533 which was reverted in #212832 due to test
failures with iterator-based loops.

Original Change:
#208533 fixes loop variable finalization for OpenMP 6.0
loop-transformations constructs: tile, stripe, reverse, interchange and
fuse to comply with spec requirement page 371, lines 19-21. The spec
requires that "After the execution of the loop-transforming construct,
the loop-iteration variables of any of its transformation-affected loops
have the values that they would have without the loop-transforming
directive".

What's Fixed in This Reland:
The original implementation attempted to finalize all loop variables,
including iterators in range-based for loops (CXXForRangeStmt). This
caused issues because the finalization formula `final_value =
lower_bound + num_iterations * step` only applies to arithmetic types
(integers, floats).



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