22 #define DEBUG_TYPE "wasm-optimize-returned"
28 return "WebAssembly Optimize Returned";
52 return new OptimizeReturned();
55 void OptimizeReturned::visitCallSite(
CallSite CS) {
61 if (isa<Constant>(Arg))
66 if (DT->dominates(Inst, U))
72 bool OptimizeReturned::runOnFunction(
Function &
F) {
73 DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree();
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
Base class for instruction visitors.
virtual void getAnalysisUsage(AnalysisUsage &) const
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
This file contains the entry points for global functions defined in the LLVM WebAssembly back-end...
AnalysisUsage & addRequired()
A Use represents the edge between a Value definition and its users.
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree...
Represent the analysis usage information of a pass.
FunctionPass class - This class is used to implement most global optimizations.
InstrTy * getInstruction() const
void setPreservesCFG()
This function should be called by the pass, iff they do not:
unsigned getNumArgOperands() const
bool paramHasAttr(unsigned i, Attribute::AttrKind Kind) const
Return true if the call or the callee has the given attribute.
LLVM Value Representation.
ValTy * getArgOperand(unsigned i) const
FunctionPass * createWebAssemblyOptimizeReturned()
StringRef - Represent a constant reference to a string, i.e.
Legacy analysis pass which computes a DominatorTree.