13 Commits

Author SHA1 Message Date
Kazu Hirata
05b6e1ffb3
[mlir] Remove redundant typename (NFC) (#166108)
Identified with readability-redundant-typename.
2025-11-02 15:52:36 -08:00
Keshav Vinayak Jha
fbbffc1169
[MLIR][ROCDL] Add math.clampf -> rocdl.fmed3 conversion (#163520)
Added Pattern for lowering `Math::ClampFOp` to `ROCDL::FMED3`.
Also added `chipet` option to `MathToRocdl` pass to check for arch
support ISA instructions

Solves [#15072](https://github.com/llvm/llvm-project/issues/157052)

Reapplies https://github.com/llvm/llvm-project/pull/160100

Un-reverts the merged https://github.com/llvm/llvm-project/pull/163259,
and fixes the error.

---------

Signed-off-by: Keshav Vinayak Jha <keshavvinayakjha@gmail.com>
2025-10-17 08:14:58 -04:00
Fabian Mora
e34b71e351
Revert "[MLIR][ROCDL] Add math.clampf -> rocdl.fmed3 conversion" (#163447)
Reverts llvm/llvm-project#163259. Reverting due to missing link libraries
causing failures in shared build bots.
2025-10-14 16:33:09 -04:00
Keshav Vinayak Jha
1e6df640e2
[MLIR][ROCDL] Add math.clampf -> rocdl.fmed3 conversion (#163259)
Added Pattern for lowering `Math::ClampFOp` to `ROCDL::FMED3`.
Also added `chipset` option to `MathToRocdl` pass to check for arch
support ISA instructions

Solves [#15072](https://github.com/llvm/llvm-project/issues/157052)

Reapplies https://github.com/llvm/llvm-project/pull/160100

---------

Signed-off-by: Keshav Vinayak Jha <keshavvinayakjha@gmail.com>
2025-10-14 15:21:26 -05:00
Mehdi Amini
75e5a70577
[MLIR] Migrate some conversion passes and dialects to LDBG() macro (NFC) (#151349) 2025-07-30 17:58:54 +02:00
Kazu Hirata
fa9adbfda9
[mlir] Remove unused includes (NFC) (#147101)
These are identified by misc-include-cleaner.  I've filtered out those
that break builds.  Also, I'm staying away from llvm-config.h,
config.h, and Compiler.h, which likely cause platform- or
compiler-specific build failures.
2025-07-04 13:30:21 -07:00
Jan Leyonberg
c3b3352f73
[MLIR][ROCDL] Add conversion of math.erfc to AMD GPU library calls (#128899)
This patch adds a pattern to convert the math.erfc operation to AMD GPU
library calls.

Depends on: #128897 for the flang test
2025-02-27 14:32:25 -05:00
lialan
9f114afe09
[MLIR][ROCDL] Convert math::fpowi to ROCDL call (#122640)
* Have to relax static assert to allow reuse of existing template
patterns for conversion.
2025-01-13 20:31:25 -08:00
Matthias Springer
206fad0e21
[mlir][NFC] Mark type converter in populate... functions as const (#111250)
This commit marks the type converter in `populate...` functions as
`const`. This is useful for debugging.

Patterns already take a `const` type converter. However, some
`populate...` functions do not only add new patterns, but also add
additional type conversion rules. That makes it difficult to find the
place where a type conversion was added in the code base. With this
change, all `populate...` functions that only populate pattern now have
a `const` type converter. Programmers can then conclude from the
function signature that these functions do not register any new type
conversion rules.

Also some minor cleanups around the 1:N dialect conversion
infrastructure, which did not always pass the type converter as a
`const` object internally.
2024-10-05 21:32:40 +02:00
Daniel Hernandez-Juarez
1c47fa9b62
[mlir][AMDGPU] Add support for AMD f16 math library calls (#108809)
In this PR we add support for AMD f16 math library calls
(`__ocml_*_f16`)

CC: @krzysz00 @manupak
2024-09-23 12:52:00 -05:00
Jan Leyonberg
3ebd79751f
[MLIR][ROCDL] Remove patterns for ops supported as intrinsics in the AMDGPU backend (#102971)
This patch removes patterns for a few operations which allows mathToLLVM
conversion to convert the operations into LLVM intrinsics instead since
they are supported directly by the AMDGPU backend.
2024-09-04 11:29:10 -04:00
runseny
f6431f0c52
[MLIR][GPUToNVVM] support fastMath and other non-supported mathOp (#99890)
Support fastMath and other non-supported mathOp which only require float
operands and call libdevice function directly to nvvm.

1. lowering mathOp with fastMath attribute to correct libdevice
intrinsic.
2. some mathOp in math dialect has been lowered to libdevice now, but it
doesn't cover all mathOp. so this mr lowers all the remaining mathOp
which only require float operands.
2024-07-25 13:54:58 +02:00
Jan Leyonberg
3fae5551de
[MLIR][ROCDL] Refactor conversion of math operations to ROCDL calls to a separate pass (#98653)
This patch refactors the conversion of math operations to ROCDL library
calls. This pass will also be used in flang to lower Fortran
intrinsics/math functions for OpenMP target offloading codgen.
2024-07-17 09:33:04 -04:00