CALL_S at least need one operand as call func index. This case needs to
be identifer during removing register operands. Otherwise incorrect CALL_S
instruction will crash other part.
Invalid CALL_S will be replaced with UNREACHABLE
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp | ||
---|---|---|
99 | I use arc diff to submit patch. It seems to format the whole file and cause this change. |
I think the problem is, the call is instruction-selected as CALL, when it is supposed to be selected as CALL_INDIRECT. FastIsel selects it with CALL_INDIRECT; you can see the test passes with -fast-isel. I tried to fix this in ISel in D147033. PTAL.
detail fix see https://reviews.llvm.org/D147033, only add assert in this patch to avoid further spread of errors
I'm not sure if it makes much sense to only check about CALLs condition at the end of the pipeline. If we want to do that, we should be doing check for all instructions, which is equivalent to running a checker. We have a type checker, but this is to ensure the validity of assembly files we parse. If we emit an invalid instruction and something crashes at the end, I think that means we should be fixing the bug that emitted the invalid instruction, rather than asserting for a single instruction here.
I use arc diff to submit patch. It seems to format the whole file and cause this change.