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

    <tr>
        <th>Summary</th>
        <td>
            Encountered a compilation error with the function reshapeLikeShapesAreCompatible while building and running all MLIR tests
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            mlir
      </td>
    </tr>

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

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

<pre>
    Encountered an error when running the command “cmake --build . --target check-mlir”:

[4/2491] Building CXX object tools/mli....MLIRTensorDialect.dir/TensorOps.cpp.o
FAILED: tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/TensorOps.cpp.o 
......(missing the unimportant parts)
llvm-project/mlir/include/mlir/Dialect/Utils/ReshapeOpsUtils.h:137:10: error: call to function 'reshapeLikeShapesAreCompatible' that is neither visible in the template definition nor found by argument-dependent lookup
  return reshapeLikeShapesAreCompatible(
  ......

My CMake version is 3.29.0 and my Clang version is 8. I'm running them on Ubuntu 18.04 in VMware Workstation. 
I checked the header file 'ReshapeOpsUtils.h' and found that the function 'reshapeLikeShapesAreCompatible' was declared after the return statement, which might be the cause of the issue. 
So, I moved the declaration of this function before the function that call it (verifyReshapeLikeTypes), and then there were no errors during compilation. I checked the source code of the project and it seemed there were no modifications at this place. Hence, I've reported this issue.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVE2PozgQ_TXOpRQEJh9w4JBOGm2kaY3UM7M7V2OKUB1jI9ukN_9-ZZNMp7XSfvSBJsb1qt6rqieco5NGrNj6ia0PCzH53tjqVVy7P9WiMe21etbSTNqjxRaEBrTWWHjvUYOdtCZ9At8jSDMMQrfAnjkrUlbu5SDOCMtlM5FqIYHl0gt7Qg-yR3leDors_e6BPdfsac_KHUsPLL0_108rxmu-KjO2PsBTwAnZ9j9_gmneUH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