Skip to content

Commit 8c939f5

Browse files
authored
[WebAssembly] Change placeholder from undef to poison (#131536)
Use `poison` instead of `undef` as a placeholder for phi entries of unreachable predecessors.
1 parent 846cf86 commit 8c939f5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,7 +1767,7 @@ void WebAssemblyLowerEmscriptenEHSjLj::handleLongjmpableCallsForWasmSjLj(
17671767
I->eraseFromParent();
17681768

17691769
// Add entries for new predecessors to phis in unwind destinations. We use
1770-
// 'undef' as a placeholder value. We should make sure the phis have a valid
1770+
// 'poison' as a placeholder value. We should make sure the phis have a valid
17711771
// set of predecessors before running SSAUpdater, because SSAUpdater
17721772
// internally can use existing phis to gather predecessor info rather than
17731773
// scanning the actual CFG (See FindPredecessorBlocks in SSAUpdater.cpp for
@@ -1776,7 +1776,7 @@ void WebAssemblyLowerEmscriptenEHSjLj::handleLongjmpableCallsForWasmSjLj(
17761776
for (PHINode &PN : UnwindDest->phis()) {
17771777
for (auto *NewPred : NewPreds) {
17781778
assert(PN.getBasicBlockIndex(NewPred) == -1);
1779-
PN.addIncoming(UndefValue::get(PN.getType()), NewPred);
1779+
PN.addIncoming(PoisonValue::get(PN.getType()), NewPred);
17801780
}
17811781
}
17821782
}

0 commit comments

Comments
 (0)