[PATCH] Fix a bug around truncating vector in const prop

Jiangning Liu liujiangning1 at gmail.com
Sun Aug 17 22:04:30 PDT 2014


Hi,

Attached patch is to fix a bug around truncating vector in const prop.

The problem is quite straightforward as exposed by the test case.

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.

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.

If the operand is not a bitcast, other constant propagation pass should
have covered it.

Thanks,
-Jiangning
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140818/f4b0a0be/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-truncate-vector-bug-in-const-prop.patch
Type: text/x-patch
Size: 1472 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140818/f4b0a0be/attachment.bin>


More information about the llvm-commits mailing list