[PATCH] D43744: [WebAssembly] Fix rethrow's argument type

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 2 00:34:59 PST 2018


aheejin added a comment.

Yeah, I agree this is ugly.. but don't know how to get around it. The argument for `rethrow` is an `except_ref` value, which cannot be represented in LLVM IR.  So when lowering `rethrow` intrinsic into `rethrow` instruction, if we want to add the `except_ref` argument to the td file, we need a dummy argument, something like `nullref`, to insert. Before, `rethrow` used to take an integer (relative depth), so we initialized the argument with 0 when lowering it as follows:

  def : Pat<(int_wasm_rethrow), (RETHROW 0)>;

But now, we don't have a dummy value, like 0 above, to initialize the lowered instruction with. That's the reason I omitted the argument in the td file.

I think we can add arguments that are not in the td file. For example, in the td file, `br` and `br_if` takes `bb_op`, but `CFGStackify` deletes all of them and adds an immediate (relative depth) instead.


Repository:
  rL LLVM

https://reviews.llvm.org/D43744





More information about the llvm-commits mailing list