[llvm-commits] [PATCH] Improve codegen for non-constant BUILD_VECTORs on ARM

James Molloy james.molloy at arm.com
Mon Sep 3 01:29:35 PDT 2012


Hi,

Currently if a BUILD_VECTOR is all constants but isn't a constant splat,
a chain of insertelements is created from undef.

However in some cases it may be profitable to start from a different
base; consider "<5, 5, 6, 5>". This would be more profitable to start
from a base of a constant splat of "5", then mutate the third lane to
"6".

The attached patch implements this, by searching for a "dominant"
constant value in the vector. A dominant value is defined as a value
that is present in more than half the lanes.

Please review.

Cheers,

James
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nonconstant_splats.diff
Type: text/x-patch
Size: 5161 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120903/bb21ae1f/attachment.bin>


More information about the llvm-commits mailing list