[PATCH] D95969: [WPD] Add an optional checking mode for debugging devirtualization

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 3 13:17:22 PST 2021


tejohnson created this revision.
tejohnson added reviewers: davidxl, evgeny777, pcc.
Herald added subscribers: steven_wu, hiraditya, Prazek.
tejohnson requested review of this revision.
Herald added a project: LLVM.

This adds an internal option -wholeprogramdevirt-check which if enabled
will guard each devirtualization with a runtime check against the
expected target, and an invocation of a debug trap if the check fails.
This is useful for debugging WPD failures involving undefined behavior
(e.g. casting to another class type not in the inheritance chain).

This uses the same versioning support used for indirect call promotion.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D95969

Files:
  llvm/include/llvm/Transforms/Utils/CallPromotionUtils.h
  llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
  llvm/lib/Transforms/Utils/CallPromotionUtils.cpp
  llvm/test/ThinLTO/X86/devirt_check.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95969.321208.patch
Type: text/x-patch
Size: 7724 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210203/74b93cf0/attachment.bin>


More information about the llvm-commits mailing list