Commutative ops were previously folded with a special rule in OperationFolder. This change turns the folding into a proper OpTrait folder.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
| Paths 
 |  Differential  D155687  
[mlir][IR] Implement proper folder for `IsCommutative` trait ClosedPublic Authored by springerm on Jul 19 2023, 2:46 AM. 
Details Summary Commutative ops were previously folded with a special rule in OperationFolder. This change turns the folding into a proper OpTrait folder. 
Diff Detail 
 Event Timelinemehdi_amini added inline comments. 
 This revision is now accepted and ready to land.Jul 19 2023, 11:44 AM Closed by commit rGdd115e5a9bc7: [mlir][IR] Implement proper folder for `IsCommutative` trait (authored by springerm).  ·  Explain WhyJul 20 2023, 1:20 AM This revision was automatically updated to reflect the committed changes. springerm marked an inline comment as done. 
Revision Contents 
Diff 542362 mlir/include/mlir/IR/OpDefinition.h
 mlir/lib/IR/Operation.cpp
 mlir/lib/Transforms/Utils/FoldUtils.cpp
 mlir/test/Conversion/FuncToLLVM/calling-convention.mlir
 mlir/test/Conversion/TensorToLinalg/tensor-ops-to-linalg.mlir
 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Can we make it llvm::find_if(op->getOpOperands(), isConstant); ?