[all-commits] [llvm/llvm-project] c0fc5b: [Flang][OpenMP] Fix to resolve the crash with SIMD...

Kaviya Rajendiran via All-commits all-commits at lists.llvm.org
Thu Aug 28 23:18:45 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c0fc5be60fd74babaf1a0b3dd3a44eeb9f3d73dc
      https://github.com/llvm/llvm-project/commit/c0fc5be60fd74babaf1a0b3dd3a44eeb9f3d73dc
  Author: Kaviya Rajendiran <67495422+kaviya2510 at users.noreply.github.com>
  Date:   2025-08-29 (Fri, 29 Aug 2025)

  Changed paths:
    M flang/lib/Lower/OpenMP/ClauseProcessor.cpp
    M flang/lib/Semantics/check-omp-structure.cpp
    M flang/test/Lower/OpenMP/simd.f90
    M flang/test/Semantics/OpenMP/simd-aligned.f90
    M mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
    M mlir/test/Target/LLVMIR/openmp-simd-aligned.mlir

  Log Message:
  -----------
  [Flang][OpenMP] Fix to resolve the crash with SIMD aligned clause. (#150612)

**Issue:**
When SIMD aligned clause has a alignment value which is not a power of
2, compiler crashes with error Assertion (alignment & (alignment - 1))
== 0 && "alignment is not power of 2"

**Fix:**
According to LLVM Language Reference manual
[[link]](https://llvm.org/docs/LangRef.html#assume-opbundles), the
alignment value may be non-power-of-two. In that case, the pointer value
must be a null pointer otherwise the behavior is undefined.

So instead of emitting `llvm.assume` intrinsic function with a null
pointer having the specified alignment, modified the implementation
which ignores the aligned clause which has an alignment value which is
not a power of 2. This patch also emits a warning indicating that the aligned clause is ignored if the alignment value is not a power of two.

It fixes the issue https://github.com/llvm/llvm-project/issues/149458



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