LLVM  8.0.0svn
WebAssemblySubtarget.cpp
Go to the documentation of this file.
1 //===-- WebAssemblySubtarget.cpp - WebAssembly Subtarget Information ------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 ///
10 /// \file
11 /// This file implements the WebAssembly-specific subclass of
12 /// TargetSubtarget.
13 ///
14 //===----------------------------------------------------------------------===//
15 
16 #include "WebAssemblySubtarget.h"
18 #include "WebAssemblyInstrInfo.h"
20 using namespace llvm;
21 
22 #define DEBUG_TYPE "wasm-subtarget"
23 
24 #define GET_SUBTARGETINFO_CTOR
25 #define GET_SUBTARGETINFO_TARGET_DESC
26 #include "WebAssemblyGenSubtargetInfo.inc"
27 
29 WebAssemblySubtarget::initializeSubtargetDependencies(StringRef FS) {
30  // Determine default and user-specified characteristics
31 
32  if (CPUString.empty())
33  CPUString = "generic";
34 
35  ParseSubtargetFeatures(CPUString, FS);
36  return *this;
37 }
38 
40  const std::string &CPU,
41  const std::string &FS,
42  const TargetMachine &TM)
43  : WebAssemblyGenSubtargetInfo(TT, CPU, FS), HasSIMD128(false),
44  HasAtomics(false), HasNontrappingFPToInt(false), HasSignExt(false),
45  HasExceptionHandling(false), CPUString(CPU), TargetTriple(TT),
46  FrameLowering(), InstrInfo(initializeSubtargetDependencies(FS)), TSInfo(),
47  TLInfo(TM, *this) {}
48 
50  // Disable the MachineScheduler for now. Even with ShouldTrackPressure set and
51  // enableMachineSchedDefaultSched overridden, it appears to have an overall
52  // negative effect for the kinds of register optimizations we're doing.
53  return false;
54 }
55 
56 bool WebAssemblySubtarget::useAA() const { return true; }
bool enableMachineScheduler() const override
This class represents lattice values for constants.
Definition: AllocatorList.h:24
void ParseSubtargetFeatures(StringRef CPU, StringRef FS)
Parses features string setting specified subtarget options.
This file provides WebAssembly-specific target descriptions.
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
This file declares the WebAssembly-specific subclass of TargetSubtarget.
This file contains the WebAssembly implementation of the TargetInstrInfo class.
WebAssemblySubtarget(const Triple &TT, const std::string &CPU, const std::string &FS, const TargetMachine &TM)
This constructor initializes the data members to match that of the specified triple.
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:59
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49