LLVM  9.0.0svn
WebAssemblySubtarget.cpp
Go to the documentation of this file.
1 //===-- WebAssemblySubtarget.cpp - WebAssembly Subtarget Information ------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 ///
9 /// \file
10 /// This file implements the WebAssembly-specific subclass of
11 /// TargetSubtarget.
12 ///
13 //===----------------------------------------------------------------------===//
14 
15 #include "WebAssemblySubtarget.h"
17 #include "WebAssemblyInstrInfo.h"
19 using namespace llvm;
20 
21 #define DEBUG_TYPE "wasm-subtarget"
22 
23 #define GET_SUBTARGETINFO_CTOR
24 #define GET_SUBTARGETINFO_TARGET_DESC
25 #include "WebAssemblyGenSubtargetInfo.inc"
26 
28 WebAssemblySubtarget::initializeSubtargetDependencies(StringRef FS) {
29  // Determine default and user-specified characteristics
30 
31  if (CPUString.empty())
32  CPUString = "generic";
33 
34  ParseSubtargetFeatures(CPUString, FS);
35  return *this;
36 }
37 
39  const std::string &CPU,
40  const std::string &FS,
41  const TargetMachine &TM)
42  : WebAssemblyGenSubtargetInfo(TT, CPU, FS), CPUString(CPU),
43  TargetTriple(TT), FrameLowering(),
44  InstrInfo(initializeSubtargetDependencies(FS)), TSInfo(),
45  TLInfo(TM, *this) {}
46 
48  // Disable the MachineScheduler for now. Even with ShouldTrackPressure set and
49  // enableMachineSchedDefaultSched overridden, it appears to have an overall
50  // negative effect for the kinds of register optimizations we're doing.
51  return false;
52 }
53 
54 bool WebAssemblySubtarget::useAA() const { return true; }
bool enableMachineScheduler() const override
This class represents lattice values for constants.
Definition: AllocatorList.h:23
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:43
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:58
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:48