llvm-project
d59d0b95 - [mlir][affine][NFC] Avoid copying relations in checkAccessDependence (#243286)

Commit
1 day ago
[mlir][affine][NFC] Avoid copying relations in checkAccessDependence (#243286) checkAccessDependence takes the source and destination access relations by value because it composes them in place, and its only caller, checkMemrefAccessDependence, does not use its relations afterwards. Moving them into the call would not help: IntegerRelation declares a virtual destructor and no move operations, so a move still copies the constraint matrices. Take the relations by rvalue reference instead. A caller that still needs a relation after the check has to pass a copy explicitly. It also copied the dependence polyhedron into a local FlatAffineValueConstraints before checking whether the caller wants it. Build it only when the caller does; most callers of checkMemrefAccessDependence pass no dependenceConstraints. Fixes static analyzer complaints about using copy vs move and passing by value. Assisted-by: Cursor
Author
Parents
Loading