Skip to content

Getting Started

Tommy McMichen edited this page May 26, 2022 · 1 revision

Getting Started

Dependencies

  • LLVM 9.0.0

Building NOELLE

To build and install NOELLE: run make from the repository root directory.

Run make clean from the root directory to clean the repository.

Run make uninstall from the root directory to uninstall the NOELLE installation.

Running NOELLE

When invoking LLVM, a compiler pass can be run with the opt command.

opt -load Pass.so -Pass in.bc -o out.bc

To run NOELLE on a given LLVM bitcode, replace opt with noelle-load. noelle-load is a wrapper for LLVM's opt, it loads all of the required NOELLE modules that are needed for a pass using NOELLE.

noelle-load -load Pass.so -Pass in.bc -o out.bc

Prior to running NOELLE on an LLVM bitcode, the program must be normalized. If the program is not normalized then the correctness of NOELLE's abstractions cannot be guaranteed.

noelle-norm in.bc -o out.bc

or

noelle-simplification in.bc -o out.bc

Using NOELLE

To add NOELLE to your LLVM pass you need to modify the runOnModule and getAnalysisUsage functions of your pass.

bool runOnModule(Module &M) override {
  /*
   * Fetch NOELLE
   */
  auto &noelle = getAnalysis<Noelle>();

  /*
   * Use NOELLE
   */
  auto insts = noelle.numberOfProgramInstructions();
  errs() << "The program has " << insts << "instructions\n";

  return false;
}

void getAnalysisUsage(AnalysisUsage &AU) const override {
  /*
   * Declare that your pass depends on NOELLE to LLVM
   */
  AU.addRequired<Noelle>();
}

Testing NOELLE

NOELLE includes tests for its code transformations (e.g. code parallelization, loop-invariant code motion, etc.) These are available in the tests/ directory. After making changes to the internals of NOELLE, you can test the changes correctness.

cd tests ; make

If you have condor installed on your platform.

cd tests ; make condor
Clone this wiki locally