[all-commits] [llvm/llvm-project] c443f5: [OpenMP] Preserve host capture lifetimes in fronte...

Tomas Matheson via All-commits all-commits at lists.llvm.org
Mon Sep 28 05:14:20 PDT 2026


  Branch: refs/heads/users/tommat01/dereferenceable
  Home:   https://github.com/llvm/llvm-project
  Commit: c443f515d891d92cf90ddaee6506af3c8d421580
      https://github.com/llvm/llvm-project/commit/c443f515d891d92cf90ddaee6506af3c8d421580
  Author: Tomas Matheson <tomas.matheson at arm.com>
  Date:   2026-09-28 (Mon, 28 Sep 2026)

  Changed paths:
    M clang/lib/CodeGen/CGOpenMPRuntime.cpp
    M clang/test/OpenMP/bug54082.c
    A clang/test/OpenMP/callback_capture_lifetime.cpp
    M clang/test/OpenMP/cancel_codegen.cpp
    M clang/test/OpenMP/cancellation_point_codegen.cpp
    M clang/test/OpenMP/debug-info-openmp-array.cpp
    M clang/test/OpenMP/distribute_parallel_for_firstprivate_codegen.cpp
    M clang/test/OpenMP/distribute_parallel_for_lastprivate_codegen.cpp
    M clang/test/OpenMP/distribute_parallel_for_reduction_task_codegen.cpp
    M clang/test/OpenMP/distribute_parallel_for_simd_firstprivate_codegen.cpp
    M clang/test/OpenMP/distribute_parallel_for_simd_lastprivate_codegen.cpp
    M clang/test/OpenMP/for_firstprivate_codegen.cpp
    M clang/test/OpenMP/for_lastprivate_codegen.cpp
    M clang/test/OpenMP/for_linear_codegen.cpp
    M clang/test/OpenMP/for_private_reduction_codegen.cpp
    M clang/test/OpenMP/for_reduction_codegen.cpp
    M clang/test/OpenMP/for_reduction_codegen_UDR.cpp
    M clang/test/OpenMP/for_reduction_task_codegen.cpp
    M clang/test/OpenMP/irbuilder_nested_parallel_for.c
    M clang/test/OpenMP/master_taskloop_in_reduction_codegen.cpp
    M clang/test/OpenMP/master_taskloop_simd_in_reduction_codegen.cpp
    M clang/test/OpenMP/nested_loop_codegen.cpp
    M clang/test/OpenMP/parallel_codegen.cpp
    M clang/test/OpenMP/parallel_copyin_codegen.cpp
    M clang/test/OpenMP/parallel_copyin_combined_codegen.c
    M clang/test/OpenMP/parallel_firstprivate_codegen.cpp
    M clang/test/OpenMP/parallel_for_codegen.cpp
    M clang/test/OpenMP/parallel_for_lastprivate_conditional.cpp
    M clang/test/OpenMP/parallel_for_linear_codegen.cpp
    M clang/test/OpenMP/parallel_for_reduction_task_codegen.cpp
    M clang/test/OpenMP/parallel_for_simd_aligned_codegen.cpp
    M clang/test/OpenMP/parallel_generic_loop_codegen.cpp
    M clang/test/OpenMP/parallel_master_codegen.cpp
    M clang/test/OpenMP/parallel_master_reduction_task_codegen.cpp
    M clang/test/OpenMP/parallel_master_taskloop_codegen.cpp
    M clang/test/OpenMP/parallel_master_taskloop_firstprivate_codegen.cpp
    M clang/test/OpenMP/parallel_master_taskloop_lastprivate_codegen.cpp
    M clang/test/OpenMP/parallel_master_taskloop_simd_codegen.cpp
    M clang/test/OpenMP/parallel_master_taskloop_simd_firstprivate_codegen.cpp
    M clang/test/OpenMP/parallel_master_taskloop_simd_lastprivate_codegen.cpp
    M clang/test/OpenMP/parallel_reduction_codegen.cpp
    M clang/test/OpenMP/parallel_reduction_task_codegen.cpp
    M clang/test/OpenMP/parallel_sections_reduction_task_codegen.cpp
    M clang/test/OpenMP/reduction_compound_op.cpp
    M clang/test/OpenMP/scope_codegen.cpp
    M clang/test/OpenMP/sections_firstprivate_codegen.cpp
    M clang/test/OpenMP/sections_lastprivate_codegen.cpp
    M clang/test/OpenMP/sections_reduction_codegen.cpp
    M clang/test/OpenMP/sections_reduction_task_codegen.cpp
    M clang/test/OpenMP/single_firstprivate_codegen.cpp
    M clang/test/OpenMP/structured-bindings-codegen.cpp
    M clang/test/OpenMP/target_codegen_global_capture.cpp
    M clang/test/OpenMP/target_in_reduction_codegen.cpp
    M clang/test/OpenMP/target_map_codegen_03.cpp
    M clang/test/OpenMP/target_parallel_num_threads_strict_codegen.cpp
    M clang/test/OpenMP/target_teams_codegen.cpp
    M clang/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_codegen.cpp
    M clang/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_codegen.cpp
    M clang/test/OpenMP/target_teams_distribute_parallel_for_reduction_codegen.cpp
    M clang/test/OpenMP/target_teams_distribute_parallel_for_reduction_task_codegen.cpp
    M clang/test/OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_codegen.cpp
    M clang/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_codegen.cpp
    M clang/test/OpenMP/target_teams_distribute_parallel_for_simd_reduction_codegen.cpp
    M clang/test/OpenMP/target_teams_generic_loop_reduction_codegen.cpp
    M clang/test/OpenMP/task_codegen.cpp
    M clang/test/OpenMP/task_in_reduction_codegen.cpp
    M clang/test/OpenMP/taskloop_in_reduction_codegen.cpp
    M clang/test/OpenMP/taskloop_simd_in_reduction_codegen.cpp
    M clang/test/OpenMP/teams_distribute_parallel_for_firstprivate_codegen.cpp
    M clang/test/OpenMP/teams_distribute_parallel_for_lastprivate_codegen.cpp
    M clang/test/OpenMP/teams_distribute_parallel_for_reduction_codegen.cpp
    M clang/test/OpenMP/teams_distribute_parallel_for_reduction_task_codegen.cpp
    M clang/test/OpenMP/teams_distribute_parallel_for_simd_codegen.cpp
    M clang/test/OpenMP/teams_distribute_parallel_for_simd_firstprivate_codegen.cpp
    M clang/test/OpenMP/teams_distribute_parallel_for_simd_lastprivate_codegen.cpp
    M clang/test/OpenMP/teams_distribute_parallel_for_simd_reduction_codegen.cpp
    M clang/test/OpenMP/vla_crash.c
    M llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
    M llvm/test/Transforms/OpenMP/parallel_region_merging.ll
    M llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
    M mlir/test/Target/LLVMIR/omptarget-region-parallel-llvm.mlir
    A mlir/test/Target/LLVMIR/openmp-capture-lifetime.mlir
    M mlir/test/Target/LLVMIR/openmp-dist_schedule_with_wsloop.mlir
    M mlir/test/Target/LLVMIR/openmp-firstprivate.mlir
    M mlir/test/Target/LLVMIR/openmp-private.mlir

  Log Message:
  -----------
  [OpenMP] Preserve host capture lifetimes in frontend lowering

Mark captured alloca/global storage nofreeobj when Clang emits a synchronous
host parallel call. This preserves lifetime across outlining without claiming
that escaped capture slots are noalias or immutable, and without extending the
lifetime guarantee to pointers loaded from those slots.

Mark OpenMPIRBuilder's fresh host capture aggregate noalias and nofreeobj.
This covers the lowering path used by Flang and Clang's IRBuilder mode.

Replace callback Attributor seeding with frontend and translation tests,
including escaped captures, heap references, firstprivate pointers, debug
wrappers, serialized regions, and optimized load hoisting with OpenMPOpt
disabled. Refresh the affected parameter-attribute checks.



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