[Mlir-commits] [mlir] [MLIR][Presburger] Make IntegerRelation::convertVarKind consistent wi… (PR #67323)
Bharathi Ramana Joshi
llvmlistbot at llvm.org
Fri Sep 29 01:01:01 PDT 2023
================
@@ -1317,31 +1318,43 @@ void IntegerRelation::removeRedundantLocalVars() {
}
}
-void IntegerRelation::convertVarKind(VarKind srcKind, unsigned varStart,
- unsigned varLimit, VarKind dstKind,
- unsigned pos) {
- assert(varLimit <= getNumVarKind(srcKind) && "Invalid id range");
+void IntegerRelation::convertVarKind(VarKind srcKind, unsigned srcPos,
+ unsigned num, VarKind dstKind,
+ unsigned dstPos) {
+ unsigned varLimit = srcPos + num;
+ assert(srcKind != dstKind && "cannot convert variables to the same kind");
+ assert(varLimit <= getNumVarKind(srcKind) &&
+ "invalid range for source variables");
+ assert(dstPos <= getNumVarKind(dstKind) &&
+ "invalid position for destination variables");
- if (varStart >= varLimit)
+ if (srcPos >= varLimit)
return;
+ // Save the space as the insert/delete vars operations affect the identifier
+ // information in the space.
+ PresburgerSpace oldSpace = space;
----------------
iambrj wrote:
Okay, sounds good. Will send a patch implementing identifier preservation.
https://github.com/llvm/llvm-project/pull/67323
More information about the Mlir-commits
mailing list