I’ve recently switched my laptop from a Dell with a 12th Gen Intel i7-1255U to an Apple laptop with an M1 chip. The M1 is much quicker to compile LLVM + MLIR from scratch with 20 minutes versus 40 minutes.
However, running the tests via cmake --build . --target check-mlir takes longer on the M1. It takes about 50 seconds there whereas the Dell does it in less than 20. I suspect this is due to some security setting on Mac. Anyone here who knows what I should do on the Mac to speed things up?
Something you can do also is use the make flag -DLLVM_LIT_ARGS="-v --time-trace-output=$PWD/lit_times.json" when you configure LLVM, then any lit run will generate a trace that can be visualized in https://ui.perfetto.dev
For example:
Since it took 20 minutes to build (all of LLVM + MLIR) on your M1, I’m guessing it’s a release build. 50s is a lot for the testing time. As an alternative to what Mehdi mentioned, you can time the tests on the cmd-line with:
It turns out that it was caused by -DCMAKE_BUILD_TYPE=Debug. I did set it to Release earlier, but did not do a clean rebuild. Now after a clean rebuild, it’s fixed. Time is about 10 seconds now.