[PATCH] D51905: Front-end of the implementation of the interleaving algorithm

Zhaomo Yang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 12 13:19:50 PDT 2018


zhaomo added inline comments.


================
Comment at: clang/lib/CodeGen/ItaniumCXXABI.cpp:1767
 
+  bool InBounds = shouldInterleaveVTables(VTableClass) ? false : true;
   return llvm::ConstantExpr::getGetElementPtr(VTable->getValueType(), VTable,
----------------
pcc wrote:
> Remind me why this needs to be here? (And the explanation needs to be in a comment.)
The calculation of address point is essentially base_vtable_addr + offset, where offset is from the indices of gep.
In the interleaving pass, we replace base_vtable_addr with (addr_point_in_interleaved_layout - offset).

The LLVM language reference says that the base address of a inbounds gep must be an in bound address of the object. The new base address addr_point_in_interleaved_layout - offset, however, may not be an in bound address.


https://reviews.llvm.org/D51905





More information about the cfe-commits mailing list