Does the swift compiler have the ability to report which loops/map
s it was able to vectorize? like -vec-report
in the intel c compilers
Clang and LLVM support optimization remarks:
https://clang.llvm.org/docs/UsersManual.html#options-to-emit-optimization-reports
I'm not sure if it just works or not if you try passing something like -Xcc -Rpass=loop-vectorize
through Swift, but it's worth a shot.
i tried a
swift build -c release -Xcc -Rpass=loop-vectorize
in one of my projects but nothing extra was printed.
Necroposting here, but this nearly seems to work with the right amount of flags...
% swift build -c release -Xswiftc -Xllvm -Xswiftc -pass-remarks=loop-vectorize
Building for production...
remark: <compiler-generated>:0:0: vectorized loop (vectorization width: 2, interleaved count: 2)
remark: <compiler-generated>:0:0: vectorized loop (vectorization width: 2, interleaved count: 2)
remark: <compiler-generated>:0:0: vectorized loop (vectorization width: 2, interleaved count: 2)
remark: <compiler-generated>:0:0: vectorized loop (vectorization width: 2, interleaved count: 2)
remark: <compiler-generated>:0:0: vectorized loop (vectorization width: 2, interleaved count: 2)
remark: <compiler-generated>:0:0: vectorized loop (vectorization width: 2, interleaved count: 2)
You can see that it doesn't know where the vectorized loops are. Overall finding out this sort of stuff with llvm
is a big hunt into a lot of dark internet corners. If anyone has a better working way to see these reports I would be all about it!