天道酬勤,学无止境

llc

How do I use a freshly compiled LLVM tool directly from LLVM source tree?

Question I am writing a MachineFunctionPass targeting the X86 architecture which results in a modified llc binary. In order to test my modified version of llc I have created a bunch of .c programs whose MIR will be handled by my pass. For the sake of cleanliness, I have added the directory including the sources directly into LLVM's source tree, specifically in $llvm_src_dir/lib/Target/X86/$examples_dir: I have then plugged it into LLVM build system by appending the add_subdirectory() directive to $llvm_src_dir/lib/Target/X86/CMakeLists.txt. In this way, I will be able to build everything

2021-10-24 22:20:31    分类:技术分享    c++   cmake   llvm   llc

Dot file not genearting for -view-isel-dags option

Question While trying to see the SelectionDag nodes generated during the instruction selection phase using LLVM (built from sources with debug mode enabled), I am using the below command which is not creating Graphviz DOT file. llc -view-isel-dags sum.bc Instead it is creating sum.s file. Is there something I'm missing here? sum.c int sum(int x, int y) { return x+y; } sum.bc $ clang -emit-llvm sum.c -c -o sum.bc LLVM information $ llc -help-hidden | grep 'view-isel' -view-isel-dags - Pop up a window to show isel dags as they are selected $ llvm-config --build-mode Debug Answer1 Guess the

2021-10-23 16:53:43    分类:技术分享    compiler-construction   llvm   graphviz   dot   llc