llvm-project/mlir/lib/IR
Valentin Clement bd514967aa
[mlir][CSE] Add ability to remove commutative operations
This patch takes advantage of the Commutative trait on operation
to remove identical commutative operations where the operands are swapped.

The second operation below can be removed since `arith.addi` is commutative.
```
%1 = arith.addi %a, %b : i32
%2 = arith.addi %b, %a : i32
```

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D123492
2022-04-16 21:09:47 +02:00
..
AffineExpr.cpp Apply clang-tidy fixes for readability-simplify-boolean-expr to MLIR (NFC) 2022-03-07 10:41:45 +00:00
AffineExprDetail.h Adjust "end namespace" comment in MLIR to match new agree'd coding style 2021-12-08 06:05:26 +00:00
AffineMap.cpp [mlir] Bubble up tensor.extract_slice above linalg operation 2022-03-31 16:48:38 +00:00
AffineMapDetail.h [AffineMap] Move result exprs into trailing storage. NFCI. 2022-02-12 15:24:00 +01:00
AsmPrinter.cpp [mlir] Fix dumping invalid ops 2022-03-07 08:32:31 -08:00
AttributeDetail.h Apply clang-tidy fixes for llvm-qualified-auto to MLIR (NFC) 2022-01-14 02:26:26 +00:00
Attributes.cpp [mlir] Convert NamedAttribute to be a class 2021-11-18 05:39:29 +00:00
Block.cpp [mlir][NFC] Add a using for llvm::BitVector to LLVM.h 2022-01-26 21:37:23 -08:00
Builders.cpp [mlir] Make OpBuilder::createOperation to accept raw inputs 2022-03-23 22:13:48 +00:00
BuiltinAttributeInterfaces.cpp [mlir] Refactor ElementsAttr's value access API 2021-11-09 00:15:08 +00:00
BuiltinAttributes.cpp Fold Tensor.extract_slice into a constant splat. 2022-02-22 21:39:57 +00:00
BuiltinDialect.cpp [mlir] Move the Builtin FuncOp to the Func dialect 2022-03-16 17:07:03 -07:00
BuiltinTypeInterfaces.cpp [mlir] Refactor ShapedType into an interface 2022-01-12 14:12:09 -08:00
BuiltinTypes.cpp [MLIR][Arith] Canonicalize cmpf(int to fp) to cmpi 2022-02-23 14:09:20 -05:00
CMakeLists.txt Revert "[mlir] Add extensible dialects" 2022-03-03 10:30:50 +00:00
Diagnostics.cpp [mlir] Fix dumping invalid ops 2022-03-07 08:32:31 -08:00
Dialect.cpp [mlir] Add asserts when changing various MLIRContext configurations 2022-04-15 21:49:03 -07:00
Dominance.cpp [Dominators] Rewrite the dominator implementation for efficiency. NFC. 2021-06-01 14:46:37 -07:00
FunctionImplementation.cpp [mlir] Rename `OpAsmParser::OperandType` to `OpAsmParser::UnresolvedOperand` 2022-03-21 21:42:13 +01:00
FunctionInterfaces.cpp [mlir][NFC] Add a using for llvm::BitVector to LLVM.h 2022-01-26 21:37:23 -08:00
IntegerSet.cpp [MLIR] Use a shared uniquer for affine maps and integer sets. 2021-12-02 23:49:32 +01:00
IntegerSetDetail.h Adjust "end namespace" comment in MLIR to match new agree'd coding style 2021-12-08 06:05:26 +00:00
Location.cpp [mlir] Retain metadata for single loc fusedloc 2022-01-04 15:37:33 -08:00
MLIRContext.cpp [mlir] Add asserts when changing various MLIRContext configurations 2022-04-15 21:49:03 -07:00
Operation.cpp [NFC] Update comments 2022-04-15 14:33:13 -04:00
OperationSupport.cpp [mlir][CSE] Add ability to remove commutative operations 2022-04-16 21:09:47 +02:00
PatternMatch.cpp [mlir:PDL] Fix bugs in PDLPatternModule merging 2021-12-10 19:38:43 +00:00
Region.cpp [mlir] Allow RegionRange to accept ArrayRef<Region *> 2022-03-28 19:39:42 +00:00
RegionKindInterface.cpp
SubElementInterfaces.cpp [mlir] Add new SubElementAttr/SubElementType Interfaces 2021-06-10 17:23:07 -07:00
SymbolTable.cpp Adjust "end namespace" comment in MLIR to match new agree'd coding style 2021-12-08 06:05:26 +00:00
TensorEncoding.cpp [mlir][tensors] Introduce attribute interface/attribute for tensor encoding 2021-04-26 18:31:54 -07:00
TypeDetail.h Apply clang-tidy fixes for llvm-qualified-auto to MLIR (NFC) 2022-01-14 02:26:26 +00:00
TypeRange.cpp [mlir][IR] Refactor the internal implementation of Value 2021-03-03 14:33:37 -08:00
TypeUtilities.cpp [mlir][Arith] Disallow casting between scalable and fixed-length vectors 2022-02-15 17:34:42 +00:00
Types.cpp [mlir][NFC] Move several small methods from .cpp to .h to allow more aggressive inlining 2021-06-23 00:52:26 +00:00
Value.cpp [mlir][NFC] Split the non-templated bits out of IROperand into a base class 2021-06-02 12:48:37 -07:00
Verifier.cpp [mlir] Fix verification order of nested ops. 2022-04-15 04:41:10 +00:00
Visitors.cpp [MLIR] Introduce generic visitors. 2022-01-14 09:15:27 -08:00