Lli error: expected top-level entity

Hi all,
I used mlir-translate --mlir-to-llvmir to get a LLVMIR file, and I tried to run it by lli.
I got this error.

Can you check which version of lli you’re using? (/bin/lli --version)?

Here is the information.

That’s the issue: you need to use the same version as MLIR, you likely should just build it with MLIR

I followed the MLIR tutorial to build it, but there is not lli in my llvm-project/build/bin.

I wonder how could I check the version of the LLVM use, so that I can match the version requierment.

lli is not build by default with MLIR, apparently. Run ninja lli in the build directory and then you’ll have it.

Thanks a lot!
I solved this problem, and met another problem.
I will try to solve it.

Hi ! I meet the same error. could you please tell me how to solve it?
屏幕截图 2022-05-08 085810
if I delete these in .ll, then the error is solve. However, I think it not a good way to solve problem, because .ll file is generate by LLVM.I am so confused now