diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyLowerRefTypesIntPtrConv.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyLowerRefTypesIntPtrConv.cpp index c61aa5eff4a70..be500de67e320 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyLowerRefTypesIntPtrConv.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyLowerRefTypesIntPtrConv.cpp @@ -68,8 +68,7 @@ bool WebAssemblyLowerRefTypesIntPtrConv::runOnFunction(Function &F) { !(ITP && WebAssembly::isWebAssemblyReferenceType(ITP->getDestTy()))) continue; - UndefValue *U = UndefValue::get(I->getType()); - I->replaceAllUsesWith(U); + I->replaceAllUsesWith(PoisonValue::get(I->getType())); Function *TrapIntrin = Intrinsic::getOrInsertDeclaration(F.getParent(), Intrinsic::debugtrap);