[PATCH] [CallGraph] Teach the CallGraph about non-leaf intrinsics.

Chandler Carruth chandlerc at gmail.com
Wed Jun 17 20:54:18 PDT 2015


As I mentioned on the email thread, I expect LazyCallGraph to just DTRT, but I'd love it if you could add the analogous test case to it and make sure of that.

This patch looks fine without the output parameter (see my comment below). If I've missed something and it is needed, just explain and I'll think more about the API.


================
Comment at: include/llvm/IR/Intrinsics.h:55-61
@@ -54,1 +54,9 @@
 
+  /// Returns true if the intrinsic is a leaf, i.e. it does not make any calls
+  /// itself.  Most intrinsics are leafs, the exceptions being the patchpoint
+  /// and statepoint intrinsics. These call (or invoke) their "target" argument.
+  ///
+  /// For non-leaf intrinsics TargetArg (if non-null) is set to the argument the
+  /// intrinsic calls (or invokes).
+  bool isLeaf(ID id, unsigned *TargetArg = nullptr);
+
----------------
The TargetArg parameter isn't used yet, correct? I'd leave it off until it is used. I'm not a huge fan of the unsigned output parameter, but hard to suggest alternatives when there are no users..

http://reviews.llvm.org/D10526

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list