<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/64601>64601</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Backport 2df9328fe3a0575fa415964a3c3544b0912b168e to 17.0
</td>
</tr>
<tr>
<th>Labels</th>
<td>
backend:RISC-V,
release:backport
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
topperc
</td>
</tr>
</table>
<pre>
If we see a vector fptosi or fptoui after an llvm.rint, we will emit a csr write to change the FP rounding mode to 7 which is an illegal value and will cause the CSR write to trap. This commit disables this DAG combine for this case to avoid the issue with the least risk.
Patch commit message:
FRINT was added to matchRoundingOp after this function was written.
So FRINT was not tested originally.
For vectors, folding this causes us to create a CSR swap that tries
to write 7 to FRM. This is an illegal value and will cause the CSR
write to fail.
While this might be a legal fold we could do, I'm disabling it for
now so we can backport to LLVM 17 with the least risk.****
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMU8GOozgQ_RpzKXUEJpBw4NDTLVYtzeyO0qPZc2EX4B1jI7voaP5-ZUJPWto9jBQlDkW9V--9MsZoRkfUiuqTqJ4zXHnyoWW_LBRU1nv9s30Z4EoQiQDhjRT7AMPCPhrYT6sBHJgCoANr3-ZDMI6FfEptV2Mt0GwYEFQMcA2GCdiDmtCNBDwRdF8h-NVp40aYvd7KJ7hORk1gYkI11tKIFt7QrgTo9A1X4RpvEE-vlzs0B1wO8G0yEZSfE7c2EXtLETg9fH78IxV64wgGH24PFcatGd-80RumiXFNAnja_lrCyBBM_HEQ-bPIH2_fX5HV9M4zU4w4kij3InSXlz-_wRUjoNakE8GcGi673r-W3bpthmF1io13W0OSw-R2MgCAV_8Bz3kGpsikwQczGofW_vzw8v3U-bDnFlMog7eb07vqNVKENW6RBEJOKSc34xUX4AkZOBiKdzj2u9OndOwuX3arfz-pO9avyAY09r_D_z0ZS7dBZzNODH2a7kaQZKQFU361GrRP0l6EPM172Emi4ZTvHdb5K0S_daGDHtWPxQdO_J8_f_8Cxen_05aPvz6ZbkvdlA1m1BZ1U9TnShZ1NrVqaApZNaoqT1XV13podF0UzSmv-7PSdZOZVuayzM9FXtRlWdaHIUc6NvpcUE953p_FMac52bBdIR_GbFvAtj7WeZFZ7MnG7ZpKmSYnp0X5eHl5fXr4LqQU8klIGSjNnfbvXVwqVc9ZaBPqQ7-OURxzayLHOw8bttR-erdD6qEp5XmgEvPqVA14LKqmPmKpyup47POmkH1Rn7fcitMhz9Zg24l5iWnvZSdkNxqe1v6g_Cxkl3j2n4cl-H9IsZDdJi4K2W36_g0AAP__tFV4vg">