[PATCH] D63932: [GlobalDCE] Dead Virtual Function Elimination

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 28 07:48:33 PDT 2019


lebedev.ri added a comment.

  To make this transformation safe, I have changed clang's code-generation to
  always load virtual function pointers using the llvm.type.checked.load
  intrinsic, instead of regular load instructions. I originally tried writing
  this using clang's existing code-generation, which uses the llvm.type.test
  and llvm.assume intrinsics after doing a normal load. However, it is possible
  for optimisations to obscure the relationship between the GEP, load and
  llvm.type.test, causing GlobalDCE to fail to find virtual function call
  sites.

Can you please clarify, that is saying that without switching to
`llvm.type.checked.load` the optimization would be less efficient
since it would trigger less, not that the optimization would trigger
in some cases where it shouldn't trigger, thus miscompiling the code,
correct ?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D63932





More information about the cfe-commits mailing list