[Mlir-commits] [mlir] mlir/Presburger: optimize to avoid creating copies (PR #97897)

Ramkumar Ramachandra llvmlistbot at llvm.org
Mon Jul 15 11:41:54 PDT 2024


================
@@ -1038,7 +1044,7 @@ PresburgerRelation PresburgerRelation::simplify() const {
 }
 
 bool PresburgerRelation::isFullDim() const {
-  return llvm::any_of(getAllDisjuncts(), [&](IntegerRelation disjunct) {
+  return llvm::any_of(getAllDisjuncts(), [](IntegerRelation disjunct) {
----------------
artagnon wrote:

It can't take disjunct by const reference, because isFullDim isn't marked const, and cannot be marked const. Mutating the disjunct would change the behavior, and PresburgerRelation::isFullDim is marked const, so I wouldn't want to make this change as part of this patch.

https://github.com/llvm/llvm-project/pull/97897


More information about the Mlir-commits mailing list