[Mlir-commits] [mlir] [MLIR][Presburger] Implement IntegerRelation::mergeAndAlignSymbols (PR #76736)

Kunwar Grover llvmlistbot at llvm.org
Wed Jan 3 08:23:36 PST 2024


================
@@ -1288,6 +1288,37 @@ void IntegerRelation::eliminateRedundantLocalVar(unsigned posA, unsigned posB) {
   removeVar(posB);
 }
 
+void IntegerRelation::mergeAndAlignSymbols(IntegerRelation &other) {
+  assert(space.isUsingIds() && other.space.isUsingIds() &&
+         "Both relations need to have identifers to merge & align");
+
+  // First merge & align identifiers into `other` from `this`.
+  unsigned i = 0;
+  for (const Identifier identifier : space.getIds(VarKind::Symbol)) {
+    // If the identifier exists in `other`, then align it; otherwise insert it
+    // assuming it is a new identifier. Search in `other` starting at position
----------------
Groverkss wrote:

Best place would be to put it as function implementation documentation (putting it on line 1290)

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


More information about the Mlir-commits mailing list