[PATCH] D94039: [WebAssembly] Update WasmEHPrepare for the new spec

Derek Schuff via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 6 15:57:05 PST 2021


dschuff added inline comments.


================
Comment at: llvm/lib/CodeGen/WasmEHPrepare.cpp:374-375
+  // be lowered to wasm 'catch' instruction. We do this mainly because
+  // instruction selection cannot handle wasm.get.exception intrinsic's token
+  // argument.
+  Instruction *CatchCI =
----------------
tlively wrote:
> What is the token argument used for? Could clang generate `llvm.wasm.catch` directly?
Token arguments (https://llvm.org/docs/ExceptionHandling.html#wineh) are used to preserve the original scoping structure in mid-level optimization passes. I haven't looked at this intrinsic recently but I'd guess that maybe the token keeps it from getting moved out of its containing scope?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94039/new/

https://reviews.llvm.org/D94039



More information about the cfe-commits mailing list