[PATCH] D108880: [WebAssembly] Support opaque pointers in FixFunctionBitcasts

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 30 00:54:09 PDT 2021


nikic added inline comments.


================
Comment at: llvm/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp:84-86
-        // Only add constant bitcasts to the list once; they get RAUW'd
-        auto C = ConstantBCs.insert(cast<Constant>(U.get()));
-        if (!C.second)
----------------
tlively wrote:
> Why can this logic be removed?
I dropped the RAUW call on constants that this is guarding against. With opaque pointers, there is no bitcast to RAUW (the only thing that could be potentially RAUWd is the GlobalAlias case).

I'm not sure if dropping the RAUW call itself is problematic, at least there was no test coverage for why it would be needed. I could imagine something like a function bitcast being called directly in one place, and then also being stored to memory in another place and then called indirectly or something like that? Though that already wouldn't work if there is no direct call and only indirect calls. So I'm not really sure why it was there.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108880



More information about the llvm-commits mailing list