[cfe-dev] Sub-vector selection and CLang v5.0

ORiordan, Martin via cfe-dev cfe-dev at lists.llvm.org
Fri Feb 16 01:11:55 PST 2018


Hi CFE-Devs,

I received a bug report for a breaking change between CLang v4.0 and v5.0 regarding sub-vectors that has been caused by:

http://llvm.org/viewvc/llvm-project?view=revision&revision=298369

The example is as follows:

  char16 v0, v1;
  ...
  v1.s0123456 = v0.s0123456; // Replace the 1st 7-elements of 'v1' with the 1st 7-elements of 'v0'

which used to generate valid code, but which is now diagnosed with the following error:

  error: vector component access has invalid length 7. Supported: 1,2,3,4,8,16.

However, I don't see why it should not be possible to replace any range of elements of a vector with a corresponding set of elements.  The "fix" in this case is to rewrite it as:

  v1.lo = (char8){v0.s0, v0.s1, v0.s2, v0.s3,
                  v0.s4, v0.s5, v0.s6, v1.s7};

but this also generates slightly more code (on our platform) than the alternative rewrite:

  v1 = (char16){v0.s0, v0.s1, v0.s2, v0.s3,
                v0.s4, v0.s5, v0.s6, v1.s7,
                v1.s8, v1.s9, v1.sa, v1.sb,
                v1.sc, v1.sd, v1.se, v1.sf};

In either case, the rewrite seems unnecessarily verbose compared to the original form.

Thanks,

            MartinO

--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263


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/cfe-dev/attachments/20180216/8a75167e/attachment.html>


More information about the cfe-dev mailing list