[llvm-dev] [Constant Folder, InstCombine, ARM, AArch64] Question about constant folding of vector load

Alexandros Lamprineas via llvm-dev llvm-dev at lists.llvm.org
Thu Apr 26 06:51:23 PDT 2018


Hello,


There is a particular code sequence I would like to optimize at the IR level.

I'd like to turn an Arm/AArch64 table lookup intrinsic that takes a constant vector mask into a shufflevector instruction:

vtbl1(V,mask) ~> shufflevector(V,undef,mask)


The reason is that if the mask is {7,6,5,4,3,2,1,0}, then the backend will generate rev64 instructions instead.

If the mask comes from a vld1 of a global constant I could fold it to allow the above instruction combining.

My question is, does the constant folding of the vld1 seem a good thing to do in the general case, as a standalone transformation, or only when used as a mask for a table lookup?

Alexandros
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180426/15a09a92/attachment.html>


More information about the llvm-dev mailing list