[all-commits] [llvm/llvm-project] ffa455: [mlir] Translate global initializers after creatin...

jeanPerier via All-commits all-commits at lists.llvm.org
Thu Mar 25 01:54:54 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ffa455d4d45168bd30abef036f0f9c8b570c9941
      https://github.com/llvm/llvm-project/commit/ffa455d4d45168bd30abef036f0f9c8b570c9941
  Author: Jean Perier <jperier at nvidia.com>
  Date:   2021-03-25 (Thu, 25 Mar 2021)

  Changed paths:
    M mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
    M mlir/test/Target/LLVMIR/llvmir.mlir

  Log Message:
  -----------
  [mlir] Translate global initializers after creating all LLVM IR globals

In case an operation in a global initializer region refers to another
global variable defined afterwards in the module of itself, translation
to LLVM IR was currently crashing because it could not find the LLVM IR global
when going through the initializer block.

To solve this problem, split global conversion to LLVM IR into two passes. A
first pass that creates LLVM IR global variables, and a second one that converts
the initializer, if any, and adds it to the llvm global.

Differential Revision: https://reviews.llvm.org/D99246




More information about the All-commits mailing list