<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/153543>153543</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Wrong types checked at DAGCombiner::visitSRA(SDNode *N)
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
akiva-pripas
</td>
</tr>
</table>
<pre>
The following check is performed at DAGCombiner::visitSRA(SDNode *N)
if ((ShiftAmt > 0) &&
TLI.isOperationLegalOrCustom(ISD::SIGN_EXTEND, TruncVT) &&
TLI.isOperationLegalOrCustom(ISD::TRUNCATE, VT) &&
TLI.isTruncateFree(VT, TruncVT)) {
SDValue Amt = DAG.getShiftAmountConstant(ShiftAmt, VT, DL);
SDValue Shift = DAG.getNode(ISD::SRL, DL, VT,
N0.getOperand(0), Amt);
SDValue Trunc = DAG.getNode(ISD::TRUNCATE, DL, TruncVT,
Shift);
return DAG.getNode(ISD::SIGN_EXTEND, DL,
N->getValueType(0), Trunc);
}
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJykk99vmz4Uxf-ay4uVCMzPPPBAIakqRanU8O13b5OBC3glGNkmU__7yU7a0W6ZNM2KlAeuz-ecA5cpxbsRMYXwDsLCYbPuhUzZCz-z1ST5xJRTieY1LXskrRgG8Z2PHal7rF8IV2RC2Qp5woYwTYrsPhenio8owc_Az85ccX18yoAmx-IgGiRAswPQDbgZuBlvCdDEPOx5q7OTJuBviQt0Q4BG5udm5P2U-4c1V48TSqa5GPfYseFR5rPS4gQ0eTgWF-jx4f7wdful3B4KoDkp5TzWz-U_ipZP_x3yrNwaxc9iFw3LYRp3EhFoYoaWcHslvlvAj8UzG2Ykl9yFaW_dob52IeZR52JUmo160dAbPyfF3qj6v1O0w0tNU_2Hip72bxJXOaNycM2s7WJsgCautZ0Ti72BsgH_hFoWd-G9d5J_eBO3j43ziwOJepbjzYQfPwJLthlX4G871NZ9-TrhIqc19okDceE0qd9s_A1zMPXiMPTCMEgip0_rJGoDDJKExZXXBlFLadPUuPHaqmrCunJ4Sl0auokXuLHn0WjtJR6No4h5cYyhv6khcPHE-LAehvNpLWTncKVmTL3QDwPfGViFg3pbTZmaqVU1dwoCd-BKq5_3NNcDpv9LMXZEv06oLiv6t3vpzHJIe60nZQbpDuiu47qfq3Vt9mFneNe_1STFN6w10J01rYDurr7PKf0RAAD__46gP0I">