| 62 | // Translate Compiler::OptimizationLevel to llvm::PassBuilder version |
| 63 | #if LLVM_VERSION_MAJOR >= 13 |
| 64 | static inline const char * |
| 65 | toLLVMLevel(WasmEdge::CompilerConfigure::OptimizationLevel Level) noexcept { |
| 66 | using OL = WasmEdge::CompilerConfigure::OptimizationLevel; |
| 67 | switch (Level) { |
| 68 | case OL::O0: |
| 69 | return "default<O0>,function(tailcallelim)"; |
| 70 | case OL::O1: |
| 71 | return "default<O1>,function(tailcallelim)"; |
| 72 | case OL::O2: |
| 73 | return "default<O2>"; |
| 74 | case OL::O3: |
| 75 | return "default<O3>"; |
| 76 | case OL::Os: |
| 77 | return "default<Os>"; |
| 78 | case OL::Oz: |
| 79 | return "default<Oz>"; |
| 80 | default: |
| 81 | assumingUnreachable(); |
| 82 | } |
| 83 | } |
| 84 | #else |
| 85 | static inline std::pair<unsigned int, unsigned int> |
| 86 | toLLVMLevel(WasmEdge::CompilerConfigure::OptimizationLevel Level) noexcept { |