30 #define DEBUG_TYPE "wasm"
49 ?
"e-p:64:64-i64:64-v128:8:128-n32:64-S128"
50 :
"e-p:32:32-i64:64-v128:8:128-n32:64-S128",
51 TT, CPU, FS, Options, RM, CM, OL),
74 auto &
I = SubtargetMap[CPU +
FS];
93 return getTM<WebAssemblyTargetMachine>();
96 FunctionPass *createTargetRegisterAllocator(
bool)
override;
97 void addFastRegAlloc(
FunctionPass *RegAllocPass)
override;
98 void addOptimizedRegAlloc(
FunctionPass *RegAllocPass)
override;
100 void addIRPasses()
override;
101 bool addPreISel()
override;
102 bool addInstSelector()
override;
103 bool addILPOpts()
override;
104 void addPreRegAlloc()
override;
105 void addRegAllocPasses(
bool Optimized);
106 void addPostRegAlloc()
override;
107 void addPreSched2()
override;
108 void addPreEmitPass()
override;
120 return new WebAssemblyPassConfig(
this, PM);
123 FunctionPass *WebAssemblyPassConfig::createTargetRegisterAllocator(
bool) {
127 void WebAssemblyPassConfig::addFastRegAlloc(
FunctionPass *RegAllocPass) {
128 assert(!RegAllocPass &&
"WebAssembly uses no regalloc!");
129 addRegAllocPasses(
false);
132 void WebAssemblyPassConfig::addOptimizedRegAlloc(
FunctionPass *RegAllocPass) {
133 assert(!RegAllocPass &&
"WebAssembly uses no regalloc!");
134 addRegAllocPasses(
true);
142 void WebAssemblyPassConfig::addIRPasses() {
155 bool WebAssemblyPassConfig::addPreISel() {
return false; }
157 bool WebAssemblyPassConfig::addInstSelector() {
163 bool WebAssemblyPassConfig::addILPOpts() {
return true; }
165 void WebAssemblyPassConfig::addPreRegAlloc() {}
167 void WebAssemblyPassConfig::addRegAllocPasses(
bool Optimized) {}
169 void WebAssemblyPassConfig::addPostRegAlloc() {}
171 void WebAssemblyPassConfig::addPreSched2() {}
173 void WebAssemblyPassConfig::addPreEmitPass() {}
virtual void addIRPasses()
Add common target configurable passes that perform LLVM IR to IR transforms following machine indepen...
Triple TargetTriple
Triple string, CPU name, and target feature strings the TargetMachine instance is created with...
Target TheWebAssemblyTarget64
Analysis pass providing the TargetTransformInfo.
std::string str() const
str - Get the contents as an std::string.
TargetIRAnalysis getTargetIRAnalysis() override
Get the TargetIRAnalysis for this target.
Attribute getFnAttribute(Attribute::AttrKind Kind) const
Return the attribute for the given attribute kind.
This file contains the entry points for global functions defined in the LLVM WebAssembly back-end...
bool hasAttribute(AttrKind Val) const
Return true if the attribute is present.
Target TheWebAssemblyTarget32
This file declares the WebAssembly-specific subclass of TargetLoweringObjectFile. ...
WebAssemblyTargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Reloc::Model RM, CodeModel::Model CM, CodeGenOpt::Level OL)
Create an WebAssembly architecture model.
FunctionPass * createAtomicExpandPass(const TargetMachine *TM)
No attributes have been set.
Target-Independent Code Generator Pass Configuration Options.
This file declares the WebAssembly-specific subclass of TargetMachine.
std::enable_if<!std::is_array< T >::value, std::unique_ptr< T > >::type make_unique(Args &&...args)
Constructs a new T() with the given args and returns a unique_ptr<T> which owns the object...
FunctionPass * createWebAssemblyISelDag(WebAssemblyTargetMachine &TM, CodeGenOpt::Level OptLevel)
This pass converts a legalized DAG into a WebAssembly-specific DAG, ready for instruction scheduling...
This file provides WebAssembly-specific target descriptions.
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang","erlang-compatible garbage collector")
This class describes a target machine that is implemented with the LLVM target-independent code gener...
FunctionPass class - This class is used to implement most global optimizations.
~WebAssemblyTargetMachine() override
Triple - Helper class for working with autoconf configuration names.
TargetPassConfig * createPassConfig(PassManagerBase &PM) override
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...
void setRequiresStructuredCFG(bool Value)
Pass * createLowerAtomicPass()
Target - Wrapper for Target specific information.
void resetTargetOptions(const Function &F) const
Reset the target options based on the function's attributes.
void LLVMInitializeWebAssemblyTarget()
StringRef getValueAsString() const
Return the attribute's value as a string.
RegisterTargetMachine - Helper template for registering a target machine implementation, for use in the target machine initialization function.
StringRef - Represent a constant reference to a string, i.e.
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml","ocaml 3.10-compatible collector")
const WebAssemblySubtarget * getSubtargetImpl(const Function &F) const override
Virtual method implemented by subclasses that returns a reference to that target's TargetSubtargetInf...