[cfe-dev] checking for virtual members

John Thompson john.thompson.jtsoftware at gmail.com
Fri Nov 19 10:51:13 PST 2010


John,

Sorry, I missed seeing your post.

A vecreturn class can only have one member, which must be a vector, because
it's for telling the compiler to store the whole class in a vector register,
for optimization, and thus can only fit one member (unless we extend it to
span multiple registers).

-John


> > Doug,
> >
> > I'm afraid I don't know the appropriate compiler terms to explain it
> > most correctly.  Basically, the main idea for the attribute is to
> > optimize a class that has one data member, which must be a vector, such
> > that the whole object can be stored in a vector register, thus avoiding
> > referencing memory.  Therefore, anything that would add extra storage,
> > such as a vtable pointer would have to be detected.  I don't know that
> > that would preclude multiple inheritance, but I would imagine it
> > wouldn't make sense to have multiple base classes that don't add data
> > members or virtual functions.  I was thinking that just checking for a
> > vtable and only one member which must be a vector would be sufficient.
>
> Is it really important that it have one member?  If you hadn't said that
> I'd suggest that the correct thing to check was whether it has a trivial
> copy constructor.
>
> John Bytheway
>
>
-- 
John Thompson
John.Thompson.JTSoftware at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20101119/359dfd6f/attachment.html>


More information about the cfe-dev mailing list