<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/100308>100308</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[RISCV][MC] RISCVMCInstrAnalysis isCall
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
tianboh
</td>
</tr>
</table>
<pre>
I noticed that `RISCVMCInstrAnalysis::isCall` considers JAL and JALR.
```C
bool isCall(const MCInst &Inst) const override {
if (MCInstrAnalysis::isCall(Inst))
return true;
switch (Inst.getOpcode()) {
default:
return false;
case RISCV::JAL:
case RISCV::JALR:
return Inst.getOperand(0).getReg() != RISCV::X0;
}
}
```
Howerver, `C.J`, `C.JAL` and `C.JALR` can also be used to jump and its destination can be non `X0`. Is there any insight why we missing them?
Consider SPEC
![image](https://github.com/user-attachments/assets/f8cd7d2a-d630-451a-bb25-5a8c48f91ae4)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8VE1vpDgQ_TXFpdTImI-GA4cOva1NlNGueqTVXA0uwCOwI9uklX-_MjCdZHcUCckUVe_VU_kVwjk1aKIa8gfIz5FY_Ghs7ZXQrRmj1si3-hG18aojiX4UHqFg18fvzT_fmkftvD1pMb055SA9QXpSrhHTBAXDzminJFmHT6dnFFqG8xoDOwM7QcG2p9lixNaYCXc0LwPY49YBgRfhBF7h9t28krVKEsLx4RceUfUIvPxKFS93nvDccYiW_GI1ersQpDvje97dlO9G3NHxQP6vl85IAl5uVJ9lSOrFMvnQ-P8tejG59x4h0QlHuM5zk_p0ev4E_U3--nvud3VkhZbASwa8Cl-uNGxiEXgC6fkj3w_2SQ4cz3twf7vf1cfB_GluZF_JAm-CIZr4KRTcg9NzsEC49F_xdfWE0CgmZ7AlXFwwlMGfy_yyVirvUJLzSguvjF6LW0JtdCD5ERTE-OjQj2QJhX5DpZ0aRo-38Q1vhLNyTukhFMyQXj7KbXYz4ve__9gtF0aRP6hZDAT5GXg5ev-y-oVfgF8G5celjTszA78sjuxBeC-6cSbtHfCLcI7Wl77s5FFycZBFyg5ZnohD2_L8kIuyy8q-SgRld79Fsk5llVYiojo58qRkPKt4NNZ5WVB_TNIk6ZnMe5bKLhcVq0TCZNWmVaRqznjGjjxjBS8THlNf5UWZMdklohKUQsZoFmqKp-l1jo0dIuXcQnXCWMrKaBItTW5dc8413XDNAudh620dQId2GRxkbFLOu3car_y0_h821-RnyB--NZDvNvrPwu07HC12qr-YaGDfj8OLNT-p88Avq6Yw1F30a83_DQAA__9My1mk">