[all-commits] [llvm/llvm-project] 68db9f: [clang][CodeGen] Fix crash on non-natural type in ...

Pierre van Houtryve via All-commits all-commits at lists.llvm.org
Thu May 22 05:16:21 PDT 2025


  Branch: refs/heads/users/pierre-vh/fix-crash-check-atomic-align
  Home:   https://github.com/llvm/llvm-project
  Commit: 68db9fad42369be31d935257a2d80962a4018892
      https://github.com/llvm/llvm-project/commit/68db9fad42369be31d935257a2d80962a4018892
  Author: pvanhout <pierre.vanhoutryve at amd.com>
  Date:   2025-05-22 (Thu, 22 May 2025)

  Changed paths:
    M clang/lib/CodeGen/CGBuiltin.cpp
    A clang/test/CodeGenOpenCL/check-atomic-alignment.cl

  Log Message:
  -----------
  [clang][CodeGen] Fix crash on non-natural type in CheckAtomicAlignment

In some specific scenarios, `Ptr.getElementType()` won't be a primitive
type or a vector of primitive types, and thus `getScalarSizeInBits()` returns
zero.

Use the datalayout to get the proper size of the type instead of making an implicit
assumption that the type is a simple primitive type.

Solves SWDEV-534184



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