blob: 4184eb6dc5a6a416db85b9622ce975dc9b3dbef1 [file] [log] [blame]
Dan Gohman10e730a2015-06-29 23:51:55 +00001//=- 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
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"
31using namespace llvm;
32
33#define DEBUG_TYPE "wasm-lower"
34
35WebAssemblyTargetLowering::WebAssemblyTargetLowering(
36 const TargetMachine &TM, const WebAssemblySubtarget &STI)
Dan Gohmanbfaf7e12015-07-02 21:36:25 +000037 : TargetLowering(TM), Subtarget(&STI) {
38 // WebAssembly does not produce floating-point exceptions on normal floating
39 // point operations.
40 setHasFloatingPointExceptions(false);
Dan Gohman489abd72015-07-07 22:38:06 +000041 // We don't know the microarchitecture here, so just reduce register pressure.
42 setSchedulingPreference(Sched::RegPressure);
Dan Gohmanbfaf7e12015-07-02 21:36:25 +000043}
Dan Gohman10e730a2015-06-29 23:51:55 +000044
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
61MCSection *WebAssemblyTargetObjectFile::SelectSectionForGlobal(
62 const GlobalValue *GV, SectionKind Kind, Mangler &Mang,
63 const TargetMachine &TM) const {
64 return getDataSection();
65}