Is there a webpage listing LLVM optimizations?

I have seen many optimization shortcuts, for example.

dce, inline, constmerge, constprop, dse, licm, gvn, instcombine, mem2reg, scalarrepl

While I can conclude that dce is the destruction of dead code, I have problems with many others.

Is there a web page with a list of LLVM optimizations with descriptions of what exactly each of them does?

Regards, Roay

+4
source share
1 answer

The LLVM documentation contains a list of analysis and conversion . Those you list are subject to conversion. Reflect on sometimes brief documentation:

  • inline built-in functions (duh!).
  • constmerge de-duplicates identical constants.
  • constprop performs simple constant folding (only commands with constant arguments)
  • dse eliminates obviously meaningless entries in memory (the equivalent of a = 1; a = 2;a = 2; ).
  • licm , a loop motion with an invariant loop, moves computations that are the same at each iteration of the loops, so that they are executed only once.
  • GVN is a common abbreviation for global numbering .
  • instcombine replaces several instructions with one equivalent instruction (for example, the equivalent of a + 1 + 1a + 2 ).
  • mem2reg converts stack allocations to SSA registers. The Front-end is much simpler if they just allocate space for local users through alloca and use them as pointers, but optimization goes through work on the SSA, so this passage becomes as large as the alloca in the SSA.
  • scalarrepl replaces aggregate types with separate members (for example, instead of juggling a structure object with two i32 members, use two i32 registers).
+4
source

Source: https://habr.com/ru/post/1479734/


All Articles