[all-commits] [llvm/llvm-project] abeb6c: [Flang][MLIR] Add basic initial support for alloca...

agozillon via All-commits all-commits at lists.llvm.org
Wed Jan 17 08:37:28 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: abeb6c9f58f69a7e8395ea4a84a0e6f6889eaf78
      https://github.com/llvm/llvm-project/commit/abeb6c9f58f69a7e8395ea4a84a0e6f6889eaf78
  Author: agozillon <Andrew.Gozillon at amd.com>
  Date:   2024-01-17 (Wed, 17 Jan 2024)

  Changed paths:
    M flang/include/flang/Optimizer/CodeGen/CGPasses.td
    M flang/lib/Optimizer/CodeGen/CodeGen.cpp
    M flang/test/Fir/convert-to-llvm.fir

  Log Message:
  -----------
  [Flang][MLIR] Add basic initial support for alloca and program address space handling in FIR->LLVMIR codegen (#77518)

This is a slightly more slimmed down and up-to-date version of the older
PR from here: https://reviews.llvm.org/D144203, written by @jsjodin,
which has already under gone some review.

This PR places allocas in the alloca address space specified by the
provided data layout (default is 0 for all address spaces, unless
explicitly specified by the layout), and then will cast these alloca's
to the program address space if this address space is different from the
allocation address space. For most architectures data layouts, this will
be a no-op, as they have a flat address space. But in the case of AMDGPU
it will result in allocas being placed in the correct address space (5,
private), and then casted into the correct program address space (0,
generic). This results in correct (partially, a follow up PR will be
forthcoming soon) generation of allocations inside of device code.

This PR is in addition to the work by @skatrak in this PR:
https://github.com/llvm/llvm-project/pull/69599 and adds seperate and
neccesary functionality of casting alloca's from their address space to
the program address space, both are independent PRs, although there is
some minor overlap e.g. this PR incorporates some of the useful helper
functions from 69599, so whichever lands first will need a minor rebase.

Co-author: jsjodin




More information about the All-commits mailing list