[mlir] Move the Builtin FuncOp to the Func dialectThis commit moves FuncOp out of the builtin dialect, and into the Funcdialect. This move has been planned in some capacity from the momentwe made
[mlir] Move the Builtin FuncOp to the Func dialectThis commit moves FuncOp out of the builtin dialect, and into the Funcdialect. This move has been planned in some capacity from the momentwe made FuncOp an operation (years ago). This commit handles thefunctional aspects of the move, but various aspects are left untouchedto ease migration: func::FuncOp is re-exported into mlir to reducethe actual API churn, the assembly format still accepts the unqualified`func`. These temporary measures will remain for a little while tosimplify migration before being removed.Differential Revision: https://reviews.llvm.org/D121266
show more ...
[mlir] Rename the Standard dialect to the Func dialectThe last remaining operations in the standard dialect all revolve aroundFuncOp/function related constructs. This patch simply handles the init
[mlir] Rename the Standard dialect to the Func dialectThe last remaining operations in the standard dialect all revolve aroundFuncOp/function related constructs. This patch simply handles the initialrenaming (which by itself is already huge), but there are a large numberof cleanups unlocked/necessary afterwards:* Removing a bunch of unnecessary dependencies on Func* Cleaning up the From/ToStandard conversion passes* Preparing for the move of FuncOp to the Func dialectSee the discussion at https://discourse.llvm.org/t/standard-dialect-the-final-chapter/6061Differential Revision: https://reviews.llvm.org/D120624
[mlir] Replace StrEnumAttr -> EnumAttr in core dialectsRemoves uses of `StrEnumAttr` in core dialectsReviewed By: mehdi_amini, rriddleDifferential Revision: https://reviews.llvm.org/D117514
[MLIR][GPU] Define gpu.printf op and its lowerings- Define a gpu.printf op, which can be lowered to any GPU printf() support (which is present in CUDA, HIP, and OpenCL). This op only supports const
[MLIR][GPU] Define gpu.printf op and its lowerings- Define a gpu.printf op, which can be lowered to any GPU printf() support (which is present in CUDA, HIP, and OpenCL). This op only supports constant format strings and scalar arguments- Define the lowering of gpu.pirntf to a call to printf() (which is what is required for AMD GPUs when using OpenCL) as well as to the hostcall interface present in the AMD Open Compute device library, which is the interface present when kernels are running under HIP.- Add a "runtime" enum that allows specifying which of the possible runtimes a ROCDL kernel will be executed under or that the runtime is unknown. This enum controls how gpu.printf is loweredThis change does not enable lowering for Nvidia GPUs, but such a lowering should be possible in principle.And:[MLIR][AMDGPU] Always set amdgpu-implicitarg-num-bytes=56 on kernelsThis is something that Clang always sets on both OpenCL and HIP kernels, and failing to include it causes mysterious crashes with printf() support.In addition, revert the max-flat-work-group-size to (1, 256) to avoid triggering bugs in the AMDGPU backend.Reviewed By: mehdi_aminiDifferential Revision: https://reviews.llvm.org/D110448
[MLIR] Replace std ops with arith dialect opsPrecursor: https://reviews.llvm.org/D110200Removed redundant ops from the standard dialect that were moved to the`arith` or `math` dialects.Renamed
[MLIR] Replace std ops with arith dialect opsPrecursor: https://reviews.llvm.org/D110200Removed redundant ops from the standard dialect that were moved to the`arith` or `math` dialects.Renamed all instances of operations in the codebase and in tests.Reviewed By: rriddle, jpienaarDifferential Revision: https://reviews.llvm.org/D110797
Add a new interface allowing to set a default dialect to be used for printing/parsing regionsCurrently the builtin dialect is the default namespace used for parsingand printing. As such module and
Add a new interface allowing to set a default dialect to be used for printing/parsing regionsCurrently the builtin dialect is the default namespace used for parsingand printing. As such module and func don't need to be prefixed.In the case of some dialects that defines new regions for their ownpurpose (like SpirV modules for example), it can be beneficial tochange the default dialect in order to improve readability.Differential Revision: https://reviews.llvm.org/D107236
[mlir][rocdl] Add math::Exp2Op lowering to ROCDLDifferential Revision: https://reviews.llvm.org/D106057
Lower math.expm1 to intrinsics in the GPUToNVVM and GPUToROCDL conversions.This adds the lowering for expm1 for GPU backends.Differential Revision: https://reviews.llvm.org/D96756
[mlir] Use target-specific GPU kernel attributes in lowering pipelinesUntil now, the GPU translation to NVVM or ROCDL intrinsics relied on thepresence of the generic `gpu.kernel` attribute to atta
[mlir] Use target-specific GPU kernel attributes in lowering pipelinesUntil now, the GPU translation to NVVM or ROCDL intrinsics relied on thepresence of the generic `gpu.kernel` attribute to attach additional LLVM IRmetadata to the relevant functions. This would be problematic if each dialectwere to handle the conversion of its own options, which is the intendeddirection for the translation infrastructure. Introduce `nvvm.kernel` and`rocdl.kernel` in addition to `gpu.kernel` and base translation on these newattributes instead.Reviewed By: herhutDifferential Revision: https://reviews.llvm.org/D96591
[mlir][math] Split off the math dialect.This does not split transformations, yet. Those will be done as future clean ups.Differential Revision: https://reviews.llvm.org/D96272
Add log1p lowering from standard to ROCDL intrinsicsDifferential Revision: https://reviews.llvm.org/D95129
[mlir] replace LLVM dialect float types with built-insContinue the convergence between LLVM dialect and built-in types by replacingthe bfloat, half, float and double LLVM dialect types with their
[mlir] replace LLVM dialect float types with built-insContinue the convergence between LLVM dialect and built-in types by replacingthe bfloat, half, float and double LLVM dialect types with their built-incounterparts. At the API level, this is a direct replacement. At the syntaxlevel, we change the keywords to `bf16`, `f16`, `f32` and `f64`, respectively,to be compatible with the built-in type syntax. The old keywords can still beparsed but produce a deprecation warning and will be eventually removed.Depends On D94178Reviewed By: mehdi_amini, silvas, antiagainstDifferential Revision: https://reviews.llvm.org/D94179
[mlir] replace LLVMIntegerType with built-in integer typeThe LLVM dialect type system has been closed until now, i.e. did not supporttypes from other dialects inside containers. While this has had
[mlir] replace LLVMIntegerType with built-in integer typeThe LLVM dialect type system has been closed until now, i.e. did not supporttypes from other dialects inside containers. While this has had obviousbenefits of deriving from a common base class, it has led to some simple typesbeing almost identical with the built-in types, namely integer and floatingpoint types. This in turn has led to a lot of larger-scale complexity: simpletypes must still be converted, numerous operations that correspond to LLVM IRintrinsics are replicated to produce versions operating on either LLVM dialector built-in types leading to quasi-duplicate dialects, lowering to the LLVMdialect is essentially required to be one-shot because of type conversion, etc.In this light, it is reasonable to trade off some local complexity in theinternal implementation of LLVM dialect types for removing larger-scale systemcomplexity. Previous commits to the LLVM dialect type system have adapted theAPI to support types from other dialects.Replace LLVMIntegerType with the built-in IntegerType plus additional checksthat such types are signless (these are isolated in a utility function thatreplaced `isa<LLVMType>` and in the parser). Temporarily keep the possibilityto parse `!llvm.i32` as a synonym for `i32`, but add a deprecation notice.Reviewed By: mehdi_amini, silvas, antiagainstDifferential Revision: https://reviews.llvm.org/D94178
[mlir] Add std.powf to ROCDL lowering.Differential Revision: https://reviews.llvm.org/D93313
[MLIR] Add lowerings for atan and atan2 to ROCDL intrinsicsDifferential Revision: https://reviews.llvm.org/D93123
Add rsqrt lowering from standard to ROCDL.Add a lowering for rsqrt from standard dialect to ROCDL.Differential Revision: https://reviews.llvm.org/D93011
Add sqrt lowering from standard to ROCDLAdd a lowering for sqrt from standard dialect to ROCDL.Differential Revision: https://reviews.llvm.org/D92921
Added std.floor operation to match std.ceilThere should be an equivalent std.floor op to std.ceil. This includesmatching lowerings for SPIRV, NVVM, ROCDL, and LLVM.Reviewed By: ftynseDifferent
Added std.floor operation to match std.ceilThere should be an equivalent std.floor op to std.ceil. This includesmatching lowerings for SPIRV, NVVM, ROCDL, and LLVM.Reviewed By: ftynseDifferential Revision: https://reviews.llvm.org/D85940
[mlir] make the bitwidth of device side index computations configurable (reland)Summary:The patch makes the index type lowering of the GPU to NVVM/ROCDL conversion configurable. It introduces a pa
[mlir] make the bitwidth of device side index computations configurable (reland)Summary:The patch makes the index type lowering of the GPU to NVVM/ROCDL conversion configurable. It introduces a pass option that controls the bitwidth used when lowering index computations and uses the LowerToLLVMOptions structure to control the Standard to LLVM lowering.This commit fixes a use-after-free bug introduced by the reverted commit d10b1a3. It implements the following changes:- Added a getDefaultOptions method to the LowerToLLVMOptions struct that returns a reference to statically allocated default options.- Use the getDefaultOptions method to provide default LowerToLLVMOptions (instead of an initializer list).- Added comments to clarify the required lifetime of the LowerToLLVMOptionsReviewed By: ftynseDifferential Revision: https://reviews.llvm.org/D82475
Revert "[mlir] make the bitwidth of device side index computations configurable"This reverts commit d10b1a38a7dfb994623f27f263b67f5fc76e08cc.
[mlir] make the bitwidth of device side index computations configurableThe patch makes the index type lowering of the GPU to NVVM/ROCDLconversion configurable. It introduces a pass option that con
[mlir] make the bitwidth of device side index computations configurableThe patch makes the index type lowering of the GPU to NVVM/ROCDLconversion configurable. It introduces a pass option that controls thebitwidth used when lowering index computations.Differential Revision: https://reviews.llvm.org/D80285
Change filecheck default to dump input on failureHaving the input dumped on failure seems like a betterdefault: I debugged FileCheck tests for a while without knowingabout this option, which real
Change filecheck default to dump input on failureHaving the input dumped on failure seems like a betterdefault: I debugged FileCheck tests for a while without knowingabout this option, which really helps to understand failures.Remove `-dump-input-on-failure` and the environment variableFILECHECK_DUMP_INPUT_ON_FAILURE which are now obsolete.Differential Revision: https://reviews.llvm.org/D81422
[mlir][rocdl] add rocdl.barier op.- Add rocdl.barrier op.- Lower gpu.barier to rocdl.barrier in -convert-gpu-to-rocdl.Differential Revision: https://reviews.llvm.org/D79126
[mlir][nvvm][rocdl] refactor NVVM and ROCDL dialect. NFC.- Extract common logic between -convert-gpu-to-nvvm and -convert-gpu-to-rocdl.- Cope with the fact that alloca operates on different addrsp
[mlir][nvvm][rocdl] refactor NVVM and ROCDL dialect. NFC.- Extract common logic between -convert-gpu-to-nvvm and -convert-gpu-to-rocdl.- Cope with the fact that alloca operates on different addrspaces between NVVM and ROCDL.- Modernize unit tests for ROCDL dialect.Differential Revision: https://reviews.llvm.org/D79021
Add GPU lowerings for the different log ops.Summary: This adds GPU lowerings for log, log10 and log2.Reviewers: mravishankar, herhutSubscribers: jholewinski, mehdi_amini, rriddle, jpienaar, bur
Add GPU lowerings for the different log ops.Summary: This adds GPU lowerings for log, log10 and log2.Reviewers: mravishankar, herhutSubscribers: jholewinski, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, csigg, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, llvm-commitsTags: #llvmDifferential Revision: https://reviews.llvm.org/D75239
12