This reverts commit 313f9f54f5a85790ae09cc48c1df54a4c635a3e3.
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
It seems incorrect for me as the input IR has an alias casting function pointer to data pointer. That symbol itself should be regarded as a function symbol any more. If that IR needs to pass compilation, it should correct its generation by replacing that casting with one casting between function pointers. The casting from a function pointer to data pointer could be done within the accessor function.
Sounds reasonable. We can looking into other solutions.
My understand is that the IR in question is perfectly valid, and can be compiled on other targets, can't it? Its only WebAssembly that can't compile this. We can't ask the producer so not produce this valid bitcode when building for WebAssembly can we?
Yeah, that IR itself is valid, but WASM has more restrictive assertions. It assumes data symbol should be referenced to data location only. As WASM is a virtual ISA, that assumption is right as all references to code fragments would be invalid except kernel entries (used in function invocation). But that's not true for other binary formats, symbols in non-function types may be offsets in code.