Index: include/llvm/Analysis/TargetTransformInfoImpl.h =================================================================== --- include/llvm/Analysis/TargetTransformInfoImpl.h +++ include/llvm/Analysis/TargetTransformInfoImpl.h @@ -794,7 +794,7 @@ // A real function call is much slower. if (auto *CI = dyn_cast(I)) { const Function *F = CI->getCalledFunction(); - if (static_cast(this)->isLoweredToCall(F)) + if (!F || static_cast(this)->isLoweredToCall(F)) return 40; // Some intrinsics return a value and a flag, we use the value type // to decide its latency.