Skip to content

Commit 0ab2061

Browse files
authored
[WebAssembly] Represent trap instructions as poison (#134553)
The WebAssemblyLowerRefTypesIntPtrConv pass currently uses `undef` to represent trap instructions. These can instead be represented by the `poison` value.
1 parent 771b94f commit 0ab2061

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

llvm/lib/Target/WebAssembly/WebAssemblyLowerRefTypesIntPtrConv.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ bool WebAssemblyLowerRefTypesIntPtrConv::runOnFunction(Function &F) {
6868
!(ITP && WebAssembly::isWebAssemblyReferenceType(ITP->getDestTy())))
6969
continue;
7070

71-
UndefValue *U = UndefValue::get(I->getType());
72-
I->replaceAllUsesWith(U);
71+
I->replaceAllUsesWith(PoisonValue::get(I->getType()));
7372

7473
Function *TrapIntrin =
7574
Intrinsic::getOrInsertDeclaration(F.getParent(), Intrinsic::debugtrap);

0 commit comments

Comments
 (0)