[PATCH] D109114: [GlobalDCE] Add a mode to VFE that replaces unused vtable slots with a trap function instead of a NULL pointer

Kuba (Brecka) Mracek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 2 07:14:55 PDT 2021


kubamracek added a comment.

Two distinct motivations:

1. Turns out that the "relative pointer" expression, if it gets a NULL pointer replaced into it...

  i32 trunc (i64 sub (i64 0, i64 ptrtoint ({ [2 x i32] }* @vtable to i64)) to i32)

...becomes invalid as a relocation expression, and so it can't actually be lowered into machine instructions.

2. To make diagnosing possible miscompiles easier, because the crash will have a unique symbol name.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109114/new/

https://reviews.llvm.org/D109114



More information about the llvm-commits mailing list