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

    <tr>
        <th>Summary</th>
        <td>
            [MLIR]Lower affine successfully but the error message is still output
        </td>
    </tr>

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

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

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

<pre>
    When I use cmd `mlir-opt temp.mlir -lower-affine`, the lowering succeeds, but it outputs some errors.       
Whether there is any problem with the diagnoser? I’m confused about this, why lowering can succeed despite the error reported by the diagnoser?

Minimized test case:
```
#map0 = affine_map<() -> (13)>
#map1 = affine_map<() -> (21)>
#map2 = affine_map<(d0)[s0] -> (d0 * s0)>
#map3 = affine_map<() -> (3)>
#map4 = affine_map<(d0)[s0] -> (d0 mod s0)>
#map5 = affine_map<(d0)[s0] -> (d0 floordiv s0)>
module {
  func.func @test_greater(%arg0: tensor<13x21x1xf32>, %arg1: tensor<13x21x3xf32>) {
    %4 = affine.apply #map0()
    %5 = affine.apply #map1()
    %6 = affine.apply #map2(%4)[%5]
    %7 = affine.apply #map3()
    %8 = affine.apply #map2(%6)[%7]
    affine.for %arg2 = 0 to %8 {
      %16 = affine.apply #map4(%arg2)[%7]
    }
    return
  }
}
```
The error information is like :
```
crash_affine_data_copy.mlir:27:13: error: semi-affine expressions (modulo by non-const) are not supported
      %16 = affine.apply #map4(%arg2)[%7]
            ^
#map = affine_map<(d0)[s0] -> (d0 mod s0)>
module {
  func.func @test_greater(%arg0: tensor<13x21x1xf32>, %arg1: tensor<13x21x3xf32>) {
    %c13 = arith.constant 13 : index
    %c21 = arith.constant 21 : index
    %0 = arith.muli %c13, %c21 : index
    %c3 = arith.constant 3 : index
    %1 = arith.muli %0, %c3 : index
    %c0 = arith.constant 0 : index
    %c819 = arith.constant 819 : index
    %c1 = arith.constant 1 : index
    scf.for %arg2 = %c0 to %c819 step %c1 {
      %2 = affine.apply #map(%arg2)[%c3]
    }
    return
  }
}
```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzNVk2PozgQ_TXOxUqETSBw4NBfkVqauaxWWmkvLQNF4hmDkW2mO_vrt2xIOpkGtUY7h0WI-KOq3nO5_OJS16firyN09JkOFmjV1pSkUaukWeveUQdtv_E9ulb6FcxaNI3sAE0If6DuCDQMy-5A7VBVALX1E-XgqHRUD64fnKVWt0DBGG3sho4PiR5JdIfIGMP4QAaotFR0J9obXSpo6at0xwBRS3HotAVDnvbk_oHke_pMnjjJIpLnLa101yD3mooSAdFDBg6vx9M7uUp0Z4K0BttLByF0IEUN9No4nCpPPwHG-5Ho-P0qO9nKf9DQgXUY1AKJpzmfkvEduzxuRR9REj_SMWcv2CfxA-EZ4Tldk_iJYpvF2MP2tRf71Iuzj1581quOvGVybyOSPF78ayTG76iNPoaJPwWfYbz9NexW17PYya-FaZTWppY_foqF0QcFlOzuxz6lzdBVG_-hZBv5rXs5GBAO99evLBHmEOE-4qZ2VuOeP7D4jbM39tbE3EfFYhqt2IxVfLHKryGpd7lOy0b0vTrRqS7GlN4YJ0vGbMY4XTLm45K2Y8p8WEzajetuyTWewck-wUkvOLsbnMmjwcM1pm6szog6PYW9TlWAYotr2l62iS_Akd1Vx4AbTHfuX6beG7cn9c-LDMgO-bbCSd15LVLyO1bRwvmujLDHl6lUa-HES6X7U5BKdOE7_ODRxnIJoX3DQisn-aTw1huwFoGsr-VQsdqrT6e7NeqZdb6cBGpipx0KVz_q02_M2Pkhyc0J_K_n-P9z9io2KZnBv5FNyKnoHA2jd7jVNbzd2nM2Zx9G5-yjK-t2UHLCnAhXi37VLK0lVmwGJTpjLC4lmoOIlqwzls_Zj8OzHrOZml2wrZoPIjAyHIUggFsH_TnuB1ngSzU-U-JV_NtUYQUFS9M0y1iSbld1Edd5nIuVk05BgWhfvzz_gWBf_AVjYjdeMKxtBoUky3AVO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