| 
    MLIR 22.0.0git
    
   | 
 
This class provides utilities for computing if two operations are equivalent. More...
#include "mlir/IR/OperationSupport.h"
Public Types | |
| enum | Flags { None = 0 , IgnoreLocations = 1 , IgnoreDiscardableAttrs = 2 , IgnoreProperties = 4 } | 
Static Public Member Functions | |
| static llvm::hash_code | computeHash (Operation *op, function_ref< llvm::hash_code(Value)> hashOperands=[](Value v) { return hash_value(v);}, function_ref< llvm::hash_code(Value)> hashResults=[](Value v) { return hash_value(v);}, Flags flags=Flags::None) | 
| Compute a hash for the given operation.   | |
| static llvm::hash_code | ignoreHashValue (Value) | 
| Helper that can be used with computeHash above to ignore operation operands/result mapping.   | |
| static llvm::hash_code | directHashValue (Value v) | 
| Helper that can be used with computeHash above to ignore operation operands/result mapping.   | |
| static bool | isEquivalentTo (Operation *lhs, Operation *rhs, function_ref< LogicalResult(Value, Value)> checkEquivalent, function_ref< void(Value, Value)> markEquivalent=nullptr, Flags flags=Flags::None, function_ref< LogicalResult(ValueRange, ValueRange)> checkCommutativeEquivalent=nullptr) | 
| Compare two operations (including their regions) and return if they are equivalent.   | |
| static bool | isEquivalentTo (Operation *lhs, Operation *rhs, Flags flags) | 
| Compare two operations and return if they are equivalent.   | |
| static bool | isRegionEquivalentTo (Region *lhs, Region *rhs, function_ref< LogicalResult(Value, Value)> checkEquivalent, function_ref< void(Value, Value)> markEquivalent, OperationEquivalence::Flags flags, function_ref< LogicalResult(ValueRange, ValueRange)> checkCommutativeEquivalent=nullptr) | 
| Compare two regions (including their subregions) and return if they are equivalent.   | |
| static bool | isRegionEquivalentTo (Region *lhs, Region *rhs, OperationEquivalence::Flags flags) | 
| Compare two regions and return if they are equivalent.   | |
| static LogicalResult | ignoreValueEquivalence (Value lhs, Value rhs) | 
| Helper that can be used with isEquivalentTo above to consider ops equivalent even if their operands are not equivalent.   | |
| static LogicalResult | exactValueMatch (Value lhs, Value rhs) | 
| Helper that can be used with isEquivalentTo above to consider ops equivalent only if their operands are the exact same SSA values.   | |
This class provides utilities for computing if two operations are equivalent.
Definition at line 1320 of file OperationSupport.h.
| Enumerator | |
|---|---|
| None | |
| IgnoreLocations | |
| IgnoreDiscardableAttrs | |
| IgnoreProperties | |
Definition at line 1321 of file OperationSupport.h.
      
  | 
  static | 
Compute a hash for the given operation.
The hashOperands and hashResults callbacks are expected to return a unique hash_code for a given Value.
Definition at line 672 of file OperationSupport.cpp.
References mlir::Operation::getLoc(), mlir::Operation::getName(), mlir::Operation::getNumOperands(), mlir::Operation::getOperand(), mlir::Operation::getOperands(), mlir::Operation::getRawDictionaryAttrs(), mlir::Operation::getResults(), mlir::Operation::getResultTypes(), mlir::Operation::hashProperties(), mlir::Operation::hasTrait(), IgnoreDiscardableAttrs, IgnoreLocations, IgnoreProperties, and result.
Referenced by mlir::func::impl::DuplicateFunctionEliminationPassBase< DerivedT >::getDescription(), mlirModuleHashValue(), and mlirOperationHashValue().
      
  | 
  inlinestatic | 
Helper that can be used with computeHash above to ignore operation operands/result mapping.
Definition at line 1353 of file OperationSupport.h.
References mlir::hash_value().
Helper that can be used with isEquivalentTo above to consider ops equivalent only if their operands are the exact same SSA values.
Definition at line 1405 of file OperationSupport.h.
      
  | 
  inlinestatic | 
Helper that can be used with computeHash above to ignore operation operands/result mapping.
Definition at line 1350 of file OperationSupport.h.
Referenced by mlir::func::impl::DuplicateFunctionEliminationPassBase< DerivedT >::getPassName().
      
  | 
  inlinestatic | 
Helper that can be used with isEquivalentTo above to consider ops equivalent even if their operands are not equivalent.
Definition at line 1400 of file OperationSupport.h.
Compare two operations and return if they are equivalent.
Definition at line 897 of file OperationSupport.cpp.
References ValueEquivalenceCache::checkCommutativeEquivalent(), ValueEquivalenceCache::checkEquivalent(), isEquivalentTo(), lhs, ValueEquivalenceCache::markEquivalent(), and rhs.
      
  | 
  static | 
Compare two operations (including their regions) and return if they are equivalent.
Note: Additional information regarding value equivalence can be injected into the analysis via checkEquivalent. Typically, callers may want values that were determined to be equivalent as per markEquivalent to be reflected in checkEquivalent, unless exactValueMatch or a different equivalence relationship is desired.
Definition at line 829 of file OperationSupport.cpp.
References mlir::Value::getType(), IgnoreDiscardableAttrs, IgnoreLocations, IgnoreProperties, isRegionEquivalentTo(), lhs, and rhs.
Referenced by haveNoReadsAfterWriteExceptSameIndex(), isEquivalentTo(), and isRegionEquivalentTo().
      
  | 
  static | 
Compare two regions (including their subregions) and return if they are equivalent.
See also isEquivalentTo for details.
Definition at line 709 of file OperationSupport.cpp.
References mlir::Block::getArguments(), mlir::Value::getLoc(), mlir::Block::getNumArguments(), mlir::Operation::getSuccessors(), mlir::Value::getType(), IgnoreLocations, isEquivalentTo(), lhs, and rhs.
Referenced by isEquivalentTo(), and isRegionEquivalentTo().
      
  | 
  static | 
Compare two regions and return if they are equivalent.
Definition at line 812 of file OperationSupport.cpp.
References ValueEquivalenceCache::checkCommutativeEquivalent(), ValueEquivalenceCache::checkEquivalent(), isRegionEquivalentTo(), lhs, ValueEquivalenceCache::markEquivalent(), and rhs.