Is it easy to achieve an O3 optimization level using LLVM directly?

Is it easy to achieve a high level of optimization with LLVM?

To give a concrete example, suppose I have a simple lanuage that I want to write to the compiler.

  • simple functions
  • simple structures
  • tables
  • pointers (with arithmetic)
  • management structures
  • and etc.

I can easily compile for compilation and use clang -O3. Is the LLVM API easy to use for this purpose?

+5
source share
2 answers

, , ( , LLVM IR) , Clang backend , IR LLVM . (, , ) opt, API ++, LLVM . . tutorial . :

  • LLVM IR , C, API . C, , AST C . , .
  • ( , Clang , , IR, ). , IR ( ). , , .
  • . Clang C, : C-, Clang , IR , .
  • , , (.. #define s, , ), . , (, , , C - AFAIK, ) , pure/readonly, (, ). , .
+6

LLVM , O3- API.

0

All Articles