[PATCH] D22065: Don't invoke getName() from Function::isIntrinsic().

Vedant Kumar via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 6 16:06:15 PDT 2016


vsk added subscribers: escha, vsk.
vsk added a comment.

I think @escha has tried something like this in the past, and would be a good reviewer.

Does having an intrinsic-like name carry any special meaning in llvm IR? I haven't really touched this stuff, but ISTM that behaving differently when you see an intrinsic-like name is suspicious.


================
Comment at: include/llvm/IR/Function.h:141
@@ +140,3 @@
+  bool isIntrinsic() const {
+    // Intrinsic::not_intrinsic must be 0.
+    return IntID != 0;
----------------
Just assert this?

================
Comment at: lib/IR/AsmWriter.cpp:3378
@@ -3377,3 +3377,3 @@
 static bool isReferencingMDNode(const Instruction &I) {
   if (const auto *CI = dyn_cast<CallInst>(&I))
     if (Function *F = CI->getCalledFunction())
----------------
This chain of "if's" looks pretty familiar. Do you think it's worth pulling into a helper, e.g "MapOverIntrinsicMDValues" (in a separate commit)?


http://reviews.llvm.org/D22065





More information about the llvm-commits mailing list