[all-commits] [llvm/llvm-project] 0aeaa2: [OMPIRBuilder][OpenMP][LLVM] Modify and use Replac...

agozillon via All-commits all-commits at lists.llvm.org
Thu Jun 13 06:57:36 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0aeaa2d93dc24da427645395b9b228b15409f551
      https://github.com/llvm/llvm-project/commit/0aeaa2d93dc24da427645395b9b228b15409f551
  Author: agozillon <Andrew.Gozillon at amd.com>
  Date:   2024-06-13 (Thu, 13 Jun 2024)

  Changed paths:
    M llvm/include/llvm/IR/ReplaceConstant.h
    M llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
    M llvm/lib/IR/ReplaceConstant.cpp
    A offload/test/offloading/fortran/dtype-array-constant-index-map.f90

  Log Message:
  -----------
  [OMPIRBuilder][OpenMP][LLVM] Modify and use ReplaceConstant utility in convertTarget (#94541)

This PR seeks to expand/replace the Constant -> Instruction conversion
that needs to occur inside of the OpenMP Target kernel generation to
allow kernel argument replacement of uses within the kernel (cannot
replace constant uses within constant expressions with non-constants).
It does so by making use of the new-ish utility
convertUsersOfConstantsToInstructions which is a much more expansive
version of what the smaller "version" of the function I wrote does,
effectively expanding uses of the input argument that are constant
expressions into instructions so that we can replace with the
appropriate kernel argument.

Also alters convertUsersOfConstantsToInstructions to optionally
restrict the replacement to a function and optionally leave
dead constants alone, the latter is necessary when lowering from 
MLIR as we cannot be sure we can remove the constants at this 
stage, even if rewritten to instructions the ModuleTranslation may 
maintain links to the original constants and utilise them in further 
lowering steps (as when we're lowering the kernel, the module is 
still in the process of being lowered). This can result in unusual 
ICEs later. These dead constants can be tidied up later (and 
appear to be in subsequent lowering from checking with 
emit-llvm).



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