Intel Architecture Code Analyzer (IACA) is a now-discontinued static analysis tool designed to optimize instruction scheduling on Intel processors. It analyzes compiled binaries with injected markers, allowing for insights into code execution patterns and resource utilization.
C/C :
#include "iacaMarks.h" while (cond) { IACA_START // Loop body IACA_END }
Assembly (x86):
mov ebx, 111 ; Start marker bytes db 0x64, 0x67, 0x90 ; Start marker bytes .innermostlooplabel: // Loop body jne .innermostlooplabel ; Conditional branch backwards to top of loop mov ebx, 222 ; End marker bytes db 0x64, 0x67, 0x90 ; End marker bytes
Run IACA with the following command:
iaca.sh -<bitness> -arch <architecture> -graph <output file> <binary>
Example:
iaca.sh -64 -arch HSW -graph insndeps.dot foo
IACA generates two types of output:
Throughput Analysis Report:
Graphviz Dependency Graph:
Assembly Snippet:
.L2: vmovaps ymm1, [rdi+rax] ;L2 vfmadd231ps ymm1, ymm2, [rsi+rax] ;L2 vmovaps [rdx+rax], ymm1 ; S1 add rax, 32 ; ADD jne .L2 ; JMP
Output (portion):
Intel(R) Architecture Code Analyzer Version - 2.1 ... Throughput Analysis Report -------------------------- Block Throughput: 1.55 Cycles Throughput Bottleneck: FrontEnd, PORT2_AGU, PORT3_AGU
The report identifies the bottleneck as the frontend and two AGUs on Haswell architecture.
The above is the detailed content of How Can IACA Help Optimize Instruction Scheduling for Intel Processors?. For more information, please follow other related articles on the PHP Chinese website!