blob: 45145c0a652745908d319ac6e32ec272437b60ba [file] [log] [blame]
Dan Gohman10e730a2015-06-29 23:51:55 +00001//===-- WebAssembly.h - Top-level interface for WebAssembly ----*- C++ -*-===//
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
Adrian Prantl5f8f34e42018-05-01 15:54:18 +000011/// This file contains the entry points for global functions defined in
Dan Gohman10e730a2015-06-29 23:51:55 +000012/// the LLVM WebAssembly back-end.
13///
14//===----------------------------------------------------------------------===//
15
16#ifndef LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLY_H
17#define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLY_H
18
Derek Schufff41f67d2016-08-01 21:34:04 +000019#include "llvm/PassRegistry.h"
Dan Gohman10e730a2015-06-29 23:51:55 +000020#include "llvm/Support/CodeGen.h"
21
22namespace llvm {
23
24class WebAssemblyTargetMachine;
Derek Schufff41f67d2016-08-01 21:34:04 +000025class ModulePass;
Dan Gohman10e730a2015-06-29 23:51:55 +000026class FunctionPass;
27
Dan Gohman0cfb5f82016-05-10 04:24:02 +000028// LLVM IR passes.
Derek Schuffccdceda2016-08-18 15:27:25 +000029ModulePass *createWebAssemblyLowerEmscriptenEHSjLj(bool DoEH, bool DoSjLj);
Sam Cleggbafe6902017-12-15 00:17:10 +000030ModulePass *createWebAssemblyLowerGlobalDtors();
Sam Clegg92617552018-07-11 04:29:36 +000031ModulePass *createWebAssemblyAddMissingPrototypes();
Dan Gohman1b637452017-01-07 00:34:54 +000032ModulePass *createWebAssemblyFixFunctionBitcasts();
Dan Gohman81719f82015-11-25 16:55:01 +000033FunctionPass *createWebAssemblyOptimizeReturned();
34
Dan Gohman0cfb5f82016-05-10 04:24:02 +000035// ISel and immediate followup passes.
Dan Gohman10e730a2015-06-29 23:51:55 +000036FunctionPass *createWebAssemblyISelDag(WebAssemblyTargetMachine &TM,
37 CodeGenOpt::Level OptLevel);
Dan Gohman1cf96c02015-12-09 16:23:59 +000038FunctionPass *createWebAssemblyArgumentMove();
Dan Gohmanbb372242016-01-26 03:39:31 +000039FunctionPass *createWebAssemblySetP2AlignOperands();
Dan Gohman10e730a2015-06-29 23:51:55 +000040
Dan Gohman0cfb5f82016-05-10 04:24:02 +000041// Late passes.
Heejin Ahn78d19102018-08-21 21:23:07 +000042FunctionPass *createWebAssemblyEHRestoreStackPointer();
Dan Gohman0cfb5f82016-05-10 04:24:02 +000043FunctionPass *createWebAssemblyReplacePhysRegs();
44FunctionPass *createWebAssemblyPrepareForLiveIntervals();
45FunctionPass *createWebAssemblyOptimizeLiveIntervals();
Heejin Ahn321d5222019-01-08 22:35:18 +000046FunctionPass *createWebAssemblyMemIntrinsicResults();
Dan Gohman1462faa2015-11-16 16:18:28 +000047FunctionPass *createWebAssemblyRegStackify();
48FunctionPass *createWebAssemblyRegColoring();
Dan Gohman4fc4e422016-10-24 19:49:43 +000049FunctionPass *createWebAssemblyExplicitLocals();
Dan Gohmand7a2eea2016-03-09 02:01:14 +000050FunctionPass *createWebAssemblyFixIrreducibleControlFlow();
Heejin Ahn4934f762018-06-25 01:07:11 +000051FunctionPass *createWebAssemblyLateEHPrepare();
Dan Gohmanf52ee172017-02-27 22:38:58 +000052FunctionPass *createWebAssemblyCFGSort();
Dan Gohman950a13c2015-09-16 16:51:30 +000053FunctionPass *createWebAssemblyCFGStackify();
Dan Gohmanf0b165a2015-12-05 03:03:35 +000054FunctionPass *createWebAssemblyLowerBrUnless();
Dan Gohmancf4748f2015-11-12 17:04:33 +000055FunctionPass *createWebAssemblyRegNumbering();
Dan Gohman81719f82015-11-25 16:55:01 +000056FunctionPass *createWebAssemblyPeephole();
Derek Schuff6f697832016-10-21 16:38:07 +000057FunctionPass *createWebAssemblyCallIndirectFixup();
Dan Gohman950a13c2015-09-16 16:51:30 +000058
Jacob Gravelle40926452018-03-30 20:36:58 +000059// PassRegistry initialization declarations.
Sam Clegg92617552018-07-11 04:29:36 +000060void initializeWebAssemblyAddMissingPrototypesPass(PassRegistry &);
Jacob Gravelle40926452018-03-30 20:36:58 +000061void initializeWebAssemblyLowerEmscriptenEHSjLjPass(PassRegistry &);
62void initializeLowerGlobalDtorsPass(PassRegistry &);
63void initializeFixFunctionBitcastsPass(PassRegistry &);
64void initializeOptimizeReturnedPass(PassRegistry &);
65void initializeWebAssemblyArgumentMovePass(PassRegistry &);
66void initializeWebAssemblySetP2AlignOperandsPass(PassRegistry &);
Heejin Ahn78d19102018-08-21 21:23:07 +000067void initializeWebAssemblyEHRestoreStackPointerPass(PassRegistry &);
Jacob Gravelle40926452018-03-30 20:36:58 +000068void initializeWebAssemblyReplacePhysRegsPass(PassRegistry &);
69void initializeWebAssemblyPrepareForLiveIntervalsPass(PassRegistry &);
70void initializeWebAssemblyOptimizeLiveIntervalsPass(PassRegistry &);
Heejin Ahn321d5222019-01-08 22:35:18 +000071void initializeWebAssemblyMemIntrinsicResultsPass(PassRegistry &);
Jacob Gravelle40926452018-03-30 20:36:58 +000072void initializeWebAssemblyRegStackifyPass(PassRegistry &);
73void initializeWebAssemblyRegColoringPass(PassRegistry &);
74void initializeWebAssemblyExplicitLocalsPass(PassRegistry &);
75void initializeWebAssemblyFixIrreducibleControlFlowPass(PassRegistry &);
Heejin Ahn4934f762018-06-25 01:07:11 +000076void initializeWebAssemblyLateEHPreparePass(PassRegistry &);
Heejin Ahn04c48942018-06-25 01:20:21 +000077void initializeWebAssemblyExceptionInfoPass(PassRegistry &);
Jacob Gravelle40926452018-03-30 20:36:58 +000078void initializeWebAssemblyCFGSortPass(PassRegistry &);
79void initializeWebAssemblyCFGStackifyPass(PassRegistry &);
80void initializeWebAssemblyLowerBrUnlessPass(PassRegistry &);
81void initializeWebAssemblyRegNumberingPass(PassRegistry &);
82void initializeWebAssemblyPeepholePass(PassRegistry &);
83void initializeWebAssemblyCallIndirectFixupPass(PassRegistry &);
84
Dan Gohman10e730a2015-06-29 23:51:55 +000085} // end namespace llvm
86
87#endif