├── README.md └── example ├── chapter-1-1 ├── add.bc ├── add.c ├── add.ll ├── main.bc ├── main.c ├── output.bc └── output.s ├── chapter-2-1 └── toy.cpp ├── chapter-2-2 └── toy.cpp ├── chapter-2-3 └── toy.cpp ├── chapter-2-4 └── toy.cpp ├── chapter-2-5 └── toy.cpp ├── chapter-2-6 └── toy.cpp ├── chapter-2-7 └── toy.cpp ├── chapter-2-8-if-else └── toy.cpp ├── chapter-2-9-loop └── toy.cpp ├── chapter-3-1 └── toy.cpp ├── chapter-3-2 └── toy.cpp ├── chapter-3-3 └── toy.cpp ├── chapter-3-4-insertelement └── toy.cpp ├── chapter-3-5-extractelement └── toy.cpp ├── chapter-4-1 ├── 1.ll ├── 2.ll ├── diff_O1_O2.png └── test.ll ├── chapter-4-2-pass └── FnNamePrint │ ├── FnNamePrint.cpp │ └── Makefile ├── chapter-4-3-combine ├── InstCombineAndOrXor.cpp └── test.ll ├── chapter-5-1-licm ├── licm.bc ├── licm.ll └── licm_opt.ll ├── chapter-5-2-scalar └── scalevl.ll ├── chapter-5-3-intrinsics ├── intrinsic.cpp └── intrinsic.ll ├── chapter-5-4-vectorize ├── SLPVectorizer0.cpp ├── addsub.cpp ├── addsub.ll ├── addsub.s └── output.txt ├── chapter-6-1-convert-legalize ├── dag-convert.pdf ├── dag-legalize.pdf ├── dag.test-25cbdd.dot ├── dag.test-9bd385.dot ├── test.ll └── test.s ├── chapter-6-2-optimize ├── hadd.ll ├── hadd.s ├── hadd_not_opt.s └── test.c ├── chapter-6-3-select ├── after.gif ├── before.gif ├── test.ll └── test.s ├── chapter-6-4-schedule ├── outfile ├── test.ll ├── test.s ├── test1.s └── test2.s └── chapter-7 ├── CMakeLists.txt ├── LLVMBuild.txt ├── TOY.h ├── TOYCallingConv.td ├── TOYFrameLowering.cpp ├── TOYISelLowering.cpp ├── TOYInstPrinter.cpp ├── TOYInstrFormats.td ├── TOYInstrInfo.td ├── TOYMCAsmInfo.cpp ├── TOYMCAsmInfo.h ├── TOYMCTargetDesc.cpp ├── TOYMCTargetDesc.h ├── TOYRegisterInfo.td ├── TOYTargetInfo.cpp ├── TOYTargetMachine.cpp └── example_prologue_epilogue.txt /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/README.md -------------------------------------------------------------------------------- /example/chapter-1-1/add.bc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-1-1/add.bc -------------------------------------------------------------------------------- /example/chapter-1-1/add.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-1-1/add.c -------------------------------------------------------------------------------- /example/chapter-1-1/add.ll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-1-1/add.ll -------------------------------------------------------------------------------- /example/chapter-1-1/main.bc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-1-1/main.bc -------------------------------------------------------------------------------- /example/chapter-1-1/main.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-1-1/main.c -------------------------------------------------------------------------------- /example/chapter-1-1/output.bc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-1-1/output.bc -------------------------------------------------------------------------------- /example/chapter-1-1/output.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-1-1/output.s -------------------------------------------------------------------------------- /example/chapter-2-1/toy.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-2-1/toy.cpp -------------------------------------------------------------------------------- /example/chapter-2-2/toy.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-2-2/toy.cpp -------------------------------------------------------------------------------- /example/chapter-2-3/toy.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-2-3/toy.cpp -------------------------------------------------------------------------------- /example/chapter-2-4/toy.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-2-4/toy.cpp -------------------------------------------------------------------------------- /example/chapter-2-5/toy.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-2-5/toy.cpp -------------------------------------------------------------------------------- /example/chapter-2-6/toy.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-2-6/toy.cpp -------------------------------------------------------------------------------- /example/chapter-2-7/toy.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-2-7/toy.cpp -------------------------------------------------------------------------------- /example/chapter-2-8-if-else/toy.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-2-8-if-else/toy.cpp -------------------------------------------------------------------------------- /example/chapter-2-9-loop/toy.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-2-9-loop/toy.cpp -------------------------------------------------------------------------------- /example/chapter-3-1/toy.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-3-1/toy.cpp -------------------------------------------------------------------------------- /example/chapter-3-2/toy.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-3-2/toy.cpp -------------------------------------------------------------------------------- /example/chapter-3-3/toy.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-3-3/toy.cpp -------------------------------------------------------------------------------- /example/chapter-3-4-insertelement/toy.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-3-4-insertelement/toy.cpp -------------------------------------------------------------------------------- /example/chapter-3-5-extractelement/toy.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-3-5-extractelement/toy.cpp -------------------------------------------------------------------------------- /example/chapter-4-1/1.ll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-4-1/1.ll -------------------------------------------------------------------------------- /example/chapter-4-1/2.ll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-4-1/2.ll -------------------------------------------------------------------------------- /example/chapter-4-1/diff_O1_O2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-4-1/diff_O1_O2.png -------------------------------------------------------------------------------- /example/chapter-4-1/test.ll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-4-1/test.ll -------------------------------------------------------------------------------- /example/chapter-4-2-pass/FnNamePrint/FnNamePrint.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-4-2-pass/FnNamePrint/FnNamePrint.cpp -------------------------------------------------------------------------------- /example/chapter-4-2-pass/FnNamePrint/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-4-2-pass/FnNamePrint/Makefile -------------------------------------------------------------------------------- /example/chapter-4-3-combine/InstCombineAndOrXor.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-4-3-combine/InstCombineAndOrXor.cpp -------------------------------------------------------------------------------- /example/chapter-4-3-combine/test.ll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-4-3-combine/test.ll -------------------------------------------------------------------------------- /example/chapter-5-1-licm/licm.bc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-5-1-licm/licm.bc -------------------------------------------------------------------------------- /example/chapter-5-1-licm/licm.ll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-5-1-licm/licm.ll -------------------------------------------------------------------------------- /example/chapter-5-1-licm/licm_opt.ll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-5-1-licm/licm_opt.ll -------------------------------------------------------------------------------- /example/chapter-5-2-scalar/scalevl.ll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-5-2-scalar/scalevl.ll -------------------------------------------------------------------------------- /example/chapter-5-3-intrinsics/intrinsic.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-5-3-intrinsics/intrinsic.cpp -------------------------------------------------------------------------------- /example/chapter-5-3-intrinsics/intrinsic.ll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-5-3-intrinsics/intrinsic.ll -------------------------------------------------------------------------------- /example/chapter-5-4-vectorize/SLPVectorizer0.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-5-4-vectorize/SLPVectorizer0.cpp -------------------------------------------------------------------------------- /example/chapter-5-4-vectorize/addsub.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-5-4-vectorize/addsub.cpp -------------------------------------------------------------------------------- /example/chapter-5-4-vectorize/addsub.ll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-5-4-vectorize/addsub.ll -------------------------------------------------------------------------------- /example/chapter-5-4-vectorize/addsub.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-5-4-vectorize/addsub.s -------------------------------------------------------------------------------- /example/chapter-5-4-vectorize/output.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-5-4-vectorize/output.txt -------------------------------------------------------------------------------- /example/chapter-6-1-convert-legalize/dag-convert.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-6-1-convert-legalize/dag-convert.pdf -------------------------------------------------------------------------------- /example/chapter-6-1-convert-legalize/dag-legalize.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-6-1-convert-legalize/dag-legalize.pdf -------------------------------------------------------------------------------- /example/chapter-6-1-convert-legalize/dag.test-25cbdd.dot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-6-1-convert-legalize/dag.test-25cbdd.dot -------------------------------------------------------------------------------- /example/chapter-6-1-convert-legalize/dag.test-9bd385.dot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-6-1-convert-legalize/dag.test-9bd385.dot -------------------------------------------------------------------------------- /example/chapter-6-1-convert-legalize/test.ll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-6-1-convert-legalize/test.ll -------------------------------------------------------------------------------- /example/chapter-6-1-convert-legalize/test.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-6-1-convert-legalize/test.s -------------------------------------------------------------------------------- /example/chapter-6-2-optimize/hadd.ll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-6-2-optimize/hadd.ll -------------------------------------------------------------------------------- /example/chapter-6-2-optimize/hadd.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-6-2-optimize/hadd.s -------------------------------------------------------------------------------- /example/chapter-6-2-optimize/hadd_not_opt.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-6-2-optimize/hadd_not_opt.s -------------------------------------------------------------------------------- /example/chapter-6-2-optimize/test.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-6-2-optimize/test.c -------------------------------------------------------------------------------- /example/chapter-6-3-select/after.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-6-3-select/after.gif -------------------------------------------------------------------------------- /example/chapter-6-3-select/before.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-6-3-select/before.gif -------------------------------------------------------------------------------- /example/chapter-6-3-select/test.ll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-6-3-select/test.ll -------------------------------------------------------------------------------- /example/chapter-6-3-select/test.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-6-3-select/test.s -------------------------------------------------------------------------------- /example/chapter-6-4-schedule/outfile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-6-4-schedule/outfile -------------------------------------------------------------------------------- /example/chapter-6-4-schedule/test.ll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-6-4-schedule/test.ll -------------------------------------------------------------------------------- /example/chapter-6-4-schedule/test.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-6-4-schedule/test.s -------------------------------------------------------------------------------- /example/chapter-6-4-schedule/test1.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-6-4-schedule/test1.s -------------------------------------------------------------------------------- /example/chapter-6-4-schedule/test2.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-6-4-schedule/test2.s -------------------------------------------------------------------------------- /example/chapter-7/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-7/CMakeLists.txt -------------------------------------------------------------------------------- /example/chapter-7/LLVMBuild.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-7/LLVMBuild.txt -------------------------------------------------------------------------------- /example/chapter-7/TOY.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-7/TOY.h -------------------------------------------------------------------------------- /example/chapter-7/TOYCallingConv.td: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-7/TOYCallingConv.td -------------------------------------------------------------------------------- /example/chapter-7/TOYFrameLowering.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-7/TOYFrameLowering.cpp -------------------------------------------------------------------------------- /example/chapter-7/TOYISelLowering.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-7/TOYISelLowering.cpp -------------------------------------------------------------------------------- /example/chapter-7/TOYInstPrinter.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-7/TOYInstPrinter.cpp -------------------------------------------------------------------------------- /example/chapter-7/TOYInstrFormats.td: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-7/TOYInstrFormats.td -------------------------------------------------------------------------------- /example/chapter-7/TOYInstrInfo.td: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-7/TOYInstrInfo.td -------------------------------------------------------------------------------- /example/chapter-7/TOYMCAsmInfo.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-7/TOYMCAsmInfo.cpp -------------------------------------------------------------------------------- /example/chapter-7/TOYMCAsmInfo.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-7/TOYMCAsmInfo.h -------------------------------------------------------------------------------- /example/chapter-7/TOYMCTargetDesc.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-7/TOYMCTargetDesc.cpp -------------------------------------------------------------------------------- /example/chapter-7/TOYMCTargetDesc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-7/TOYMCTargetDesc.h -------------------------------------------------------------------------------- /example/chapter-7/TOYRegisterInfo.td: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-7/TOYRegisterInfo.td -------------------------------------------------------------------------------- /example/chapter-7/TOYTargetInfo.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-7/TOYTargetInfo.cpp -------------------------------------------------------------------------------- /example/chapter-7/TOYTargetMachine.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-7/TOYTargetMachine.cpp -------------------------------------------------------------------------------- /example/chapter-7/example_prologue_epilogue.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lifpan/llvm_essentials_cn/HEAD/example/chapter-7/example_prologue_epilogue.txt --------------------------------------------------------------------------------