[all-commits] [llvm/llvm-project] f9173c: [mlir][LLVM] Convert `noalias` parameters into ali...

Markus Böck via All-commits all-commits at lists.llvm.org
Thu Jul 20 06:05:43 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f9173c2958bf6cb9bf23cb00184ce91dfba6acbc
      https://github.com/llvm/llvm-project/commit/f9173c2958bf6cb9bf23cb00184ce91dfba6acbc
  Author: Markus Böck <markus.bock+llvm at nextsilicon.com>
  Date:   2023-07-20 (Thu, 20 Jul 2023)

  Changed paths:
    M mlir/include/mlir/Dialect/LLVMIR/LLVMInterfaces.td
    M mlir/lib/Dialect/LLVMIR/IR/LLVMInlining.cpp
    M mlir/lib/Dialect/LLVMIR/IR/LLVMInterfaces.cpp
    M mlir/test/Dialect/LLVMIR/inlining-alias-scopes.mlir
    M mlir/test/Dialect/LLVMIR/inlining.mlir

  Log Message:
  -----------
  [mlir][LLVM] Convert `noalias` parameters into alias scopes during inlining

Currently, inlining a function with a `noalias` parameter leads to a large loss of optimization potential as the `noalias` parameter, an important hint for alias analysis, is lost completely.

This patch fixes this with the same approach as LLVM by annotating all users of the `noalias` parameter with appropriate alias and noalias scope lists.
The implementation done here is not as sophisticated as LLVMs, which has more infrastructure related to escaping and captured pointers, but should work in the majority of important cases.
Any deficiency can be addressed in future patches.

Related LLVM code: https://github.com/llvm/llvm-project/blob/27ade4b554774187d2c0afcf64cd16fa6d5f619d/llvm/lib/Transforms/Utils/InlineFunction.cpp#L1090

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




More information about the All-commits mailing list