[PATCH] D43746: [WebAssembly] Add Wasm exception handling prepare pass
David Majnemer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 17 16:36:34 PDT 2018
majnemer added inline comments.
================
Comment at: lib/CodeGen/WasmEHPrepare.cpp:185-187
+ if (isa<CatchPadInst>(BB.getFirstNonPHI()))
+ CatchPads.push_back(&BB);
+ else if (isa<CleanupPadInst>(BB.getFirstNonPHI()))
----------------
I'd save and reuse BB.getFirstNonPHI.
================
Comment at: lib/CodeGen/WasmEHPrepare.cpp:269-275
+ for (auto &I : *BB)
+ if (auto *CI = dyn_cast<CallInst>(&I)) {
+ if (CI->getCalledValue() == GetExnF)
+ GetExnCI = CI;
+ if (CI->getCalledValue() == GetSelectorF)
+ GetSelectorCI = CI;
+ }
----------------
What if BB branches to a block which calls wasm.get.exception? What if two different catchpads branch to a block which calls wasm.get.exception? ISTM that you might want to give it the token of the catchpad/cleanuppad somehow?
Repository:
rL LLVM
https://reviews.llvm.org/D43746
More information about the llvm-commits
mailing list