<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/83482>83482</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            scf-for-loop-range-folding does not multiply lower bound
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          superlopuh
      </td>
    </tr>
</table>

<pre>
    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]`
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVE2PmzAQ_TXmMiIyw0fgwGHTNFIPlfoXDBhwZWxkm91Nf31lkzTJLl1tVSlyjHnz5jFvxsxaMSjOa5IfSH6M2OJGbWq7zNxIPS9j1OjuXH8XSkxMAn9l0yw5SZ8IPRJ6XQu6_mCSwqxn_aLanV9gNuKZOQ4ko73WBEuhOv5KsIKYpF-BYEmweqDDvKVA0iMwI9y4a7WyjikH_vAJ1vA_yGQLmWwhcQuJW8h0C5luIYstZPEOGVbb9rteGyCYixC2yncaVibr-AwXofvDGgMA_uiZybtE0yJFYCH4Ba56HxJCKH_LpLyVfaXxdffgj33YHx8NORE8BXNjPTuIY9v2ca9NLLWeY8PUwONey06oAeK4ZUor0TIpfvF7mk-0xNs2-GR5fR3LzT4o_6Nl3prGzEDf-5aUN-OKe-O2LfAk_-jBdbruZX1T8OPsRq3AnpVjr3-byPWRrbLzg2-bJ0jBf5EAoSB4R7BMfCsVfkGvIL_kbkKgFNYRLK_Y1MOS8hJR3RQ_Jj1oNwIpKPMXA1Od3zdhb7jfk_wQmKpAl_ucBY26Ou2qtGIRr5M9rTBLUppGY82rPkNeNlVetWXT9A1vs2a_zxMs2qrnZSRqpJhRxAqTJKfpLqOM9fsuzfu2SWiJJKN8YkLupHyedtoMkbB24XWZZiVGkjVc2nANIir-AuElQfS3oql9TNwsgyUZ9eWwNxYnnOT1BxPRaW5BaQfTIp2Y5RmkfuEGGr2oLlqMrEfnZustDIM2CDcuza7VE8GTT3P5i2ejf_LWETwFcZbgKYj_HQAA__8byaF5">