This is an archive of the discontinued LLVM Phabricator instance.

Add a type_checked_load_relative to support relative function pointer tables
ClosedPublic

Authored by aschwaighofer on Feb 2 2023, 11:09 AM.

Details

Summary

This adds a type_checked_load_relative intrinsic whose semantics it is to
load a relative function pointer.

A relative function pointer is a pointer to a 32bit value that when
added to its address yields the address of the function.

Diff Detail

Event Timeline

aschwaighofer created this revision.Feb 2 2023, 11:09 AM
aschwaighofer requested review of this revision.Feb 2 2023, 11:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 2 2023, 11:09 AM

Can we also get a test with llvm.type.checked.load.relative where the call *doesn't* get devirtualized?

Include test case where the llvm.type.checked.load.relative intrinsic is
expanded to compute the pointer underlying the relative pointer value.

Update to recent ToT

This revision was not accepted when it landed; it landed in state Needs Review.Jun 29 2023, 8:34 AM
This revision was automatically updated to reflect the committed changes.