Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/lib/Target/WebAssembly/WebAssemblySubtarget.cpp
Line
Count
Source
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"
16
#include "MCTargetDesc/WebAssemblyMCTargetDesc.h"
17
#include "WebAssemblyInstrInfo.h"
18
#include "llvm/Support/TargetRegistry.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
27
WebAssemblySubtarget &
28
546
WebAssemblySubtarget::initializeSubtargetDependencies(StringRef FS) {
29
546
  // Determine default and user-specified characteristics
30
546
31
546
  if (CPUString.empty())
32
523
    CPUString = "generic";
33
546
34
546
  ParseSubtargetFeatures(CPUString, FS);
35
546
  return *this;
36
546
}
37
38
WebAssemblySubtarget::WebAssemblySubtarget(const Triple &TT,
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
546
      TLInfo(TM, *this) {}
46
47
4.45k
bool WebAssemblySubtarget::enableAtomicExpand() const {
48
4.45k
  // If atomics are disabled, atomic ops are lowered instead of expanded
49
4.45k
  return hasAtomics();
50
4.45k
}
51
52
13.3k
bool WebAssemblySubtarget::enableMachineScheduler() const {
53
13.3k
  // Disable the MachineScheduler for now. Even with ShouldTrackPressure set and
54
13.3k
  // enableMachineSchedDefaultSched overridden, it appears to have an overall
55
13.3k
  // negative effect for the kinds of register optimizations we're doing.
56
13.3k
  return false;
57
13.3k
}
58
59
647
bool WebAssemblySubtarget::useAA() const { return true; }