[all-commits] [llvm/llvm-project] a4d1d5: [OpenMP] Use simple VLA implementation to replace ...

Shilei Tian via All-commits all-commits at lists.llvm.org
Fri Dec 15 12:13:06 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a4d1d5f5b54b2f93d7290588734f59ff24fc515c
      https://github.com/llvm/llvm-project/commit/a4d1d5f5b54b2f93d7290588734f59ff24fc515c
  Author: Shilei Tian <i at tianshilei.me>
  Date:   2023-12-15 (Fri, 15 Dec 2023)

  Changed paths:
    M openmp/runtime/src/kmp_gsupport.cpp
    M openmp/runtime/src/kmp_runtime.cpp
    A openmp/runtime/src/kmp_utils.h

  Log Message:
  -----------
  [OpenMP] Use simple VLA implementation to replace uses of actual VLA

Use of VLA can cause compile warning that was introduced in D156565. This patch
implements a simple stack/heap-based VLA that can miminc the behavior of an
actual VLA and prevent the warning. By default the stack accomodates the
elements. If the number of emelements is greater than N, which by default is 8,
a heap buffer will be allocated and used to acccomodate the elements.




More information about the All-commits mailing list