[Mlir-commits] [mlir] [MLIR][Presburger] Implement Matrix::moveColumns (PR #68362)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Jan 3 10:04:31 PST 2024
================
@@ -230,6 +230,47 @@ void Matrix<T>::fillRow(unsigned row, const T &value) {
at(row, col) = value;
}
+// moveColumns is implemented by moving the columns adjacent to the source range
+// [srcPos, srcPos + num) to their final position. When moving right (i.e.
+// dstPos > srcPos), the range of the adjacent columns is [srcPos + num,
+// dstPos + num). When moving left (i.e. dstPos < srcPos) the range of the
+// adjacent columns is [dstPos, srcPos). First, zeroed out columns are inserted
+// in the final positions of the adjacent columns. Then, the zeroed out columns
+// are swapped with the adjacent columns. Finally, the now redundant adjacent
+// columns are deleted.
----------------
Abhinav271828 wrote:
Ohh I'm sorry, I misunderstood the code. Yes, swapping is better, my mistake.
In this case, I would suggest that "redundant" on line 239 be changed to "zero" or "null."
https://github.com/llvm/llvm-project/pull/68362
More information about the Mlir-commits
mailing list