21 #define DEBUG_TYPE "wasm-optimize-returned" 27 return "WebAssembly Optimize Returned";
51 "Optimize calls with \"returned\" attributes for WebAssembly",
55 return new OptimizeReturned();
58 void OptimizeReturned::visitCallSite(
CallSite CS) {
64 if (isa<Constant>(Arg))
68 [&](
Use &U) {
return DT->dominates(Inst, U); });
73 LLVM_DEBUG(
dbgs() <<
"********** Optimize returned Attributes **********\n" 74 "********** Function: " 77 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...
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...
void replaceUsesWithIf(Value *New, llvm::function_ref< bool(Use &U)> ShouldReplace)
Go through the uses list for this definition and make each use point to "V" if the callback ShouldRep...
static bool runOnFunction(Function &F, bool PostInlining)
unsigned getNumArgOperands() const
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
Represent the analysis usage information of a pass.
FunctionPass class - This class is used to implement most global optimizations.
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
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.
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.
ValTy * getArgOperand(unsigned i) const