[llvm-commits] [PATCH] Bug fix to enable zextload on targets that support it

Mishne, Alon alon.mishne at intel.com
Sun Aug 26 00:27:14 PDT 2012


Hi,

I've noticed a clever trick in lib/CodeGen/SelectionDAG/DAGCombiner.cpp of identifying an AND whose only purpose is to reset the top bits as a potential zextload instead of extload in targets that support it. However, the code for identifying the constant used in such an AND with a vector is wrong - it makes incorrect usage of the isConstantSplat() method, assuming it works differently from how it really does.

Attached is a patch that fixes this by using that method correctly, enabling a nice optimization on targets that support zextload. The fixed code is also much simpler and more efficient than the incorrect usage, becomes it removes an unneeded loop.

Please review this patch and commit if acceptable,

-          Alon
---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120826/6762e168/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zextload-fix.patch
Type: application/octet-stream
Size: 2043 bytes
Desc: zextload-fix.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120826/6762e168/attachment.obj>


More information about the llvm-commits mailing list