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

Last change on this file since 6105 was 6105, checked in by cameron, 13 months ago

NativeBitWidth? for idisa_builders, laneWidth replaces stride

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    EnableCycleCounter,
40    DisableIndirectBranch,
41    DebugFlagSentinel
42};
43
44bool LLVM_READONLY DebugOptionIsSet(const DebugFlags flag);
45
46extern bool SegmentPipelineParallel;
47   
48// Options for generating IR or ASM to files
49const std::string OmittedOption = ".";
50extern std::string ShowUnoptimizedIROption;
51extern std::string ShowIROption;
52#if LLVM_VERSION_INTEGER >= LLVM_VERSION_CODE(3, 7, 0)
53extern std::string ShowASMOption;
54#endif
55extern const char * ObjectCacheDir;
56extern unsigned CacheDaysLimit;  // set from command line
57extern llvm::CodeGenOpt::Level OptLevel;  // set from command line
58const unsigned LaneWidth = 64;
59extern unsigned BlockSize;  // set from command line
60extern unsigned SegmentSize;  // set from command line
61extern unsigned BufferSegments;
62extern unsigned ThreadNum;
63extern bool EnableObjectCache;
64extern bool NVPTX;
65extern unsigned GroupNum;
66extern std::string ProgramName;
67extern llvm::TargetOptions target_Options;
68
69void ParseCommandLineOptions(int argc, const char *const *argv, std::initializer_list<const llvm::cl::OptionCategory *> hiding = {});
70
71}
72
73void AddParabixVersionPrinter();
74
75#endif
Note: See TracBrowser for help on using the repository browser.