This is an archive of the discontinued LLVM Phabricator instance.

Add intrinsic helper function
ClosedPublic

Authored by Flakebi on Jun 3 2020, 4:35 AM.

Details

Summary

It simplifies getting generic argument types from intrinsics.

Diff Detail

Event Timeline

Flakebi created this revision.Jun 3 2020, 4:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 3 2020, 4:35 AM

This mostly looks good to be, but I do have a quibble.

llvm/include/llvm/IR/Intrinsics.h
225–230

It is fairly common pattern to pass a SmallVectorImpl-reference for functions to fill, so that the caller can decide what size of small vector to provide. I think this would be preferable here. You could then just return a boolean that is false if the function is not an intrinsic (or a broken intrinsic).

Flakebi updated this revision to Diff 270347.Jun 12 2020, 2:50 AM

Now takes a smallvec as argument and returns a bool as suggested.

This revision is now accepted and ready to land.Jun 29 2020, 5:09 AM
This revision was automatically updated to reflect the committed changes.