22 #define DEBUG_TYPE "wasm-optimize-returned" 28 return "WebAssembly Optimize Returned";
52 "Optimize calls with \"returned\" attributes for WebAssembly",
56 return new OptimizeReturned();
59 void OptimizeReturned::visitCallSite(
CallSite CS) {
65 if (isa<Constant>(Arg))
70 if (DT->dominates(Inst, U))
77 LLVM_DEBUG(
dbgs() <<
"********** Optimize returned Attributes **********\n" 78 "********** Function: " 81 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.
This class represents lattice values for constants.
This file contains the entry points for global functions defined in the LLVM WebAssembly back-end...
AnalysisUsage & addRequired()
INITIALIZE_PASS(OptimizeReturned, DEBUG_TYPE, "Optimize calls with \eturned\attributes for WebAssembly", false, false) FunctionPass *llvm
FunctionPass * createWebAssemblyOptimizeReturned()
A Use represents the edge between a Value definition and its users.
InstrTy * getInstruction() const
virtual void getAnalysisUsage(AnalysisUsage &) const
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
ValTy * getArgOperand(unsigned i) const
bool paramHasAttr(unsigned ArgNo, Attribute::AttrKind Kind) const
Return true if the call or the callee has the given attribute.
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree...
static bool runOnFunction(Function &F, bool PostInlining)
Represent the analysis usage information of a pass.
FunctionPass class - This class is used to implement most global optimizations.
unsigned getNumArgOperands() const
void setPreservesCFG()
This function should be called by the pass, iff they do not:
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
amdgpu Simplify well known AMD library false Value Value * Arg
StringRef getName() const
Return a constant reference to the value's name.
LLVM Value Representation.
StringRef - Represent a constant reference to a string, i.e.
Legacy analysis pass which computes a DominatorTree.