[WebAssembly] Remove unnecessary code after #187484 (NFC)#194188
Merged
[WebAssembly] Remove unnecessary code after #187484 (NFC)#194188
Conversation
This code was written under the assumption that `fixCallUnwindMismatches` runs before `fixCatchUnwindMismatches`, but since llvm#187484 it's not true anymore.
Member
|
@llvm/pr-subscribers-backend-webassembly Author: Heejin Ahn (aheejin) ChangesThis code was written under the assumption that Full diff: https://github.com/llvm/llvm-project/pull/194188.diff 1 Files Affected:
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp
index 540388cb17b68..5680cbc60ff8f 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp
@@ -2141,25 +2141,13 @@ bool WebAssemblyCFGStackify::fixCatchUnwindMismatches(MachineFunction &MF) {
for (auto &MBB : reverse(MF)) {
for (auto &MI : reverse(MBB)) {
- if (MI.getOpcode() == WebAssembly::TRY)
+ if (WebAssembly::isTry(MI.getOpcode())) {
EHPadStack.pop_back();
- else if (MI.getOpcode() == WebAssembly::TRY_TABLE) {
- // We want to exclude try_tables created in fixCallUnwindMismatches.
- // Check if the try_table's unwind destination matches the EH pad stack
- // top. If it is created in fixCallUnwindMismatches, it wouldn't.
- if (getSingleUnwindDest(&MI) == EHPadStack.back())
- EHPadStack.pop_back();
- } else if (MI.getOpcode() == WebAssembly::DELEGATE)
+ } else if (MI.getOpcode() == WebAssembly::DELEGATE) {
EHPadStack.push_back(&MBB);
- else if (WebAssembly::isCatch(MI.getOpcode())) {
+ } else if (WebAssembly::isCatch(MI.getOpcode())) {
auto *EHPad = &MBB;
- // If the BB has a catch pseudo instruction but is not marked as an EH
- // pad, it's a trampoline BB we created in fixCallUnwindMismatches. Skip
- // it.
- if (!EHPad->isEHPad())
- continue;
-
// catch_all always catches an exception, so we don't need to do
// anything
if (WebAssembly::isCatchAll(MI.getOpcode())) {
|
aheejin
commented
Apr 25, 2026
| for (auto &MBB : reverse(MF)) { | ||
| for (auto &MI : reverse(MBB)) { | ||
| if (MI.getOpcode() == WebAssembly::TRY) | ||
| if (WebAssembly::isTry(MI.getOpcode())) { |
Member
Author
There was a problem hiding this comment.
Added braces for consistency.
🐧 Linux x64 Test Results
✅ The build succeeded and all tests passed. |
dschuff
approved these changes
Apr 27, 2026
kirthana14m
pushed a commit
to ROCm/llvm-project
that referenced
this pull request
Apr 30, 2026
…94188) This code was written under the assumption that `fixCallUnwindMismatches` runs before `fixCatchUnwindMismatches`, but since llvm#187484 it's not true anymore.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This code was written under the assumption that
fixCallUnwindMismatchesruns beforefixCatchUnwindMismatches, but since #187484 it's not true anymore.