[llvm] [llvm] Ensure propagated constants in the vtable are aligned (PR #136630)

Paul Kirth via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 22 11:49:56 PDT 2025


================
@@ -1880,6 +1908,12 @@ bool DevirtModule::tryVirtualConstProp(
 
     // Find an allocation offset in bits in all vtables associated with the
     // type.
+    // TODO: If a series of i1s would be placed after the vtable, it would
+    // help save some space if they were placed at the very end after all
+    // other larger-size constants. Having these i1s anywhere in the middle
+    // of the allocation would mean extra padding is needed for any subsequent
+    // constants, but having them at the end wouldn't require this padding
+    // at the very end.
----------------
ilovepi wrote:

This is only true if there isn't already padding, right? so if you have a "hole", then they could go there.

https://github.com/llvm/llvm-project/pull/136630


More information about the llvm-commits mailing list