Is CFunc.get_llvm() the IR after optimizations or before optimizations?

When inspecting a function, is the LLVM IR (or flowgraph generated with graphviz) after optimization or before optimization passes? It kinda seems like it is after, since I’m e.g. seeing loop unrolling, but want to be sure.

Context: writing an article on Numba, partially using SIMD, and want ways to visualize optimized versions. Unfortunately perf stat can’t show integer SIMD operations, so looking at alternative ways for readers to get a sense of what different code variants are doing.

I don’t know the answer, but testing with these might get you on the road. You can dump out both optimized and non-optimized LLVM

@itamarst, Yes the graph are shown after all the optimization passes. It’s creating the graph from the finalized LLVM IR for machine code-generation.

1 Like