This is an archive of the discontinued LLVM Phabricator instance.

Fix ARM HVA classification of classes with non-virtual bases
ClosedPublic

Authored by rnk on Oct 30 2014, 3:46 PM.

Details

Summary

Reuse the PPC64 HVA detection algorithm for ARM and AArch64. This is a
nice code deduplication, since they are roughly identical. A few virtual
method extension points are needed to understand how big an HVA can be
and what element types it can have for a given architecture.

Also make the record expansion code work in the presence of non-virtual
bases.

Diff Detail

Event Timeline

rnk updated this revision to Diff 15589.Oct 30 2014, 3:46 PM
rnk retitled this revision from to Fix ARM HVA classification of classes with non-virtual bases.
rnk updated this object.
rnk added reviewers: uweigand, t.p.northover.
rnk added a subscriber: Unknown Object (MLST).
rnk added inline comments.Oct 30 2014, 5:40 PM
lib/CodeGen/CGCall.cpp
595–599

Crud, this is incorrect. We need to know which base class has the field so we can do the adjustment for non-primary bases. This code ends up passing the x field twice and losing the y field:

struct B1 { double x; };
struct B2 { double y; };
struct D : B1, B2 { double z; };
void f(D d) {}
uweigand edited edge metadata.Oct 31 2014, 6:55 AM

The PowerPC specific changes look good to me. I cannot really comment on the other changes, in particular the CGCall.cpp ones.

asl added a subscriber: asl.Oct 31 2014, 10:05 AM

ARM changes look sane to me

rnk updated this revision to Diff 15627.Oct 31 2014, 10:07 AM
rnk edited edge metadata.
  • Fix expansion of C++ bases
rnk added a comment.Oct 31 2014, 10:14 AM

Thanks for looking, I'll land this.

rnk closed this revision.Oct 31 2014, 10:21 AM
rnk updated this revision to Diff 15629.

Closed by commit rL220972 (authored by @rnk).

lib/CodeGen/TargetInfo.cpp