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

Last change on this file since 6285 was 6285, checked in by cameron, 4 months ago

-enable-cache-trace flag; base64 encoding for property kernels.

File size: 2.2 KB
Line 
1/*
2 *  Copyright (c) 2018 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// #defines for comparison with LLVM_VERSION_INTEGER
16#define LLVM_VERSION_CODE(major, minor, point) ((10000 * major) + (100 * minor) + point)
17
18// From LLVM 4.0.0 the clEnumValEnd sentinel is no longer needed.
19// We define a macro to adapt to the CommandLine syntax based on LLVM version.
20#if LLVM_VERSION_INTEGER < LLVM_VERSION_CODE(4, 0, 0)
21#define CL_ENUM_VAL_SENTINEL , clEnumValEnd
22#else
23#define CL_ENUM_VAL_SENTINEL
24#endif
25
26namespace llvm { namespace cl { class OptionCategory; } }
27
28namespace codegen {
29
30const llvm::cl::OptionCategory * LLVM_READONLY codegen_flags();
31
32// Command Parameters
33enum DebugFlags {
34    VerifyIR,
35    SerializeThreads,
36    TraceCounts,
37    TraceDynamicBuffers,
38    EnableAsserts,
39    EnableMProtect,
40    EnableCycleCounter,
41    DisableIndirectBranch,
42    DebugFlagSentinel
43};
44
45bool LLVM_READONLY DebugOptionIsSet(const DebugFlags flag);
46
47extern bool SegmentPipelineParallel;
48   
49// Options for generating IR or ASM to files
50const std::string OmittedOption = ".";
51extern std::string ShowUnoptimizedIROption;
52extern std::string ShowIROption;
53extern std::string TraceOption;
54#if LLVM_VERSION_INTEGER >= LLVM_VERSION_CODE(3, 7, 0)
55extern std::string ShowASMOption;
56#endif
57extern const char * ObjectCacheDir;
58extern unsigned CacheDaysLimit;  // set from command line
59extern llvm::CodeGenOpt::Level OptLevel;  // set from command line
60const unsigned LaneWidth = 64;
61extern unsigned BlockSize;  // set from command line
62extern unsigned SegmentSize; // set from command line
63extern unsigned BufferSegments;
64extern unsigned ThreadNum;
65extern bool EnableObjectCache;
66extern bool TraceObjectCache;
67extern bool NVPTX;
68extern unsigned GroupNum;
69extern std::string ProgramName;
70extern llvm::TargetOptions target_Options;
71
72void ParseCommandLineOptions(int argc, const char *const *argv, std::initializer_list<const llvm::cl::OptionCategory *> hiding = {});
73
74void AddParabixVersionPrinter();
75
76}
77
78#endif
Note: See TracBrowser for help on using the repository browser.