[all-commits] [llvm/llvm-project] a428b5: [mlir][target][LLVMIR] Change translation order to...

Fabian Mora via All-commits all-commits at lists.llvm.org
Fri Jul 28 06:04:10 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a428b5afbd6d48edda9d21ffabd57eee1e7b984d
      https://github.com/llvm/llvm-project/commit/a428b5afbd6d48edda9d21ffabd57eee1e7b984d
  Author: Fabian Mora <fmora.dev at gmail.com>
  Date:   2023-07-28 (Fri, 28 Jul 2023)

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

  Log Message:
  -----------
  [mlir][target][LLVMIR] Change translation order to translate non-LLVM ops before function bodies.

Convert function bodies after all other operations, breaking possible declaration-reference issues between top non-LLVM Ops and non-LLVM ops inside function bodies.

Example:
```
mydialect.global @myglobal : i32
llvm.func @bar(...) {
...
%address = mydialect.global_address @myglobal : llvm.ptr
...
}
```
With the previous scheme `mydialect.global_address` always got translated before `mydialect.global`, this change ensures `mydialect.global` gets translated first.

Reviewed By: mehdi_amini

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




More information about the All-commits mailing list