[all-commits] [llvm/llvm-project] d65f03: [Clang] Use private address space for builtin_allo...

Vikash Gupta via All-commits all-commits at lists.llvm.org
Fri Jul 26 02:54:27 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d65f0375910f6dfeaa94c1060e7d81fb7bdf76be
      https://github.com/llvm/llvm-project/commit/d65f0375910f6dfeaa94c1060e7d81fb7bdf76be
  Author: Vikash Gupta <Vikash.Gupta at amd.com>
  Date:   2024-07-26 (Fri, 26 Jul 2024)

  Changed paths:
    M clang/lib/Sema/SemaChecking.cpp
    A clang/test/CodeGenOpenCL/builtins-alloca.cl

  Log Message:
  -----------
  [Clang] Use private address space for builtin_alloca return type for OpenCL (#95750)

The __builtin_alloca was returning a flat pointer with no address space
when compiled using openCL1.2 or below but worked fine with openCL2.0
and above. This accounts to the fact that later uses the concept of
generic address space which supports cast to other address space(i.e to
private address space which is used for stack allocation) .

But, in actuality, as it returns pointer to the stack, it should be
pointing to private address space irrespective of openCL version becuase
builtin_alloca allocates stack memory used for current function in which
it is called. Thus,it requires redefintion of the builtin function with
appropraite return pointer to private address space.



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