├── .gitignore ├── CMakeLists.txt ├── Chapter_01 ├── add.c ├── main.c └── readme.txt ├── Chapter_02 ├── README ├── arith.cpp ├── function.cpp ├── functionArgs.cpp ├── functionBlock.cpp ├── global.cpp ├── ifelse.cpp ├── loop.cpp ├── module.cpp ├── return.cpp ├── run_arith.sh ├── run_function.sh ├── run_functionArgs.sh ├── run_functionBlock.sh ├── run_global.sh ├── run_ifelse.sh ├── run_loop.sh ├── run_module.sh └── run_return.sh ├── Chapter_03 ├── README ├── extract.cpp ├── gep.cpp ├── insert.cpp ├── load.cpp ├── run_extract.sh ├── run_gep.sh ├── run_insert.sh ├── run_load.sh ├── run_store.sh └── store.cpp ├── Chapter_04 ├── FnNamePrint │ ├── CMakeLists.txt │ ├── FnNamePrint.cpp │ └── FnNamePrint.exports ├── FnNamePrint_newpm │ ├── FnNamePrint.cpp │ ├── FnNamePrint.h │ ├── README.md │ └── test.sh ├── Hello.cpp ├── README.md ├── clean.sh ├── hello.c ├── instcombile.ll ├── old_pass.sh ├── opt_hello.sh ├── opt_test.sh ├── test.ll └── test_instcombile.sh ├── Chapter_05 ├── intrinsic.cpp ├── intrinsic.ll ├── licm.ll ├── licm_opt.ll ├── scalevl.ll ├── test_intrinsic.sh ├── test_licm.sh └── test_scalevl.sh ├── Chapter_06 ├── hadd.ll ├── hadd.s ├── hadd.sh ├── isel.sh ├── machineinstrs.sh ├── mc-encoding.sh ├── outfile ├── regalloc.sh ├── sched.sh ├── show-inst.sh ├── test.ll ├── test.s ├── test0.s ├── test1.s └── test3.s ├── README.md ├── clean.sh ├── demo.sh ├── hello.c ├── module.cpp └── tsf.sh /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/.gitignore -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/CMakeLists.txt -------------------------------------------------------------------------------- /Chapter_01/add.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_01/add.c -------------------------------------------------------------------------------- /Chapter_01/main.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_01/main.c -------------------------------------------------------------------------------- /Chapter_01/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_01/readme.txt -------------------------------------------------------------------------------- /Chapter_02/README: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_02/README -------------------------------------------------------------------------------- /Chapter_02/arith.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_02/arith.cpp -------------------------------------------------------------------------------- /Chapter_02/function.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_02/function.cpp -------------------------------------------------------------------------------- /Chapter_02/functionArgs.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_02/functionArgs.cpp -------------------------------------------------------------------------------- /Chapter_02/functionBlock.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_02/functionBlock.cpp -------------------------------------------------------------------------------- /Chapter_02/global.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_02/global.cpp -------------------------------------------------------------------------------- /Chapter_02/ifelse.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_02/ifelse.cpp -------------------------------------------------------------------------------- /Chapter_02/loop.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_02/loop.cpp -------------------------------------------------------------------------------- /Chapter_02/module.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_02/module.cpp -------------------------------------------------------------------------------- /Chapter_02/return.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_02/return.cpp -------------------------------------------------------------------------------- /Chapter_02/run_arith.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_02/run_arith.sh -------------------------------------------------------------------------------- /Chapter_02/run_function.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_02/run_function.sh -------------------------------------------------------------------------------- /Chapter_02/run_functionArgs.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_02/run_functionArgs.sh -------------------------------------------------------------------------------- /Chapter_02/run_functionBlock.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_02/run_functionBlock.sh -------------------------------------------------------------------------------- /Chapter_02/run_global.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_02/run_global.sh -------------------------------------------------------------------------------- /Chapter_02/run_ifelse.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_02/run_ifelse.sh -------------------------------------------------------------------------------- /Chapter_02/run_loop.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_02/run_loop.sh -------------------------------------------------------------------------------- /Chapter_02/run_module.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_02/run_module.sh -------------------------------------------------------------------------------- /Chapter_02/run_return.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_02/run_return.sh -------------------------------------------------------------------------------- /Chapter_03/README: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_03/README -------------------------------------------------------------------------------- /Chapter_03/extract.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_03/extract.cpp -------------------------------------------------------------------------------- /Chapter_03/gep.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_03/gep.cpp -------------------------------------------------------------------------------- /Chapter_03/insert.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_03/insert.cpp -------------------------------------------------------------------------------- /Chapter_03/load.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_03/load.cpp -------------------------------------------------------------------------------- /Chapter_03/run_extract.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_03/run_extract.sh -------------------------------------------------------------------------------- /Chapter_03/run_gep.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_03/run_gep.sh -------------------------------------------------------------------------------- /Chapter_03/run_insert.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_03/run_insert.sh -------------------------------------------------------------------------------- /Chapter_03/run_load.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_03/run_load.sh -------------------------------------------------------------------------------- /Chapter_03/run_store.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_03/run_store.sh -------------------------------------------------------------------------------- /Chapter_03/store.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_03/store.cpp -------------------------------------------------------------------------------- /Chapter_04/FnNamePrint/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_04/FnNamePrint/CMakeLists.txt -------------------------------------------------------------------------------- /Chapter_04/FnNamePrint/FnNamePrint.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_04/FnNamePrint/FnNamePrint.cpp -------------------------------------------------------------------------------- /Chapter_04/FnNamePrint/FnNamePrint.exports: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Chapter_04/FnNamePrint_newpm/FnNamePrint.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_04/FnNamePrint_newpm/FnNamePrint.cpp -------------------------------------------------------------------------------- /Chapter_04/FnNamePrint_newpm/FnNamePrint.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_04/FnNamePrint_newpm/FnNamePrint.h -------------------------------------------------------------------------------- /Chapter_04/FnNamePrint_newpm/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_04/FnNamePrint_newpm/README.md -------------------------------------------------------------------------------- /Chapter_04/FnNamePrint_newpm/test.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_04/FnNamePrint_newpm/test.sh -------------------------------------------------------------------------------- /Chapter_04/Hello.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_04/Hello.cpp -------------------------------------------------------------------------------- /Chapter_04/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_04/README.md -------------------------------------------------------------------------------- /Chapter_04/clean.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_04/clean.sh -------------------------------------------------------------------------------- /Chapter_04/hello.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_04/hello.c -------------------------------------------------------------------------------- /Chapter_04/instcombile.ll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_04/instcombile.ll -------------------------------------------------------------------------------- /Chapter_04/old_pass.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_04/old_pass.sh -------------------------------------------------------------------------------- /Chapter_04/opt_hello.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_04/opt_hello.sh -------------------------------------------------------------------------------- /Chapter_04/opt_test.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_04/opt_test.sh -------------------------------------------------------------------------------- /Chapter_04/test.ll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_04/test.ll -------------------------------------------------------------------------------- /Chapter_04/test_instcombile.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_04/test_instcombile.sh -------------------------------------------------------------------------------- /Chapter_05/intrinsic.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_05/intrinsic.cpp -------------------------------------------------------------------------------- /Chapter_05/intrinsic.ll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_05/intrinsic.ll -------------------------------------------------------------------------------- /Chapter_05/licm.ll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_05/licm.ll -------------------------------------------------------------------------------- /Chapter_05/licm_opt.ll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_05/licm_opt.ll -------------------------------------------------------------------------------- /Chapter_05/scalevl.ll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_05/scalevl.ll -------------------------------------------------------------------------------- /Chapter_05/test_intrinsic.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_05/test_intrinsic.sh -------------------------------------------------------------------------------- /Chapter_05/test_licm.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_05/test_licm.sh -------------------------------------------------------------------------------- /Chapter_05/test_scalevl.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_05/test_scalevl.sh -------------------------------------------------------------------------------- /Chapter_06/hadd.ll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_06/hadd.ll -------------------------------------------------------------------------------- /Chapter_06/hadd.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_06/hadd.s -------------------------------------------------------------------------------- /Chapter_06/hadd.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_06/hadd.sh -------------------------------------------------------------------------------- /Chapter_06/isel.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | llc -view-isel-dags test.ll 4 | -------------------------------------------------------------------------------- /Chapter_06/machineinstrs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | llc --print-after-isel test.ll > outfile 2>&1 4 | -------------------------------------------------------------------------------- /Chapter_06/mc-encoding.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | llc test.ll -show-mc-encoding -o - 4 | -------------------------------------------------------------------------------- /Chapter_06/outfile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_06/outfile -------------------------------------------------------------------------------- /Chapter_06/regalloc.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_06/regalloc.sh -------------------------------------------------------------------------------- /Chapter_06/sched.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | llc -view-sched-dags test.ll 4 | -------------------------------------------------------------------------------- /Chapter_06/show-inst.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | llc test.ll -asm-show-inst -o - 4 | -------------------------------------------------------------------------------- /Chapter_06/test.ll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_06/test.ll -------------------------------------------------------------------------------- /Chapter_06/test.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_06/test.s -------------------------------------------------------------------------------- /Chapter_06/test0.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_06/test0.s -------------------------------------------------------------------------------- /Chapter_06/test1.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_06/test1.s -------------------------------------------------------------------------------- /Chapter_06/test3.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/Chapter_06/test3.s -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/README.md -------------------------------------------------------------------------------- /clean.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/clean.sh -------------------------------------------------------------------------------- /demo.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/demo.sh -------------------------------------------------------------------------------- /hello.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/hello.c -------------------------------------------------------------------------------- /module.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/module.cpp -------------------------------------------------------------------------------- /tsf.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigconvience/LLVM-Essentials-13/HEAD/tsf.sh --------------------------------------------------------------------------------