Chapter 3.7 : Code analysis with maqao

Maqao is a program which analyses binaries and check if a given loop in a function is vectorized or not. If the number of load versus the number of write is efficient. Here is the maqao main page. You can download the binaries for Linux here.

Maqao can be used on the fly (such as Valgrind) but one of its powerfull funtionnalities allows us to analysis the binaries produced by the compiler without executing them. It is a static binary analysis performed by the cqa tool (Code Quality Analyser).

We will use one parameter :

The Maqao's cqa calls will be something like :
maqao.intel64 cqa fct-loops=MyFunction ./myBinary


The last parameter is always for the binary (it can be a library or a program).

Note : Maqao does not want to analyse a function if it has more than 8 branching. So you have to use it on kernel only (where the performance is needed).


Note : such as valgrind, Maqao will use the debugging symbols to give you feedback about the function and loops you want to analyse.


The report of Maqao will give several information :

Note : For each workaround, Maqao will try to evaluate the speed up of the change it suggests. But generally, this evaluation does not take account the CPU pipeline, so the real speed up can be different.


In the advanced mode, other informations are available :

Generally, the default report is fine, but the complete report is important for a ninja programmer. In the following we will take a look at both report but in our case the advanced report is really good to estimate what is going one and why this compilation is better than this one.

Sections Vector efficiency ratios and Cycles and memory resources usage will be particularly important for us to evaluate the efficiency of our functions.