| Issue |
83482
|
| Summary |
scf-for-loop-range-folding does not multiply lower bound
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
superlopuh
|
Minimal example:
``` mlir
func.func private @foo(index) -> ()
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%c2 = arith.constant 2 : index
%c3 = arith.constant 3 : index
%c6 = arith.constant 6 : index
scf.for %i = %c1 to %c6 step %c2 {
%val = arith.muli %i, %c3 : index
func.call @foo(%val) : (index) -> ()
}
// mlir-opt --scf-for-loop-range-folding --canonicalize
func.func private @foo(index)
%c6 = arith.constant 6 : index
%c18 = arith.constant 18 : index
%c1 = arith.constant 1 : index
scf.for %arg0 = %c1 to %c18 step %c6 {
func.call @foo(%arg0) : (index) -> ()
}
```
In Python syntax:
```
a = [i * 3 for i in range(1, 6, 2)]
b = list(range(3, 18, 6))
```
Both `a` and `b` are `[3, 9, 15]`
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs