OpenASIP 2.2
Loading...
Searching...
No Matches
LLVMBackend.hh
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2012 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 LLVMBackend.hh
26 *
27 * Declaration of LLVMBackend class.
28 *
29 * @author Veli-Pekka Jääskeläinen 2008 (vjaaskel-no.spam-cs.tut.fi)
30 * @author Pekka Jääskeläinen 2008-2012
31 * @note rating: red
32 */
33
34#ifndef LLVM_TCE_HH
35#define LLVM_TCE_HH
36
37#include <string>
38
39#include "Exception.hh"
40#include "PluginTools.hh"
42
43namespace TTAProgram {
44 class Program;
45}
46
47namespace TTAMachine {
48 class Machine;
49}
50
51namespace llvm {
52 class Module;
53 class TCETargetMachinePlugin;
54}
55
56class TDGen;
57class InterPassData;
58class SchedulingPlan;
60
61/**
62 * LLVM compiler backend and compiler interface for TCE.
63 */
65public:
67 llvmRequiredOpset(bool includeFloatOps, bool isLittleEndian, bool bits64);
68
69 LLVMBackend(bool useInstalledVersion, TCEString tempDir);
70 virtual ~LLVMBackend();
71
72 void setMachine(TTAMachine::Machine& target);
74 const std::string& bytecodeFile,
75 const std::string& emulationBytecodeFile,
76 int optLevel, bool debug = false, InterPassData* ipData = NULL);
77
79 llvm::Module& module, llvm::Module* emulationModule,
81 int optLevel, bool debug = false, InterPassData* ipData = NULL);
82
84 const std::string& bytecodeFile,
85 const std::string& emulationBytecodeFile,
86 int optLevel = 2, bool debug = false, SchedulingPlan* plan = NULL);
87
89
90 std::string pluginFilename();
91
92private:
93
94 unsigned maxAllocaAlignment(const llvm::Module& mod) const;
95
96 /// Assume we are running an installed TCE version.
98
99 /// Plugin tool for loading target machine plugin.
101 /// Path to the cache where precompiled plugins are stored.
103 /// Directory to store temporary files.
105
107
111
112 static const std::string TBLGEN_INCLUDES;
113 static const std::string PLUGIN_PREFIX;
114 static const std::string PLUGIN_SUFFIX;
115 static const TCEString CXX0X_FLAG;
116 static const TCEString CXX11_FLAG;
117 static const TCEString CXX14_FLAG;
118 static const TCEString CXX17_FLAG;
119};
120
121#endif
LLVMTCECmdLineOptions * options_
static const std::string PLUGIN_PREFIX
static const std::string PLUGIN_SUFFIX
TDGen * pluginGen_
bool useInstalledVersion_
Assume we are running an installed TCE version.
InterPassData * ipData_
static const TCEString CXX17_FLAG
llvm::TCETargetMachinePlugin * createPlugin()
TCEString cachePath_
Path to the cache where precompiled plugins are stored.
std::string pluginFilename()
TTAProgram::Program * compile(const std::string &bytecodeFile, const std::string &emulationBytecodeFile, int optLevel, bool debug=false, InterPassData *ipData=NULL)
static const std::string TBLGEN_INCLUDES
PluginTools pluginTool_
Plugin tool for loading target machine plugin.
TCEString tempDir_
Directory to store temporary files.
unsigned maxAllocaAlignment(const llvm::Module &mod) const
static OperationDAGSelector::OperationSet llvmRequiredOpset(bool includeFloatOps, bool isLittleEndian, bool bits64)
TTAMachine::Machine * mach_
void setMachine(TTAMachine::Machine &target)
static const TCEString CXX14_FLAG
TTAProgram::Program * schedule(const std::string &bytecodeFile, const std::string &emulationBytecodeFile, int optLevel=2, bool debug=false, SchedulingPlan *plan=NULL)
static const TCEString CXX0X_FLAG
static const TCEString CXX11_FLAG
virtual ~LLVMBackend()
TCETools::CIStringSet OperationSet
Definition TDGen.hh:77