LLVM  3.7.0
WebAssemblyISelLowering.cpp
Go to the documentation of this file.
1 //=- WebAssemblyISelLowering.cpp - WebAssembly DAG Lowering Implementation -==//
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 /// \brief This file implements the WebAssemblyTargetLowering class.
12 ///
13 //===----------------------------------------------------------------------===//
14 
18 #include "WebAssemblySubtarget.h"
21 #include "llvm/CodeGen/Analysis.h"
24 #include "llvm/IR/Function.h"
25 #include "llvm/IR/Intrinsics.h"
27 #include "llvm/Support/Debug.h"
31 using namespace llvm;
32 
33 #define DEBUG_TYPE "wasm-lower"
34 
36  const TargetMachine &TM, const WebAssemblySubtarget &STI)
37  : TargetLowering(TM), Subtarget(&STI) {
38  // WebAssembly does not produce floating-point exceptions on normal floating
39  // point operations.
41  // We don't know the microarchitecture here, so just reduce register pressure.
43 }
44 
45 //===----------------------------------------------------------------------===//
46 // WebAssembly Lowering private implementation.
47 //===----------------------------------------------------------------------===//
48 
49 //===----------------------------------------------------------------------===//
50 // Lowering Code
51 //===----------------------------------------------------------------------===//
52 
53 //===----------------------------------------------------------------------===//
54 // Other Lowering Code
55 //===----------------------------------------------------------------------===//
56 
57 //===----------------------------------------------------------------------===//
58 // WebAssembly Optimization Hooks
59 //===----------------------------------------------------------------------===//
60 
62  const GlobalValue *GV, SectionKind Kind, Mangler &Mang,
63  const TargetMachine &TM) const {
64  return getDataSection();
65 }
Instances of this class represent a uniqued identifier for a section in the current translation unit...
Definition: MCSection.h:48
This file defines the interfaces that WebAssembly uses to lower LLVM code into a selection DAG...
MCSection * SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind, Mangler &Mang, const TargetMachine &TM) const override
void setHasFloatingPointExceptions(bool FPExceptions=true)
Tells the code generator that this target supports floating point exceptions and cares about preservi...
MCSection * getDataSection() const
This file declares the WebAssembly-specific subclass of TargetLoweringObjectFile. ...
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
This file declares the WebAssembly-specific subclass of TargetMachine.
This file provides WebAssembly-specific target descriptions.
SectionKind - This is a simple POD value that classifies the properties of a section.
Definition: SectionKind.h:28
WebAssemblyTargetLowering(const TargetMachine &TM, const WebAssemblySubtarget &STI)
This file declares the WebAssembly-specific subclass of TargetSubtarget.
This file declares WebAssembly-specific per-machine-function information.
const ARM::ArchExtKind Kind
void setSchedulingPreference(Sched::Preference Pref)
Specify the target scheduling preference.
Primary interface to the complete machine description for the target machine.