OpenASIP  2.0
LLVMTCECmdLineOptions.hh
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2020 Tampere University.
3 
4  This file is part of TTA-Based Codesign Environment (TCE).
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23  */
24 /**
25  * @file LLVMTCECmdLineOptions.hh
26  *
27  * Declaration of LLVMTCECmdLineOptions class.
28  *
29  * @author Veli-Pekka Jääskeläinen 2008
30  * @author Pekka Jääskeläinen 2010-2020
31  * @note rating: red
32  */
33 
34 #ifndef LLVM_TCE_CMD_LINE_OPTIONS_HH
35 #define LLVM_TCE_CMD_LINE_OPTIONS_HH
36 
37 #include <set>
38 #include <string>
40 #include "Application.hh"
41 #include "InterPassDatum.hh"
42 #include "tce_config.h" // VERSION
43 
44 /**
45  * Command line options class for the llvm-tce compiler CLI.
46  *
47  */
49 
50 public:
53 
54  virtual FunctionNameList* primaryFunctions() const;
55 
56  bool isStandardEmulationLibDefined() const;
57  std::string standardEmulationLib() const;
58 
59  bool isOptLevelDefined() const;
60  int optLevel() const;
61 
62  bool isVerboseSwitchDefined() const;
63 
64  bool debugFlag() const;
65 
66  bool conservativePreRAScheduler() const;
67 
68  bool saveBackendPlugin() const;
69 
70  bool useBUScheduler() const;
71  bool useTDScheduler() const;
72  bool useBubbleFish2Scheduler() const;
73 
74  bool useOldBackendSources() const;
75 
76  bool disableDelaySlotFiller() const;
77 
78  bool isWorkItemAAFileDefined() const;
79  std::string workItemAAFile() const;
80 
81  bool analyzeInstructionPatterns() const;
82 
83  std::string backendCacheDir() const;
84 
85  TCEString tempDir() const;
86 
87  virtual std::string getLLVMargv() const;
88 
89  virtual bool dumpDDGsDot() const;
90  virtual bool dumpDDGsXML() const;
91  virtual bool disableLLVMAA() const;
92 
93  bool useVectorBackend() const;
94 
95  bool isInitialStackPointerValueSet() const;
96  uint64_t initialStackPointerValue() const;
97 
98  bool isDataStartAddressSet() const;
99  uint64_t dataStartAddress() const;
100 
101  bool printInlineAsmWarnings() const;
102  bool generatePluginOnly() const;
103  bool disableAddressSpaceAA() const;
104  bool disableHWLoops() const;
105  bool assumeADFStackAlignment() const;
106 
107  virtual void printVersion() const {
108  std::cout
109  << "llvm-tce - TCE LLVM code generator "
111  << std::endl;
112  }
113 
114 private:
115  // Command line switches.
116  static const std::string SWL_EMULATION_LIB;
117  static const std::string SWS_EMULATION_LIB;
118  static const std::string SWL_DEBUG_FLAG;
119  static const std::string SWL_OPT_LEVEL;
120  static const std::string SWS_OPT_LEVEL;
121  static const std::string SWL_PRIMARY_FUNCTIONS;
122  static const std::string SWS_PRIMARY_FUNCTIONS;
123  static const std::string SWL_EXPERIMENTAL_REGALLOC;
124  /// Switch for verbose output listing scheduler modules
125  static const std::string VERBOSE_SWITCH;
126  static const std::string DISABLE_LLVMAA;
127  static const std::string CONSERVATIVE_PRE_RA_SCHEDULER;
128  static const std::string LLVM_USER_ARGS;
129  static const std::string DISABLE_DSF;
130  static const std::string DISABLE_ADDRESS_SPACE_AA;
131  static const std::string SWL_DUMP_DDGS_DOT;
132  static const std::string SWL_DUMP_DDGS_XML;
133  static const std::string SWL_SAVE_BACKEND_PLUGIN;
134  static const std::string SWL_BU_SCHEDULER;
135  static const std::string SWL_BUBBLEFISH2_SCHEDULER;
136  static const std::string SWL_TD_SCHEDULER;
137  static const std::string SWL_USE_OLD_BACKEND_SOURCES;
138  static const std::string SWL_TEMP_DIR;
139  static const std::string SWL_ENABLE_VECTOR_BACKEND;
140  static const std::string SWL_WORK_ITEM_AA_FILE;
141  static const std::string SWL_ANALYZE_INSTRUCTION_PATTERNS;
142  static const std::string SWL_BACKEND_CACHE_DIR;
143  static const std::string SWL_INIT_SP;
144  static const std::string SWL_DATA_START;
145  static const std::string USAGE;
146  static const std::string SWL_PRINT_INLINE_ASM_WARNINGS;
147  static const std::string SWL_GEN_PLUGIN_ONLY;
148  static const std::string SWL_DISABLE_HWLOOPS;
149  static const std::string SWL_ASSUME_ADF_STACKALIGNMENT;
150 };
151 
152 #endif
SimpleInterPassDatum
Definition: InterPassDatum.hh:64
LLVMTCECmdLineOptions::debugFlag
bool debugFlag() const
Definition: LLVMTCECmdLineOptions.cc:303
LLVMTCECmdLineOptions::SWL_DEBUG_FLAG
static const std::string SWL_DEBUG_FLAG
Definition: LLVMTCECmdLineOptions.hh:118
LLVMTCECmdLineOptions::SWL_TEMP_DIR
static const std::string SWL_TEMP_DIR
Definition: LLVMTCECmdLineOptions.hh:138
LLVMTCECmdLineOptions::SWL_ENABLE_VECTOR_BACKEND
static const std::string SWL_ENABLE_VECTOR_BACKEND
Definition: LLVMTCECmdLineOptions.hh:139
LLVMTCECmdLineOptions::LLVM_USER_ARGS
static const std::string LLVM_USER_ARGS
Definition: LLVMTCECmdLineOptions.hh:128
LLVMTCECmdLineOptions::SWL_BU_SCHEDULER
static const std::string SWL_BU_SCHEDULER
Definition: LLVMTCECmdLineOptions.hh:134
LLVMTCECmdLineOptions::disableDelaySlotFiller
bool disableDelaySlotFiller() const
Definition: LLVMTCECmdLineOptions.cc:324
LLVMTCECmdLineOptions::saveBackendPlugin
bool saveBackendPlugin() const
Definition: LLVMTCECmdLineOptions.cc:369
LLVMTCECmdLineOptions::SWL_OPT_LEVEL
static const std::string SWL_OPT_LEVEL
Definition: LLVMTCECmdLineOptions.hh:119
LLVMTCECmdLineOptions::SWL_DATA_START
static const std::string SWL_DATA_START
Definition: LLVMTCECmdLineOptions.hh:144
LLVMTCECmdLineOptions::analyzeInstructionPatterns
bool analyzeInstructionPatterns() const
Definition: LLVMTCECmdLineOptions.cc:414
LLVMTCECmdLineOptions::DISABLE_DSF
static const std::string DISABLE_DSF
Definition: LLVMTCECmdLineOptions.hh:129
LLVMTCECmdLineOptions::SWL_EXPERIMENTAL_REGALLOC
static const std::string SWL_EXPERIMENTAL_REGALLOC
Definition: LLVMTCECmdLineOptions.hh:123
LLVMTCECmdLineOptions::tempDir
TCEString tempDir() const
Definition: LLVMTCECmdLineOptions.cc:394
LLVMTCECmdLineOptions::SWL_ASSUME_ADF_STACKALIGNMENT
static const std::string SWL_ASSUME_ADF_STACKALIGNMENT
Definition: LLVMTCECmdLineOptions.hh:149
LLVMTCECmdLineOptions::printVersion
virtual void printVersion() const
Definition: LLVMTCECmdLineOptions.hh:107
LLVMTCECmdLineOptions::SWL_DUMP_DDGS_XML
static const std::string SWL_DUMP_DDGS_XML
Definition: LLVMTCECmdLineOptions.hh:132
LLVMTCECmdLineOptions::workItemAAFile
std::string workItemAAFile() const
Definition: LLVMTCECmdLineOptions.cc:409
LLVMTCECmdLineOptions::~LLVMTCECmdLineOptions
~LLVMTCECmdLineOptions()
Definition: LLVMTCECmdLineOptions.cc:242
LLVMTCECmdLineOptions::conservativePreRAScheduler
bool conservativePreRAScheduler() const
Definition: LLVMTCECmdLineOptions.cc:339
LLVMTCECmdLineOptions::optLevel
int optLevel() const
Definition: LLVMTCECmdLineOptions.cc:292
LLVMTCECmdLineOptions::disableLLVMAA
virtual bool disableLLVMAA() const
Definition: LLVMTCECmdLineOptions.cc:314
LLVMTCECmdLineOptions::isStandardEmulationLibDefined
bool isStandardEmulationLibDefined() const
Definition: LLVMTCECmdLineOptions.cc:271
LLVMTCECmdLineOptions::dumpDDGsDot
virtual bool dumpDDGsDot() const
Definition: LLVMTCECmdLineOptions.cc:359
SchedulerCmdLineOptions
Definition: SchedulerCmdLineOptions.hh:45
LLVMTCECmdLineOptions::standardEmulationLib
std::string standardEmulationLib() const
Definition: LLVMTCECmdLineOptions.cc:266
LLVMTCECmdLineOptions::SWS_EMULATION_LIB
static const std::string SWS_EMULATION_LIB
Definition: LLVMTCECmdLineOptions.hh:117
LLVMTCECmdLineOptions::useBUScheduler
bool useBUScheduler() const
Definition: LLVMTCECmdLineOptions.cc:374
SchedulerCmdLineOptions.hh
LLVMTCECmdLineOptions::DISABLE_ADDRESS_SPACE_AA
static const std::string DISABLE_ADDRESS_SPACE_AA
Definition: LLVMTCECmdLineOptions.hh:130
LLVMTCECmdLineOptions::dataStartAddress
uint64_t dataStartAddress() const
Definition: LLVMTCECmdLineOptions.cc:441
LLVMTCECmdLineOptions::LLVMTCECmdLineOptions
LLVMTCECmdLineOptions()
Definition: LLVMTCECmdLineOptions.cc:96
LLVMTCECmdLineOptions::SWS_PRIMARY_FUNCTIONS
static const std::string SWS_PRIMARY_FUNCTIONS
Definition: LLVMTCECmdLineOptions.hh:122
LLVMTCECmdLineOptions::useBubbleFish2Scheduler
bool useBubbleFish2Scheduler() const
Definition: LLVMTCECmdLineOptions.cc:379
LLVMTCECmdLineOptions::SWL_DISABLE_HWLOOPS
static const std::string SWL_DISABLE_HWLOOPS
Definition: LLVMTCECmdLineOptions.hh:148
LLVMTCECmdLineOptions::isVerboseSwitchDefined
bool isVerboseSwitchDefined() const
Definition: LLVMTCECmdLineOptions.cc:334
LLVMTCECmdLineOptions::isDataStartAddressSet
bool isDataStartAddressSet() const
Definition: LLVMTCECmdLineOptions.cc:436
InterPassDatum.hh
LLVMTCECmdLineOptions::generatePluginOnly
bool generatePluginOnly() const
Definition: LLVMTCECmdLineOptions.cc:452
LLVMTCECmdLineOptions::SWL_GEN_PLUGIN_ONLY
static const std::string SWL_GEN_PLUGIN_ONLY
Definition: LLVMTCECmdLineOptions.hh:147
LLVMTCECmdLineOptions::disableAddressSpaceAA
bool disableAddressSpaceAA() const
Definition: LLVMTCECmdLineOptions.cc:319
Application.hh
LLVMTCECmdLineOptions::SWL_WORK_ITEM_AA_FILE
static const std::string SWL_WORK_ITEM_AA_FILE
Definition: LLVMTCECmdLineOptions.hh:140
LLVMTCECmdLineOptions::SWL_ANALYZE_INSTRUCTION_PATTERNS
static const std::string SWL_ANALYZE_INSTRUCTION_PATTERNS
Definition: LLVMTCECmdLineOptions.hh:141
LLVMTCECmdLineOptions::SWL_SAVE_BACKEND_PLUGIN
static const std::string SWL_SAVE_BACKEND_PLUGIN
Definition: LLVMTCECmdLineOptions.hh:133
LLVMTCECmdLineOptions::SWL_INIT_SP
static const std::string SWL_INIT_SP
Definition: LLVMTCECmdLineOptions.hh:143
LLVMTCECmdLineOptions::SWL_EMULATION_LIB
static const std::string SWL_EMULATION_LIB
Definition: LLVMTCECmdLineOptions.hh:116
LLVMTCECmdLineOptions::useVectorBackend
bool useVectorBackend() const
Definition: LLVMTCECmdLineOptions.cc:399
LLVMTCECmdLineOptions::SWL_PRINT_INLINE_ASM_WARNINGS
static const std::string SWL_PRINT_INLINE_ASM_WARNINGS
Definition: LLVMTCECmdLineOptions.hh:146
LLVMTCECmdLineOptions::getLLVMargv
virtual std::string getLLVMargv() const
Definition: LLVMTCECmdLineOptions.cc:348
LLVMTCECmdLineOptions::SWL_USE_OLD_BACKEND_SOURCES
static const std::string SWL_USE_OLD_BACKEND_SOURCES
Definition: LLVMTCECmdLineOptions.hh:137
LLVMTCECmdLineOptions::primaryFunctions
virtual FunctionNameList * primaryFunctions() const
Definition: LLVMTCECmdLineOptions.cc:254
LLVMTCECmdLineOptions::backendCacheDir
std::string backendCacheDir() const
Definition: LLVMTCECmdLineOptions.cc:419
LLVMTCECmdLineOptions::useOldBackendSources
bool useOldBackendSources() const
Definition: LLVMTCECmdLineOptions.cc:389
LLVMTCECmdLineOptions
Definition: LLVMTCECmdLineOptions.hh:48
LLVMTCECmdLineOptions::DISABLE_LLVMAA
static const std::string DISABLE_LLVMAA
Definition: LLVMTCECmdLineOptions.hh:126
LLVMTCECmdLineOptions::assumeADFStackAlignment
bool assumeADFStackAlignment() const
Definition: LLVMTCECmdLineOptions.cc:463
LLVMTCECmdLineOptions::dumpDDGsXML
virtual bool dumpDDGsXML() const
Definition: LLVMTCECmdLineOptions.cc:364
LLVMTCECmdLineOptions::SWL_TD_SCHEDULER
static const std::string SWL_TD_SCHEDULER
Definition: LLVMTCECmdLineOptions.hh:136
LLVMTCECmdLineOptions::isInitialStackPointerValueSet
bool isInitialStackPointerValueSet() const
Definition: LLVMTCECmdLineOptions.cc:426
LLVMTCECmdLineOptions::SWL_BUBBLEFISH2_SCHEDULER
static const std::string SWL_BUBBLEFISH2_SCHEDULER
Definition: LLVMTCECmdLineOptions.hh:135
LLVMTCECmdLineOptions::CONSERVATIVE_PRE_RA_SCHEDULER
static const std::string CONSERVATIVE_PRE_RA_SCHEDULER
Definition: LLVMTCECmdLineOptions.hh:127
LLVMTCECmdLineOptions::USAGE
static const std::string USAGE
Definition: LLVMTCECmdLineOptions.hh:145
LLVMTCECmdLineOptions::useTDScheduler
bool useTDScheduler() const
Definition: LLVMTCECmdLineOptions.cc:384
LLVMTCECmdLineOptions::disableHWLoops
bool disableHWLoops() const
Definition: LLVMTCECmdLineOptions.cc:458
TCEString
Definition: TCEString.hh:53
LLVMTCECmdLineOptions::printInlineAsmWarnings
bool printInlineAsmWarnings() const
Definition: LLVMTCECmdLineOptions.cc:446
LLVMTCECmdLineOptions::SWL_PRIMARY_FUNCTIONS
static const std::string SWL_PRIMARY_FUNCTIONS
Definition: LLVMTCECmdLineOptions.hh:121
LLVMTCECmdLineOptions::isWorkItemAAFileDefined
bool isWorkItemAAFileDefined() const
Definition: LLVMTCECmdLineOptions.cc:404
LLVMTCECmdLineOptions::VERBOSE_SWITCH
static const std::string VERBOSE_SWITCH
Switch for verbose output listing scheduler modules.
Definition: LLVMTCECmdLineOptions.hh:125
Application::TCEVersionString
static std::string TCEVersionString()
Definition: Application.cc:510
LLVMTCECmdLineOptions::SWS_OPT_LEVEL
static const std::string SWS_OPT_LEVEL
Definition: LLVMTCECmdLineOptions.hh:120
LLVMTCECmdLineOptions::isOptLevelDefined
bool isOptLevelDefined() const
Definition: LLVMTCECmdLineOptions.cc:281
LLVMTCECmdLineOptions::initialStackPointerValue
uint64_t initialStackPointerValue() const
Definition: LLVMTCECmdLineOptions.cc:431
LLVMTCECmdLineOptions::SWL_DUMP_DDGS_DOT
static const std::string SWL_DUMP_DDGS_DOT
Definition: LLVMTCECmdLineOptions.hh:131
LLVMTCECmdLineOptions::SWL_BACKEND_CACHE_DIR
static const std::string SWL_BACKEND_CACHE_DIR
Definition: LLVMTCECmdLineOptions.hh:142