Revision tags: llvmorg-21-init |
|
#
45d83ae7 |
| 24-Jan-2025 |
donald chen <chenxunyu1993@gmail.com> |
[mlir] [math] Fix the precision issue of expand math (#120865)
The convertFloorOp pattern incurs precision loss when floating-point
numbers exceed the representable range of int64. This pattern sho
[mlir] [math] Fix the precision issue of expand math (#120865)
The convertFloorOp pattern incurs precision loss when floating-point
numbers exceed the representable range of int64. This pattern should be
removed.
Fixes https://github.com/llvm/llvm-project/issues/119836
show more ...
|
Revision tags: llvmorg-19.1.7 |
|
#
09dfc571 |
| 20-Dec-2024 |
Jacques Pienaar <jpienaar@google.com> |
[mlir] Enable decoupling two kinds of greedy behavior. (#104649)
The greedy rewriter is used in many different flows and it has a lot of
convenience (work list management, debugging actions, tracin
[mlir] Enable decoupling two kinds of greedy behavior. (#104649)
The greedy rewriter is used in many different flows and it has a lot of
convenience (work list management, debugging actions, tracing, etc). But
it combines two kinds of greedy behavior 1) how ops are matched, 2)
folding wherever it can.
These are independent forms of greedy and leads to inefficiency. E.g.,
cases where one need to create different phases in lowering and is
required to applying patterns in specific order split across different
passes. Using the driver one ends up needlessly retrying folding/having
multiple rounds of folding attempts, where one final run would have
sufficed.
Of course folks can locally avoid this behavior by just building their
own, but this is also a common requested feature that folks keep on
working around locally in suboptimal ways.
For downstream users, there should be no behavioral change. Updating
from the deprecated should just be a find and replace (e.g., `find ./
-type f -exec sed -i
's|applyPatternsAndFoldGreedily|applyPatternsGreedily|g' {} \;` variety)
as the API arguments hasn't changed between the two.
show more ...
|
Revision tags: llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6 |
|
#
279a659e |
| 13-May-2024 |
Corentin Ferry <corentin.ferry@amd.com> |
[mlir][math] lower rsqrt to sqrt + fdiv (#91344)
This commit creates an expansion pattern to lower math.rsqrt(x) into
fdiv(1, sqrt(x)).
|
#
a62a7024 |
| 07-May-2024 |
jinchen <49575973+jinchen62@users.noreply.github.com> |
[mlir][math] Add expand patterns for acosh, asinh, atanh (#90718)
|
Revision tags: llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3 |
|
#
10a57f3a |
| 01-Apr-2024 |
Prashant Kumar <pk5561@gmail.com> |
[mlir][math] Expand powfI operation for constant power operand. (#87081)
-- Convert `math.fpowi` to a series of `arith.mulf` operations.
-- If the power is negative, we divide the result by 1.
|
Revision tags: llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init |
|
#
aa165edc |
| 15-Dec-2023 |
Rob Suderman <rob.suderman@gmail.com> |
[mlir][math] Added `math.sinh` with expansions to `math.exp` (#75517)
Includes end-to-end tests for the cpu running, folders using `libm` and
lowerings to the corresponding `libm` operations.
|
Revision tags: llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3 |
|
#
44baa655 |
| 22-Apr-2023 |
Ramiro Leal-Cavazos <ramiroleal050@gmail.com> |
Revert "Revert "Fix handling of special and large vals in expand pattern for `round`" and "Add pattern that expands `math.roundeven` into `math.round` + arith""
This reverts commit 87cef78fa1c7bf6ef
Revert "Revert "Fix handling of special and large vals in expand pattern for `round`" and "Add pattern that expands `math.roundeven` into `math.round` + arith""
This reverts commit 87cef78fa1c7bf6efc544e990894a6062d56abec.
The issue in the original revert is that a lit test expecting a `-nan` as an output was failing on M2. Since the IEEE 754-2008 standard does not require the sign to be printed when displaying a `nan`, this commit changes the `CHECK` for `-nan` to one that checks the result value bitcasted to an `i32` to ensure that input is being left unchanged. This check should now be independent of platform being used to run test.
Reviewed By: jpienaar, mehdi_amini
Differential Revision: https://reviews.llvm.org/D148941
show more ...
|
#
87cef78f |
| 21-Apr-2023 |
Mehdi Amini <joker.eph@gmail.com> |
Revert "Fix handling of special and large vals in expand pattern for `round`" and "Add pattern that expands `math.roundeven` into `math.round` + arith"
This reverts commit 8d2bae9abdc30e104bab00a4dd
Revert "Fix handling of special and large vals in expand pattern for `round`" and "Add pattern that expands `math.roundeven` into `math.round` + arith"
This reverts commit 8d2bae9abdc30e104bab00a4dd0f9d39f5bdda6e and commit ab2fc9521ec606603412645d4a4b3cf456acd153.
Tests are broken on Mac M2
show more ...
|
#
8d2bae9a |
| 20-Apr-2023 |
Ramiro Leal-Cavazos <ramiroleal050@gmail.com> |
Add pattern that expands `math.roundeven` into `math.round` + arith
This commit adds a pattern that expands `math.roundeven` into `math.round` + some ops from `arith`. This is needed to be able to r
Add pattern that expands `math.roundeven` into `math.round` + arith
This commit adds a pattern that expands `math.roundeven` into `math.round` + some ops from `arith`. This is needed to be able to run `math.roundeven` in a vectorized manner.
Reviewed By: jpienaar
Differential Revision: https://reviews.llvm.org/D148285
show more ...
|
Revision tags: llvmorg-16.0.2 |
|
#
2d4e8567 |
| 14-Apr-2023 |
Balaji V. Iyer <bviyer@gmail.com> |
[mlir][math] Expand math.powf to exp, log and multiply
Powf functions are pushed directly to libm. This is problematic for situations where libm is not available. This patch will decompose the powf
[mlir][math] Expand math.powf to exp, log and multiply
Powf functions are pushed directly to libm. This is problematic for situations where libm is not available. This patch will decompose the powf function into log of exponent multiplied by log of base and raise it to the exp.
Reviewed By: rsuderman
Differential Revision: https://reviews.llvm.org/D148164
show more ...
|
#
be911578 |
| 13-Apr-2023 |
Balaji V. Iyer <bviyer@gmail.com> |
[mlir][math] Expand math.round to truncate, compare and increment.
Round functions are pushed directly to libm. This is problematic for situations where libm is not available. This patch will decomp
[mlir][math] Expand math.round to truncate, compare and increment.
Round functions are pushed directly to libm. This is problematic for situations where libm is not available. This patch will decompose the roundf function by adding 0.5 to positive number to input (subtracting for negative) following by a truncate.
Reviewed By: rsuderman
Differential Revision: https://reviews.llvm.org/D148026
show more ...
|
#
4da96515 |
| 13-Apr-2023 |
Balaji V. Iyer <bviyer@gmail.com> |
[mlir][math] Expand math.exp2 to use math.exp.
Exp2 functions are pushed directly to libm. This is problematic for situations where libm is not available. This patch will expand the exp2 function to
[mlir][math] Expand math.exp2 to use math.exp.
Exp2 functions are pushed directly to libm. This is problematic for situations where libm is not available. This patch will expand the exp2 function to use exp2 with the input multiplied by ln2 (natural log).
Reviewed By: rsuderman
Differential Revision: https://reviews.llvm.org/D148064
show more ...
|
#
2217888d |
| 11-Apr-2023 |
Balaji V. Iyer <bviyer@gmail.com> |
[mlir][math] Expand math.ceilf to truncate, compares and increments
Ceilf are pushed directly to libm. This is problematic for situations where libm is not available. This patch will break down a ce
[mlir][math] Expand math.ceilf to truncate, compares and increments
Ceilf are pushed directly to libm. This is problematic for situations where libm is not available. This patch will break down a ceilf function to truncate followed by an increment if the truncated value is smaller than the input value.
Reviewed By: rsuderman
Differential Revision: https://reviews.llvm.org/D147974
show more ...
|
#
af9eb1e3 |
| 10-Apr-2023 |
Balaji V. Iyer <bviyer@gmail.com> |
[mlir][math] Expand math.floorf to truncate, compares and increments
Floorf are pushed directly to libm. This is problematic for situations where libm is not available. This patch will break down a
[mlir][math] Expand math.floorf to truncate, compares and increments
Floorf are pushed directly to libm. This is problematic for situations where libm is not available. This patch will break down a floorf function to truncate followed by an increment for negative values, if necessary.
Reviewed By: rsuderman
Differential Revision: https://reviews.llvm.org/D147966
show more ...
|
#
a7c2102d |
| 07-Apr-2023 |
Balaji V. Iyer <bviyer@gmail.com> |
[mlir][math]Expand Fused math.fmaf to a multiply-add
Fused multiply and add are being pushed directly to the libm. This is problematic for situations where libm is not available. This patch will bre
[mlir][math]Expand Fused math.fmaf to a multiply-add
Fused multiply and add are being pushed directly to the libm. This is problematic for situations where libm is not available. This patch will break down a fused multiply and add into a multiply followed by an add.
Reviewed By: rsuderman
Differential Revision: https://reviews.llvm.org/D147811
show more ...
|
#
711c5893 |
| 06-Apr-2023 |
Robert Suderman <suderman@google.com> |
[mlir][math] Update math arith expansions for vectorization
The math arithmetic expansions do not support vectorized types. Updated the lowerings so that they support vectorized types. This includes
[mlir][math] Update math arith expansions for vectorization
The math arithmetic expansions do not support vectorized types. Updated the lowerings so that they support vectorized types. This includes a different implementation for `math.ctlz` to be a binary search and not have variable termination time.
Reviewed By: jpienaar, NatashaKnk
Differential Revision: https://reviews.llvm.org/D147289
show more ...
|
Revision tags: llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4 |
|
#
740e2e90 |
| 01-Mar-2023 |
Robert Suderman <suderman@google.com> |
[mlir][math] Math expansion for math.tan
We can implement a polynomial approximation of math.tan by decomposing to `math.sin` and `math.cos`. While it is not technically a polynomial approximation i
[mlir][math] Math expansion for math.tan
We can implement a polynomial approximation of math.tan by decomposing to `math.sin` and `math.cos`. While it is not technically a polynomial approximation it should be the most straight forward approximation.
Reviewed By: jpienaar
Differential Revision: https://reviews.llvm.org/D144980
show more ...
|
Revision tags: llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, working, llvmorg-15.0.2 |
|
#
abc362a1 |
| 29-Sep-2022 |
Jakub Kuderski <kubak@google.com> |
[mlir][arith] Change dialect name from Arithmetic to Arith
Suggested by @lattner in https://discourse.llvm.org/t/rfc-define-precise-arith-semantics/65507/22.
Tested with: `ninja check-mlir check-ml
[mlir][arith] Change dialect name from Arithmetic to Arith
Suggested by @lattner in https://discourse.llvm.org/t/rfc-define-precise-arith-semantics/65507/22.
Tested with: `ninja check-mlir check-mlir-integration check-mlir-mlir-spirv-cpu-runner check-mlir-mlir-vulkan-runner check-mlir-examples`
and `bazel build --config=generic_clang @llvm-project//mlir:all`.
Reviewed By: lattner, Mogball, rriddle, jpienaar, mehdi_amini
Differential Revision: https://reviews.llvm.org/D134762
show more ...
|
Revision tags: llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6 |
|
#
8b68da2c |
| 17-Jun-2022 |
Alex Zinenko <zinenko@google.com> |
[mlir] move SCF headers to SCF/{IR,Transforms} respectively
This aligns the SCF dialect file layout with the majority of the dialects.
Reviewed By: jpienaar
Differential Revision: https://reviews.
[mlir] move SCF headers to SCF/{IR,Transforms} respectively
This aligns the SCF dialect file layout with the majority of the dialects.
Reviewed By: jpienaar
Differential Revision: https://reviews.llvm.org/D128049
show more ...
|
Revision tags: llvmorg-14.0.5 |
|
#
f3bdb56d |
| 01-Jun-2022 |
Rob Suderman <suderman@google.com> |
[mlir][math] Add math.ctlz expansion to control flow + arith operations
Ctlz is an intrinsic in LLVM but does not have equivalent operations in SPIR-V. Including a decomposition gives an alternative
[mlir][math] Add math.ctlz expansion to control flow + arith operations
Ctlz is an intrinsic in LLVM but does not have equivalent operations in SPIR-V. Including a decomposition gives an alternative path for these platforms.
Reviewed By: NatashaKnk
Differential Revision: https://reviews.llvm.org/D126261
show more ...
|