1 //=- WebAssemblyISelLowering.cpp - WebAssembly DAG Lowering Implementation -==//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 /// \brief This file implements the WebAssemblyTargetLowering class.
13 //===----------------------------------------------------------------------===//
15 #include "WebAssemblyISelLowering.h"
16 #include "MCTargetDesc/WebAssemblyMCTargetDesc.h"
17 #include "WebAssemblyMachineFunctionInfo.h"
18 #include "WebAssemblySubtarget.h"
19 #include "WebAssemblyTargetMachine.h"
20 #include "WebAssemblyTargetObjectFile.h"
21 #include "llvm/CodeGen/Analysis.h"
22 #include "llvm/CodeGen/MachineRegisterInfo.h"
23 #include "llvm/CodeGen/SelectionDAG.h"
24 #include "llvm/IR/Function.h"
25 #include "llvm/IR/Intrinsics.h"
26 #include "llvm/Support/CommandLine.h"
27 #include "llvm/Support/Debug.h"
28 #include "llvm/Support/ErrorHandling.h"
29 #include "llvm/Support/raw_ostream.h"
30 #include "llvm/Target/TargetOptions.h"
33 #define DEBUG_TYPE "wasm-lower"
35 WebAssemblyTargetLowering::WebAssemblyTargetLowering(
36 const TargetMachine &TM, const WebAssemblySubtarget &STI)
37 : TargetLowering(TM), Subtarget(&STI) {
38 // WebAssembly does not produce floating-point exceptions on normal floating
40 setHasFloatingPointExceptions(false);
43 //===----------------------------------------------------------------------===//
44 // WebAssembly Lowering private implementation.
45 //===----------------------------------------------------------------------===//
47 //===----------------------------------------------------------------------===//
49 //===----------------------------------------------------------------------===//
51 //===----------------------------------------------------------------------===//
52 // Other Lowering Code
53 //===----------------------------------------------------------------------===//
55 //===----------------------------------------------------------------------===//
56 // WebAssembly Optimization Hooks
57 //===----------------------------------------------------------------------===//
59 MCSection *WebAssemblyTargetObjectFile::SelectSectionForGlobal(
60 const GlobalValue *GV, SectionKind Kind, Mangler &Mang,
61 const TargetMachine &TM) const {
62 return getDataSection();