[PATCH] D57480: [WebAssembly] Remove TODO on wasm.extract.exception intrinsic (NFC)

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 30 15:11:17 PST 2019


aheejin created this revision.
aheejin added a reviewer: dschuff.
Herald added subscribers: llvm-commits, sunfish, jgravelle-google, sbc100.

We planned to delete this intrinsic and do custom lowering from
wasm.get.exception, which has a token argument, to EXTRACT_EXCEPTION, a
wasm pseudo instruction that simulates popping a value from the wasm
stack.

To do that, we need to introduce a new `WebAssemblyISD` node for this,
which itself is not a problem, but also have to introduce the
`WebAssemblyISD` namespace in SelectionDAGBuilder.cpp. I don't think any
other targets are doing that in the file. And also putting a
target-specific intrinsic in the common file is a little weird too. (All
other intrinsic functions in this `visitIntrinsicCall` functions are not
target-specific ones. Other target-specific intrinsics are usually
handled in lib/Target/[TargetName]/[TargetName]ISelLowering.cpp. The
reason we can't do this is it has a token argument.

Anyway, so I think I prefer the current code with one redundant
intrinsic more than adding one more `WebAssemblyISD` node and
also introducing the `WebAssemblyISD` namespace into
SelectionDAGBuilder.cpp. What do you think?


Repository:
  rL LLVM

https://reviews.llvm.org/D57480

Files:
  include/llvm/IR/IntrinsicsWebAssembly.td


Index: include/llvm/IR/IntrinsicsWebAssembly.td
===================================================================
--- include/llvm/IR/IntrinsicsWebAssembly.td
+++ include/llvm/IR/IntrinsicsWebAssembly.td
@@ -51,8 +51,6 @@
                                         [IntrHasSideEffects]>;
 // This is the same as llvm.wasm.get.exception except that it does not take a
 // token operand. This is only for instruction selection purpose.
-// TODO Remove this redundant intrinsic and do custom lowering on
-// int_wasm_get_exception instead
 def int_wasm_extract_exception : Intrinsic<[llvm_ptr_ty], [],
                                            [IntrHasSideEffects]>;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57480.184383.patch
Type: text/x-patch
Size: 668 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190130/c7f5584a/attachment.bin>


More information about the llvm-commits mailing list