Add readme and some regalloc updates

[?]
8Cqo1QjSCQ3F66Vh3nan9N8dv1MjQSAEz8RNwt2cTacK
May 2, 2024, 10:11 PM
PR5SVBTFDSPDWB2KUOFPMFEW5X4ESXG3ZNQO7IJUND2KDXU3XBRQC

Dependencies

Change contents

  • replacement in llvm/lib/CodeGen/RegAllocSimple.cpp at line 103
    [3.3420][3.3420:3421]()
    [3.3420]
    [3.3421]
    assert(MO.getReg().isVirtual() && "Can only allocate a virtual register");
  • replacement in llvm/lib/CodeGen/RegAllocSimple.cpp at line 160
    [3.5319][3.5319:5500]()
    auto const allocUse = [this](MachineOperand &MO){ this->allocateOperand(MO, true); };
    auto const allocDef = [this](MachineOperand &MO){ this->allocateOperand(MO, false); };
    [3.5319]
    [3.5500]
    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
    [3.5712]
    [3.5712]
    LLVM_DEBUG(dbgs() << "Regalloc: Spilling clobbered reg " << R << "\n");
  • edit in llvm/lib/CodeGen/RegAllocSimple.cpp at line 238
    [3.7127]
    [3.7127]
    assert(MO.getReg().isVirtual() && "Cannot bind a physical register to a non-virtual register");
  • replacement in llvm/CMakeLists.txt at line 87
    [4.642607700][4.642607700:642607967]()
    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")
    [4.642607700]
    [4.642607967]
    ##
    ## 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 pass
    Corresponding headers and tests can be found in the usual places
  • replacement in .bazelrc at line 112
    [2.85014][2.85014:85034]()
    build --fission=yes
    [2.85014]
    [4.874196115]
    #build --fission=yes