49#include "tce_config.h"
54#include <llvm/Target/TargetLoweringObjectFile.h>
55#include <llvm/Target/TargetMachine.h>
56#include <llvm/CodeGen/Passes.h>
57#include <llvm/IR/LegacyPassManager.h>
58#include <llvm/Target/TargetOptions.h>
59#include <llvm/CodeGen/TargetPassConfig.h>
68 RegisterTarget<Triple::tce,
false>
70 "TODO: wonder what this button does");
71 RegisterTarget<Triple::tcele, false>
73 "TCE custom processor (little endian)",
74 "TODO: wonder what this button does");
75 RegisterTarget<Triple::tcele64, false>
76 Z(
TheTCELE64Target,
"tcele64-tut-llvm",
"64-bit TCE custom processor (little endian) ",
77 "TODO: wonder what this button does");
90 "i16:16:32-i32:32:32-i64:32:32-"
91 "f32:32:32-f64:32:32-v64:32:32-"
92 "v128:32:32-v256:32:32-v512:32:32-v1024:32:32-a0:0:32-n32";
94#if LLVM_HAS_CUSTOM_VECTOR_EXTENSION == 2
96 "i16:16:32-i32:32:32-i64:32:32-"
97 "f32:32:32-f64:32:32-v64:64:64-"
98 "v128:128:128-v256:256:256-v512:512:512-v1024:1024:1024-"
99 "v2048:2048:2048-v4096:4096:4096-a0:0:32-n32";
102 "i16:16:32-i32:32:32-i64:32:32-"
103 "f32:32:32-f64:32:32-v64:64:64-"
104 "v128:128:128-v256:256:256-v512:512:512-v1024:1024:1024-a0:0:32-n32";
108 "i16:16:64-i32:32:64-i64:64:64-"
109 "f32:32:64-f64:64:64-v64:64:64-"
110 "v128:128:128-v256:256:256-v512:512:512-v1024:1024:1024-"
111 "v2048:2048:2048-v4096:4096:4096-a0:0:64-n64";
114 if (TT.getArchName().equals(
"tce"))
117 if (TT.getArchName().equals(
"tcele"))
126 const Target &T,
const Triple& TT,
const llvm::StringRef& CPU,
127 const llvm::StringRef& FS,
const TargetOptions &
Options,
128 Reloc::Model RM, CodeModel::Model CM, CodeGenOpt::Level OL) :
135 const Target &T,
const Triple &TT,
const llvm::StringRef& CPU,
136 const llvm::StringRef& FS,
const TargetOptions &
Options,
137 #ifdef LLVM_OLDER_THAN_16
138 Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM,
140 std::optional<Reloc::Model> RM, std::optional<CodeModel::Model> CM,
142 CodeGenOpt::Level OL,
bool) :
144 RM?*RM:Reloc::
Model::Static,
145 CM?*CM:CodeModel::Small, OL),
148 TLOF(new TargetLoweringObjectFileELF) {
153 auto* option =
static_cast<llvm::cl::opt<std::string>*
>(
154 llvm::cl::getRegisteredOptions().lookup(
"adf"));
155 const std::string adfName = option->getValue();
159 const std::string msg =
"ADF not passed to opt,"
160 "make sure it is included in oacc";
176 class TCEStubPassConfig :
public TargetPassConfig {
179 : TargetPassConfig(*TM, PM) {}
182 return getTM<TCEStubTargetMachine>();
#define IGNORE_COMPILER_WARNING(X)
static llvm::RegisterPass< InnerLoopFinder > X("find-innerloops-test", "Finds inner loops test.", false, true)
StringRef DescriptionStringLE
void LLVMInitializeTCETargetInfo()
StringRef DescriptionStringBE
void LLVMInitializeTCEStubTargetMC()
void LLVMInitializeTCEStubTarget()
StringRef getTargetDesc(const Triple &TT)
StringRef DescriptionStringLE64
TTAMachine::Machine * readMachine()
void setSourceFile(const std::string &fileName)
TCEBaseTargetMachine(const Target &T, const Triple &TT, const llvm::StringRef &CPU, const llvm::StringRef &FS, const TargetOptions &Options, Reloc::Model RM, CodeModel::Model CM, CodeGenOpt::Level OL)
virtual void setTTAMach(const TTAMachine::Machine *mach)
virtual ~TCEStubTargetMachine()
TCEStubTargetMachine(const Target &T, const Triple &TT, const llvm::StringRef &CPU, const llvm::StringRef &FS, const TargetOptions &Options, std::optional< Reloc::Model > RM, std::optional< CodeModel::Model > CM, CodeGenOpt::Level OL, bool isLittle)