google / souper

A superoptimizer for LLVM IR
Apache License 2.0
2.17k stars 170 forks source link

Question about Souper IR's advantage compare to LLVM IR? #876

Open hstk30-hw opened 11 months ago

hstk30-hw commented 11 months ago

I see the paper:

why have we developed a new middle-end superoptimizer? First, LLVM IR is the narrow waist in a large and growing ecosystem of frontends and backends; improvements made at this level can benefit many projects and billions of end users (via, for example, Android). Second, Souper excels at generating constants, particularly for Boolean valued variables that are used to control branches. Constants ripple through the rest of the middle-end and the full benefits are not realized until constant propagation, dead code elimination, and other optimization passes have exploited them. Generating constants in the backend would leave these benefits on the table. Third, the SSA form that many modern compilers use in their middle ends is effectively a functional programming language [1] that is highly amenable to automated reasoning techniques.

I still confuse about the advantage compare to LLVM IR. Is Souper IR can make use of SAT, SMT ... tools? Or Souper IR eliminates LLVM IR's basic blocks?

hxm-cpp commented 11 months ago

your question is dumb.