Add readme and some regalloc updates
[?]
8Cqo1QjSCQ3F66Vh3nan9N8dv1MjQSAEz8RNwt2cTacK
May 2, 2024, 10:11 PM
PR5SVBTFDSPDWB2KUOFPMFEW5X4ESXG3ZNQO7IJUND2KDXU3XBRQCDependencies
- [2]
SWF5OAWKAdd Sanitized build config - [3]
MFTKDEMKImplement base algorithm - [4]
7OVOGA6QImport LLVM @ 15.0.7 - [*]
WHVW6V3W
Change contents
- replacement in llvm/lib/CodeGen/RegAllocSimple.cpp at line 103
assert(MO.getReg().isVirtual() && "Can only allocate a virtual register"); - replacement in llvm/lib/CodeGen/RegAllocSimple.cpp at line 160
auto const allocUse = [this](MachineOperand &MO){ this->allocateOperand(MO, true); };auto const allocDef = [this](MachineOperand &MO){ this->allocateOperand(MO, false); };auto const allocUse = [this](MachineOperand &MO){assert(MO.isUse());LLVM_DEBUG(dbgs() << "Regalloc: Allocating use " << MO << "\n");this->allocateOperand(MO, true);};auto const allocDef = [this](MachineOperand &MO){assert(MO.isDef());LLVM_DEBUG(dbgs() << "Regalloc: Allocating def " << MO << "\n");this->allocateOperand(MO, false);}; - edit in llvm/lib/CodeGen/RegAllocSimple.cpp at line 178
LLVM_DEBUG(dbgs() << "Regalloc: Spilling clobbered reg " << R << "\n"); - edit in llvm/lib/CodeGen/RegAllocSimple.cpp at line 238
assert(MO.getReg().isVirtual() && "Cannot bind a physical register to a non-virtual register"); - replacement in llvm/CMakeLists.txt at line 87
set(LLVM_ALL_PROJECTS "bolt;clang;clang-tools-extra;compiler-rt;cross-project-tests;libc;libclc;libcxx;libcxxabi;libunwind;lld;lldb;mlir;openmp;polly;pstl")# The flang project is not yet part of "all" projects (see C++ requirements)set(LLVM_EXTRA_PROJECTS "flang")#### Removed projects not vendored##set(LLVM_ALL_PROJECTS "clang") - file addition: README.md[6.1]
This is a monorepo of my compiler projects that use LLVM. It is primarily intended to be built with Bazel, but CMake is also supported.`coollang/` contains the frontend and runtime for COOL (Classroom Object-Oriented Language), which is a small language that still supports static typing, garbage collection, polymorphism, and dynamic dispatch.`clang/` is the unmodified clang 15.0.7 source tree`llvm/` is the unmodified llvm 15.0.7 source tree with the addition of optimizations I developed:- `llvm/lib/CodeGen/RegAllocSimple.cpp` is a bottom-up local register allocator- `llvm/lib/Analysis/UnitLoopInfo.cpp` is a natural-loop detector- `llvm/lib/Transforms/Scalar/UnitLICM.cpp` is a loop-invariant code motion pass- `llvm/lib/Transforms/Scalar/UnitSCCP.cpp` is a sparse conditional-constant propagation passCorresponding headers and tests can be found in the usual places - replacement in .bazelrc at line 112
build --fission=yes#build --fission=yes