[PATCH] D81084: Add intrinsic helper function

Nicolai Hähnle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 10 15:35:37 PDT 2020


nhaehnle added a comment.

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



================
Comment at: llvm/include/llvm/IR/Intrinsics.h:225-230
+  /// Gets the type arguments of an intrinsic call by matching type contraints
+  /// specified by the .td file.
+  ///
+  /// Returns None if the given function is not a valid intrinsic call.
+  Optional<SmallVector<Type *, 4>> getIntrinsicSignature(Function *F);
+
----------------
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).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81084/new/

https://reviews.llvm.org/D81084





More information about the llvm-commits mailing list