LLVM: lib/Target/WebAssembly/WebAssemblyArgumentMove.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
35using namespace llvm;
36
37#define DEBUG_TYPE "wasm-argument-move"
38
39namespace {
41public:
42 static char ID;
44
45 StringRef getPassName() const override { return "WebAssembly Argument Move"; }
46
47 void getAnalysisUsage(AnalysisUsage &AU) const override {
52 }
53
55};
56}
57
58char WebAssemblyArgumentMove::ID = 0;
60 "Move ARGUMENT instructions for WebAssembly", false, false)
61
63 return new WebAssemblyArgumentMove();
64}
65
66bool WebAssemblyArgumentMove::runOnMachineFunction(MachineFunction &MF) {
68 dbgs() << "********** Argument Move **********\n"
69 << "********** Function: " << MF.getName() << '\n';
70 });
71
73 MachineBasicBlock &EntryMBB = MF.front();
75
76
77 for (MachineInstr &MI : EntryMBB) {
79 InsertPt = MI;
80 break;
81 }
82 }
83
84
85
88 EntryMBB.insert(InsertPt, MI.removeFromParent());
90 }
91 }
92
94}
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
This file provides WebAssembly-specific target descriptions.
This file contains the declaration of the WebAssembly-specific utility functions.
This file contains the entry points for global functions defined in the LLVM WebAssembly back-end.
Represent the analysis usage information of a pass.
AnalysisUsage & addPreservedID(const void *ID)
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
LLVM_ABI void setPreservesCFG()
This function should be called by the pass, iff they do not:
FunctionPass class - This class is used to implement most global optimizations.
MachineInstrBundleIterator< MachineInstr > iterator
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
const MachineBasicBlock & front() const
StringRef - Represent a constant reference to a string, i.e.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
bool isArgument(unsigned Opc)
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI char & MachineDominatorsID
MachineDominators - This pass is a machine dominators analysis pass.
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
FunctionPass * createWebAssemblyArgumentMove()