[llvm] [IR] Reduce use of getCalledFunction in Verifier. NFCI. (PR #134978)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 9 03:12:38 PDT 2025


================
@@ -5804,11 +5797,8 @@ void Verifier::visitIntrinsicCall(Intrinsic::ID ID, CallBase &Call) {
 
     // Are we tied to a statepoint properly?
     const auto *StatepointCall = dyn_cast<CallBase>(Statepoint);
-    const Function *StatepointFn =
-        StatepointCall ? StatepointCall->getCalledFunction() : nullptr;
-    Check(StatepointFn && StatepointFn->isDeclaration() &&
-              StatepointFn->getIntrinsicID() ==
-                  Intrinsic::experimental_gc_statepoint,
+    Check(StatepointCall->getIntrinsicID() ==
+              Intrinsic::experimental_gc_statepoint,
----------------
jayfoad wrote:

Good point. It would be nice if some test had failed.

https://github.com/llvm/llvm-project/pull/134978


More information about the llvm-commits mailing list