[llvm] [KnownFPClass] Add support for non-intrinsic math libcalls (PR #216234)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Sat Aug 22 00:46:26 PDT 2026
================
@@ -5767,6 +5767,49 @@ void computeKnownFPClass(const Value *V, const APInt &DemandedElts,
Known.knownNot(fcSubnormal);
break;
}
+ case Intrinsic::not_intrinsic: {
+ // Recognize the libcall directly for functions with no intrinsic
+ // equivalent. TLI validates the declaration's prototype and rejects calls
+ // marked 'nobuiltin'. Do not recognize locally-defined functions.
+ if (!Q.TLI)
+ break;
+ const Function *F = II->getCalledFunction();
+ if (!F || F->hasLocalLinkage())
----------------
arsenm wrote:
Make sure the !F case is tested, by using a mis-typed call site.
The linkage check seems off, but you probably can't do better right now. I would also expect the linkage check to be handled by TLI but I'd need to check if it actually does
https://github.com/llvm/llvm-project/pull/216234
More information about the llvm-commits
mailing list