This is an archive of the discontinued LLVM Phabricator instance.

[IR] Partially remove pointer element types from intrinsic signatures (NFC)
ClosedPublic

Authored by nikic on Jul 12 2023, 7:45 AM.

Details

Summary

As typed pointers are no longer supported, we should no longer specify element types in intrinsic signatures.

The only meaningful pointer types are now:

llvm_ptr_ty -> ptr
llvm_anyptr_ty -> ptr addrspace(any)
LLVMQualPointerType<N> -> ptr addrspace(N)

This is only "partially" because we also have a bunch of special IIT descriptors like LLVMPointerTo, LLVMPointerToElt and LLVMAnyPointerToElt, which I'll leave for a later revision.

Diff Detail

Event Timeline

nikic created this revision.Jul 12 2023, 7:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 12 2023, 7:45 AM
nikic requested review of this revision.Jul 12 2023, 7:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 12 2023, 7:45 AM
arsenm added a subscriber: arsenm.Jul 12 2023, 7:57 AM
arsenm added inline comments.
llvm/include/llvm/IR/Intrinsics.td
715

these ptrptr ones could use some additional comments explaining what the pointer is

nikic added inline comments.Jul 12 2023, 8:04 AM
llvm/include/llvm/IR/Intrinsics.td
715

The meaning of the intrinsic arguments is specified in LangRef: https://llvm.org/docs/LangRef.html#llvm-gcroot-intrinsic

I don't really want to repeat LangRef in Intrinsics.td, especially as this does not appear to be the current convention. I don't think the fact that llvm_ptrptr_ty got replaced with llvm_ptr_ty changes anything materially here (i.e., I wouldn't have been able to tell you what this intrinsic does and what the arguments mean before this change either, without consulting LangRef).

aeubanks accepted this revision.Jul 12 2023, 11:18 AM
aeubanks added a subscriber: aeubanks.

lgtm

This revision is now accepted and ready to land.Jul 12 2023, 11:18 AM
This revision was landed with ongoing or failed builds.Jul 13 2023, 1:01 AM
This revision was automatically updated to reflect the committed changes.
llvm/lib/IR/Function.cpp