This is an archive of the discontinued LLVM Phabricator instance.

Fix test for homogeneity in case of aggregate consisting of containerized vector types
ClosedPublic

Authored by omjavaid on Feb 22 2016, 3:38 AM.

Details

Summary

This patch ClangASTContext::IsHomogeneousAggregate test for homogeneity in light of Arm procedure call standard definition of a homogeneous aggregate given below:

A Homogeneous Aggregate is a Composite Type where all of the Fundamental Data Types that compose the type
are the same. The test for homogeneity is applied after data layout is completed and without regard to access
control or other source language restrictions.
An aggregate consisting of containerized vector types is treated as homogeneous if all the members are of the
same size, even if the internal format of the containerized members are different. For example, a structure
containing a vector of 8 bytes and a vector of 4 half-words satisfies the requirements for a homogeneous
aggregate.
A Homogenous Aggregate has a Base Type, which is the Fundamental Data Type of each Element. The overall
size is the size of the Base Type multiplied by the number of Elements; its alignment will be the alignment of the
Base Type.

ClangASTContext::IsHomogeneousAggregate functions is currently only used by ARM ABI and I have not seen a conflicting definition of a Homogenous Aggregate elsewhere so seems safe to use ARM's definition as is.

LGTM?

Diff Detail

Repository
rL LLVM

Event Timeline

omjavaid updated this revision to Diff 48663.Feb 22 2016, 3:38 AM
omjavaid retitled this revision from to Fix test for homogeneity in case of aggregate consisting of containerized vector types.
omjavaid updated this object.
omjavaid added a reviewer: clayborg.
omjavaid added a subscriber: lldb-commits.

Just to mention this simplifies vector return type handling for ARM. A patch implementing that is following up if this gets approves.

clayborg accepted this revision.Feb 22 2016, 10:38 AM
clayborg edited edge metadata.

Looks fine to me.

This revision is now accepted and ready to land.Feb 22 2016, 10:38 AM
This revision was automatically updated to reflect the committed changes.