9 Commits

Author SHA1 Message Date
Kazu Hirata
15ae99647c [mlir] Use std::nullopt instead of None in comments (NFC)
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-07 20:17:39 -08: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
River Riddle
ac9f88e862 [mlir][Index] Add pretty result names for ConstantOp and BoolConstantOp
ConstantOp uses `%idx<value>` and BoolConstantOp uses true/false, which
is similar to the printing for arith::ConstantOp.

Differential Revision: https://reviews.llvm.org/D139175
2022-12-02 01:34:29 -08:00
Luca Boasso
4f9c9295a6 [mlir][index] Add and, or, and xor ops
This patch adds the and, or, and xor bitwise operations to
the index dialects with folders and LLVM lowerings.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D138590
2022-11-23 13:26:02 -06:00
Mehdi Amini
d91460b140 Apply clang-tidy fixes for performance-move-const-arg in IndexOps.cpp (NFC) 2022-11-07 21:22:56 +00:00
Jeff Niu
9ef3146511 [mlir][index] Add shl, shrs, and shru ops
This patch adds the left shift, signed right shift, and unsigned right
shift operations to the index dialects with folders and LLVM lowerings.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D137349
2022-11-03 16:29:04 -07:00
Jeff Niu
83c3eebdec [mlir][index] Add folders for index ops
This patch adds folders for `index` dialect ops. Ths folders are
careful to ensure that fold results are valid on both 32-bit and 64-bit
targets.

Depends on D135689

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D135694
2022-10-21 09:46:12 -07:00
Jeff Niu
ddf87d6cd4 [mlir][index] Add index dialect ops and attributes
This patch adds the definitions for the operations and attributes (just
one enum attribute) for the `index` dialect.

Depends on D135688

Reviewed By: rriddle, jpienaar

Differential Revision: https://reviews.llvm.org/D135689
2022-10-21 09:46:06 -07:00
Jeff Niu
8bef3541fa [mlir][index] Add boilerplate for the index dialect
This patch introduces the `index` dialect and associated boilerplate for
adding ops and enums (comparison predicates).

Reviewed By: rriddle, jpienaar, nicolasvasilache

Differential Revision: https://reviews.llvm.org/D135688
2022-10-21 09:45:59 -07:00