source: icGREP/icgrep-devel/icgrep/toolchain/toolchain.h @ 5464

Last change on this file since 5464 was 5464, checked in by nmedfort, 2 years ago

Restructuring work for the Driver classes. Start of work to eliminate the memory leaks with the ExecutionEngine?. Replaced custom AlignedMalloc? with backend call to std::aligned_malloc. Salvaged some work on DistributionPass? for reevaluation.

File size: 2.1 KB
Line 
1/*
2 *  Copyright (c) 2017 International Characters.
3 *  This software is licensed to the public under the Open Software License 3.0.
4 *  icgrep is a trademark of International Characters.
5 */
6
7#ifndef TOOLCHAIN_H
8#define TOOLCHAIN_H
9
10#include <llvm/ADT/StringRef.h>
11#include <llvm/Support/CodeGen.h>
12#include <llvm/Target/TargetOptions.h>
13#include <llvm/Target/TargetMachine.h>
14
15// FIXME: llvm/CodeGen/CommandFlags.h can only be included once or the various cl::opt causes multiple definition
16// errors. To bypass for now, the relevant options and functions are accessible from here. Re-evaluate with later
17// versions of LLVM.
18
19namespace llvm { namespace cl { class OptionCategory; } }
20
21namespace codegen {
22
23const llvm::cl::OptionCategory * codegen_flags();
24
25// Command Parameters
26enum DebugFlags {
27    ShowUnoptimizedIR,
28    ShowIR,
29    VerifyIR,
30#ifndef USE_LLVM_3_6
31    ShowASM,
32#endif
33    SerializeThreads
34};
35
36bool DebugOptionIsSet(const DebugFlags flag);
37
38extern bool pipelineParallel;
39extern bool segmentPipelineParallel;
40#ifndef USE_LLVM_3_6
41extern const std::string ASMOutputFilename;
42#endif
43extern const std::string IROutputFilename;
44extern const std::string ObjectCacheDir;
45extern const llvm::CodeGenOpt::Level OptLevel;  // set from command line
46extern int BlockSize;  // set from command line
47extern int SegmentSize;  // set from command line
48extern int BufferSegments;
49extern int ThreadNum;
50extern const bool EnableObjectCache;
51extern bool EnableAsserts;
52extern bool EnableCycleCounter;
53extern bool NVPTX;
54extern int GroupNum;
55extern const llvm::TargetOptions Options;
56extern const llvm::Reloc::Model RelocModel;
57extern const llvm::CodeModel::Model CMModel;
58extern const std::string MArch;
59extern const std::string RunPass;
60extern const llvm::TargetMachine::CodeGenFileType FileType;
61extern const std::string StopAfter;
62extern const std::string StartAfter;
63
64std::string getCPUStr();
65std::string getFeaturesStr();
66void setFunctionAttributes(llvm::StringRef CPU, llvm::StringRef Features, llvm::Module &M);
67
68}
69
70
71void setNVPTXOption();
72
73void AddParabixVersionPrinter();
74
75bool AVX2_available();
76
77#endif
Note: See TracBrowser for help on using the repository browser.