Author Topic: LLVM-MCA Will Analyze ur Machine Code, Help Analyze Potential Performance Issues  (Read 1609 times)


  • Hero Member
  • *****
  • Posts: 724
Just curiosity.
Does FPC have or need something similar?


LLVM-MCA Will Analyze Your Machine Code, Help Analyze Potential Performance Issues
Written by Michael Larabel in LLVM on 20 March 2018 at 09:00 AM EDT.

One of the tools merged to LLVM SVN/Git earlier this month for the LLVM 7.0 cycle is LLVM-MCA. The LLVM-MCA tool is a machine code analyzer that estimates how the given machine code would perform on a specific CPU and attempt to report possible bottlenecks.

The LLVM-MCA analysis tool uses information already used within LLVM about a given CPU family's scheduler model and other information to try to statically measure how the machine code would carry out on a particular CPU, even going as far as estimating the instructions per cycle and possible resource pressure.

The MCA tool looks at throughput and resource consumption of the supplied machine code and tries to diagnose possible performance issues. LLVM-MCA can analyze against an arbitrary CPU using the -march/-mcpu options just as you would use with Clang.

The LLVM Machine Code Analyzer was merged earlier this month and will be part of the LLVM 7.0 release due later in 2018. Since its initial merging, LLVM-MCA has seen routine activity to further enhance its capabilities.

Certainly an interesting tool for any developers wishing to analyze the implications of their machine code on different CPU microarchitectures. It will certainly be interesting to see where LLVM-MCA heads in the weeks/months ahead.


  • Hero Member
  • *****
  • Posts: 7954
Experiment with the llvm back-end? Ask Jonas to get it working. It is already in trunk, but far from complete.
Hamlet 1.4 (nothing wrong with the Danish, btw)


  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7061
For specific short piece of code (like optimized assembler) you can use INTEL's IACA. it statically analyses assembler between two markers.