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

    <tr>
        <th>Summary</th>
        <td>
            [Flang] The line displayed in the remark of loop-vectorize is incorrect
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            flang
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          m-saito-fj
      </td>
    </tr>
</table>

<pre>
    When compiling the following code with flang (20.1.0) using `-O3 -fopenmp -Rpass=loop-vectorize`, the line displayed in the remark is incorrect. 
The line number of the loop head `do i=1,100` is expected, but the line number of `if (flag==1) then` is output.

```Fortran
subroutine baz()
  implicit none
  integer :: i,flag
  real(8), dimension(100) :: a,b,c
  real(8) pm

  !$omp simd
  do i=1,100
    a(i) = b(i) * c(i) + a(i)
    flag = a(i) - 30

    pm = a(i) + c(i)

    if (flag==1) then
      b(i) = pm
 endif
  enddo
endsubroutine
```

The following is the IR (partial) before LoopVectorizePass.  
I think the problem is that `!36` does not contain DILocation.

```LLVM
...
omp_loop.inc: ; preds = %omp.simd.region1, %omp_loop.body
  %exitcond.not = icmp eq i64 %indvars.iv.next, 100
  br i1 %exitcond.not, label %omp_loop.after, label %omp_loop.body, !llvm.loop !36
...
!36 = distinct !{!36, !37, !38}
!37 = !{!"llvm.loop.parallel_accesses", !28}
!38 = !{!"llvm.loop.vectorize.enable", i1 true}
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyEVduK4zgQ_RrlpYiRZefihzykOwQGetllGGYfB1kqJzUjS1pJ7rl8_SLZ6XQ3ewFDIlWdU7fjsoyRLhbxwDYPbHNaySldXTiM6ygpufXwddU7_fPw5xUtKDd6MmQvkK4IgzPGfc8n5TTCd0pXGIy0F2BiL3hVV5yJDqaYXdiWr39vYD04j3b0sP7oZYysORnn_PoZVXKBfiHbciYeC70hi6ApeiN_ogay5TbgK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