This is an archive of the discontinued LLVM Phabricator instance.

CodeGen: Implement IR generation for the relative vtable ABI (PR26723).
Needs ReviewPublic

Authored by pcc on Mar 15 2016, 3:05 PM.

Details

Summary

Also add documentation for the new feature.

The new IR scheme for virtual calls
(http://lists.llvm.org/pipermail/llvm-dev/2016-February/096146.html) will
be implemented in a follow-up patch. This patch does some refactoring that
puts us in a good position to do that.

Depends on http://reviews.llvm.org/D17893

Depends on http://reviews.llvm.org/D17938

Diff Detail

Event Timeline

pcc updated this revision to Diff 50776.Mar 15 2016, 3:05 PM
pcc retitled this revision from to CodeGen: Implement IR generation for the relative vtable ABI (PR26723)..
pcc updated this object.
pcc added a subscriber: cfe-commits.
pcc added a comment.Mar 16 2016, 4:26 PM

There's a correctness issue with this change that I'll need to resolve before this goes in; see http://lists.llvm.org/pipermail/cfe-dev/2016-March/048025.html

pcc updated this revision to Diff 50905.Mar 16 2016, 7:58 PM
  • Do not set virtual index in debug info for relative-ABI virtual functions
pcc updated this revision to Diff 50998.Mar 17 2016, 5:20 PM
  • Update test to match committed debug info change
rsmith added inline comments.Mar 18 2016, 6:37 AM
lib/CodeGen/CGDebugInfo.cpp
1153

Is this what debug info consumers expect for the non-virtual case?

pcc updated this revision to Diff 51061.Mar 18 2016, 12:56 PM
  • Use a vindex of 0 for non-virtuals
lib/CodeGen/CGDebugInfo.cpp
1153

The debug info emitter doesn't use the virtual index of non-virtuals [1], but it's probably better to use zero for non-virtuals, as that cuts down on IR writer output. Done.

[1] http://llvm-cs.pcc.me.uk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp#1223

rnk added inline comments.Mar 18 2016, 3:43 PM
lib/CodeGen/ItaniumCXXABI.cpp
1625

Maybe this should live in CGVTables.cpp or CGClass.cpp instead of ItaniumCXXABI.cpp?

pcc added inline comments.Mar 18 2016, 3:46 PM
lib/CodeGen/ItaniumCXXABI.cpp
1625

Yes, sorry, I forgot to move this somewhere more sensible before sending this out for review.

pcc updated this revision to Diff 51324.Mar 22 2016, 12:57 PM
  • Use llvm.load.relative (D18367)
pcc updated this revision to Diff 51580.Mar 24 2016, 12:10 PM
  • Compute a correct byte offset for struct vtable bitsets
espindola edited reviewers, added: espindola; removed: rafael.Mar 15 2018, 10:10 AM