1 //===-- llvm/CodeGen/ParallelCG.h - Parallel code generation ----*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This header declares functions that can be used for parallel code generation.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_CODEGEN_PARALLELCG_H
15 #define LLVM_CODEGEN_PARALLELCG_H
17 #include "llvm/ADT/ArrayRef.h"
18 #include "llvm/Support/CodeGen.h"
24 class raw_pwrite_stream;
26 /// Split M into OSs.size() partitions, and generate code for each. Writes
27 /// OSs.size() object files to the output streams in OSs. The resulting object
28 /// files if linked together are intended to be equivalent to the single object
29 /// file that would have been code generated from M.
31 /// \returns M if OSs.size() == 1, otherwise returns std::unique_ptr<Module>().
32 std::unique_ptr<Module>
33 splitCodeGen(std::unique_ptr<Module> M, ArrayRef<raw_pwrite_stream *> OSs,
34 StringRef CPU, StringRef Features, const TargetOptions &Options,
35 Reloc::Model RM = Reloc::Default,
36 CodeModel::Model CM = CodeModel::Default,
37 CodeGenOpt::Level OL = CodeGenOpt::Default);