13 Commits

Author SHA1 Message Date
Jakub Kuderski
28246b7e75 [mlir][arith] Rename addui_carry to addui_extended
The goal is to make the naming of the future `_extended` ops more
consistent. With unsigned addition, the carry value/flag and overflow
bit are the same, but this is not true when it comes to signed addition.

Also rename the second result from `carry` to `overflow`.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D139569
2022-12-07 17:15:56 -05:00
Kazu Hirata
1a36588ec6 [mlir] Use std::nullopt instead of None (NFC)
This patch mechanically replaces None with std::nullopt where the
compiler would warn if None were deprecated.  The intent is to reduce
the amount of manual work required in migrating from Optional to
std::optional.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-12-03 18:50:27 -08:00
Jakub Kuderski
92bcb8ccbb [mlir][arith] Add index_cast and index_castui support to WIE
Reviewed By: Mogball

Differential Revision: https://reviews.llvm.org/D138225
2022-11-17 14:04:17 -05:00
Jakub Kuderski
0436214b6d [mlir][arith] Add Max*I and Min*I support to WIE
This includes LIT IR tests and runtime tests.

Reviewed By: Mogball

Differential Revision: https://reviews.llvm.org/D138184
2022-11-17 13:36:15 -05:00
Jakub Kuderski
64333332db [mlir][arith] Add arith.shrsi support to WIE
This includes LIT tests over the generated ops and runtime tests.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D137965
2022-11-14 20:52:10 -05:00
Jakub Kuderski
7e835ae57c [mlir][arith] Add arith.cmpi support to WIE
This inludes both LIT tests over IR and runtime checks.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D137846
2022-11-11 15:14:02 -05:00
Jakub Kuderski
38b63c900f [mlir][arith] Add select support to WIE
Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D137589
2022-11-08 20:34:51 -05:00
Jakub Kuderski
fae258e6c6 [mlir][memref] Add initial Wide Int Emulation pass and patterns
Add a new pass and conversions to emulate wide integer operations over memrefs.
The emulation is implemented on top of the existing pass to emulate wide integer arith ops.

Improve naming in the arith pass to avoid potential name clashes.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D135722
2022-10-14 11:37:52 -04:00
Jakub Kuderski
a73846ebe9 [mlir][arith] Improve EmulateWideInt diagnostics
Print unsupported types on match failures.

Suggested by @Mogball and @jpienaar in D135204.

Reviewed By: Mogball

Differential Revision: https://reviews.llvm.org/D135673
2022-10-11 14:24:54 -04:00
Jakub Kuderski
e99e8ad24d [mlir][arith] Add shli support to WIE
Reviewed By: ThomasRaoux

Differential Revision: https://reviews.llvm.org/D135234
2022-10-05 15:09:58 -04:00
Jakub Kuderski
40126e66b6 [mlir][arith] Add andi, ori, and xori support to WIE
Reviewed By: ThomasRaoux

Differential Revision: https://reviews.llvm.org/D135204
2022-10-05 14:34:42 -04:00
Jakub Kuderski
b39b805ad5 [mlir][arith] Mark unknown types legal in WIE
Allow unknown types to pass through without being marked as illegal.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D135123
2022-10-04 15:00:51 -04:00
Jakub Kuderski
abc362a107 [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
2022-09-29 11:23:28 -04:00