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

via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 22 12:10:16 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.
----------------
PiJoules wrote:

Yeah, I guess I should rephrase this to instead place these i1s in the padding holes if they exist.

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


More information about the llvm-commits mailing list