[all-commits] [llvm/llvm-project] 90a0be: [mlir][LLVM] Refactor how range() annotations are ...

Krzysztof Drewniak via All-commits all-commits at lists.llvm.org
Thu Sep 12 07:47:04 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 90a0be9482ad00acc1772440f13656190ec1ac22
      https://github.com/llvm/llvm-project/commit/90a0be9482ad00acc1772440f13656190ec1ac22
  Author: Krzysztof Drewniak <Krzysztof.Drewniak at amd.com>
  Date:   2024-09-12 (Thu, 12 Sep 2024)

  Changed paths:
    M mlir/include/mlir/Dialect/LLVMIR/LLVMAttrDefs.td
    M mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
    M mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
    M mlir/lib/Conversion/GPUCommon/IndexIntrinsicsOpLowering.h
    M mlir/lib/Dialect/LLVMIR/IR/LLVMAttrs.cpp
    M mlir/lib/Target/LLVMIR/Dialect/ROCDL/ROCDLToLLVMIRTranslation.cpp
    M mlir/test/Conversion/GPUToROCDL/gpu-to-rocdl.mlir
    M mlir/test/Target/LLVMIR/rocdl.mlir

  Log Message:
  -----------
  [mlir][LLVM] Refactor how range() annotations are handled for ROCDL intrinsics (#107658)

This commit introduces a ConstantRange attribute to match the
ConstantRange attribute type present in LLVM IR.

It then refactors the LLVM_IntrOpBase so that the basic part of the
intrinsic builder code can be re-used without needing to copy it or
get rid of important context. This, along with adding code for
handling an optional `range` attribute to that same base, allows us to
make the support for range() annotations generic without adding
another bit to IntrOpBase.

This commit then updates the lowering of index intrinsic operations to
use the new ConstantRange attribute and fixes a bug (where we'd be
subtracting 1 from upper bounds instead of adding it on operations
like gpu.block_dim) along the way.

The point of these changes is to enable these range annotations to be
used for the corresponding NVVM operations in a future commit.



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