[PATCH] D38640: [WebAssembly] Narrow the scope of WebAssemblyFixFunctionBitcasts

Dan Gohman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 6 17:07:03 PDT 2017


sunfish added a comment.

That makes sense. This patch looks good to me, with Invokes handled.



================
Comment at: lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp:72
+      Instruction *I = dyn_cast<Instruction>(U.getUser());
+      if (!I || I->getOpcode() != Instruction::Call)
+        // Skip uses that aren't immediately called
----------------
jgravelle-google wrote:
> dschuff wrote:
> > How about invoke? Also, are we filtering out intrinsics anywhere? (An `IntrinsicInst` is a `CallInst` but I forget if its opcode is `Instruction::Call` or not)
> Not sure, will check and add tests
The CallSite class is one way to handle both Calls and Invokes at the same time.

Also, it's invalid to do anything with the address of an intrinsic except directly call it, so we shouldn't have to worry about them.


https://reviews.llvm.org/D38640





More information about the llvm-commits mailing list