26#define DEBUG_TYPE "wasm-lower-reftypes-intptr-conv"
29class WebAssemblyLowerRefTypesIntPtrConv final :
public FunctionPass {
31 return "WebAssembly Lower RefTypes Int-Ptr Conversions";
42char WebAssemblyLowerRefTypesIntPtrConv::ID = 0;
44 "WebAssembly Lower RefTypes Int-Ptr Conversions",
false,
false)
47 return new WebAssemblyLowerRefTypesIntPtrConv();
50bool WebAssemblyLowerRefTypesIntPtrConv::runOnFunction(
Function &
F) {
51 LLVM_DEBUG(
dbgs() <<
"********** Lower RefTypes IntPtr Convs **********\n"
52 "********** Function: "
53 <<
F.getName() <<
'\n');
61 std::set<Instruction *> worklist;
72 I->replaceAllUsesWith(U);
85 return !worklist.empty();
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
This file declares the WebAssembly-specific subclass of TargetSubtarget.
This file contains the declaration of the WebAssembly-specific type parsing utility functions.
This file contains the entry points for global functions defined in the LLVM WebAssembly back-end.
static CallInst * Create(FunctionType *Ty, Value *F, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
Type * getDestTy() const
Return the destination type, as a convenience.
FunctionPass class - This class is used to implement most global optimizations.
virtual bool runOnFunction(Function &F)=0
runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass.
This class represents a cast from an integer to a pointer.
virtual StringRef getPassName() const
getPassName - Return a nice clean name for a pass.
This class represents a cast from a pointer to an integer.
Value * getPointerOperand()
Gets the pointer operand.
StringRef - Represent a constant reference to a string, i.e.
'undef' values are things that do not have specified contents.
static UndefValue * get(Type *T)
Static factory methods - Return an 'undef' object of the specified type.
Type * getType() const
All values are typed, get the type of this value.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Function * getOrInsertDeclaration(Module *M, ID id, ArrayRef< Type * > Tys={})
Look up the Function declaration of the intrinsic id in the Module M.
bool isWebAssemblyReferenceType(const Type *Ty)
Return true if this is a WebAssembly Reference Type.
This is an optimization pass for GlobalISel generic memory operations.
FunctionPass * createWebAssemblyLowerRefTypesIntPtrConv()
inst_iterator inst_begin(Function *F)
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
inst_iterator inst_end(Function *F)