[PATCH] D138123: [Verifier][WinEH] Check funclet tokens on intrinsic calls that may lower to function calls
Stefan Gränitz via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 16 05:05:43 PST 2022
sgraenitz created this revision.
sgraenitz added reviewers: rnk, efriedma, compnerd, ahatanak.
Herald added a subscriber: hiraditya.
Herald added a project: All.
sgraenitz requested review of this revision.
Herald added a project: LLVM.
WinEHPrepare requires funclet operand bundles ("tokens") on function calls from EH funclets to prevent them from getting removed as "implausible" calls. This includes calls to intrinsic functions that lower to function calls in the course of IR transformations (e.g. ObjC ARC runtime calls).
We can not detect such cases in WinEHPrepare itself, because at this point they mixed up with valid implausible calls. These must be removed to guarantee that the EH backend can assign unique colors and EH state numbers to all blocks.
This patch allows the IR Verifier to detect missing and dangling funclet tokens. Non-conforming IR becomes illegal and miscompilations are detected early. In order to find funclet pad instructions for funclets that extend over multiple blocks, we have to calculate EH funclet colors. As coloring can be expensive, it runs on-demand and results are cached per function.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D138123
Files:
llvm/lib/IR/Verifier.cpp
llvm/test/Transforms/ObjCARC/invoke-2.ll
llvm/test/Verifier/operand-bundles-wineh.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138123.475789.patch
Type: text/x-patch
Size: 4764 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221116/a83ec7c1/attachment.bin>
More information about the llvm-commits
mailing list