<div dir="ltr">Hi,<br><br>Attached patch is to fix a bug around truncating vector in const prop.<br><br>The problem is quite straightforward as exposed by the test case.<br><br>In constant folding stage, "TRUNC" can't handle vector data type, and all other operands like ZExt/SExt/PtrToInt... can't handle vector data type either. In theory, I think it can, but it would be a separate fix other than current one. If I add comments before the fix, it would highlight this TRUNC is different from others, and I think it would make code reader even confused.<br>
<br>For this case, the bitcast can't be optimized away, because it depends on endianess. If we want to fix this, it also needs a separate fix independent of current one.<br><br>If the operand is not a bitcast, other constant propagation pass should have covered it.<br>
<br>Thanks,<br>-Jiangning<br></div>