[Mlir-commits] [mlir] [mlir][scf] Uplift `scf.while` to `scf.for` (PR #76108)
Mehdi Amini
llvmlistbot at llvm.org
Thu Dec 21 01:35:03 PST 2023
================
@@ -154,4 +154,20 @@ def SCFForToWhileLoop : Pass<"scf-for-to-while"> {
}];
}
+def SCFUpliftWhileToFor : Pass<"scf-uplift-while-to-for"> {
+ let summary = "Uplift scf.while ops to scf.for";
+ let description = [{
+ This pass tries to uplift `scf.while` ops to `scf.for` if they have a
+ compatible form. `scf.while` are left unchanged if uplifting is not
+ possible.
+ }];
+
+ let options = [
+ Option<"indexBitWidth", "index-bitwidth", "unsigned",
+ /*default=*/"64",
+ "Bitwidth of index type.">,
+ ];
----------------
joker-eph wrote:
Do we really need this?
Even if the while loop would be using i32 or i16, couldn't we just turn these into index?
But also: why do we convert to index type? The SCF for supports "AnySignlessIntegerOrIndex" for the bounds.
https://github.com/llvm/llvm-project/pull/76108
More information about the Mlir-commits
mailing list