Skip to content

Fix handling of the llvm.eh.typeid.for intrinsic #177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 12, 2025

Conversation

sebastianpoeplau
Copy link
Collaborator

We use IntrinsicLowering to turn a number of supported intrinsics into code or library calls that we can instrument. This transformation is expected to preserve code semantics. However, IntrinsicLowering handles llvm.eh.typeid.for by inserting a dummy value of constant 1, which changes code semantics in many cases (except when 1 happens to be the expected type ID).

This commit makes the compiler stop using IntrinsicLowering for llvm.eh.typeid.for; instead, we treat the intrinsic's result as a constant.

Fixes eng/das/fuzz/symcc#23.

We use IntrinsicLowering to turn a number of supported intrinsics into
code or library calls that we can instrument. This transformation is
expected to preserve code semantics. However, IntrinsicLowering handles
llvm.eh.typeid.for by inserting a dummy value of constant 1, which
changes code semantics in many cases (except when 1 happens to be the
expected type ID).

This commit makes the compiler stop using IntrinsicLowering for
llvm.eh.typeid.for; instead, we treat the intrinsic's result as a
constant.

Fixes eng/das/fuzz/symcc#23.
@sebastianpoeplau sebastianpoeplau self-assigned this May 12, 2025
@sebastianpoeplau sebastianpoeplau force-pushed the fix-handling-of-llvm-eh-typeid-for branch from c4715b1 to fecdb1b Compare May 12, 2025 09:03
@sebastianpoeplau sebastianpoeplau force-pushed the fix-handling-of-llvm-eh-typeid-for branch from fecdb1b to 926172b Compare May 12, 2025 09:08
@sebastianpoeplau sebastianpoeplau merged commit de00870 into master May 12, 2025
7 checks passed
@sebastianpoeplau sebastianpoeplau deleted the fix-handling-of-llvm-eh-typeid-for branch May 12, 2025 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant