================ @@ -43,6 +43,33 @@ using namespace clang; using namespace CodeGen; using namespace llvm; +/// Some builtins do not have library implementation on some targets and +/// are instead emitted as LLVM IRs by some target builtin emitters. +/// FIXME: Remove this when library support is added +static bool shouldEmitBuiltinAsIR(unsigned BuiltinID, + const Builtin::Context &BI, + const CodeGenFunction &CGF) { + if (!CGF.CGM.getLangOpts().MathErrno && + CGF.CurFPFeatures.getExceptionMode() == + LangOptions::FPExceptionModeKind::FPE_Ignore && + CGF.getTarget().getTriple().isAMDGCN()) { ---------------- yxsamliu wrote:
Instead of checking triple, you can add a virtual function TargetCodeGenInfo::supportsLibCall(), by default it returns true. For AMDGPU, it returns false. https://github.com/llvm/llvm-project/pull/129347 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits