================ @@ -3232,6 +3264,22 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, return RValue::get(emitUnaryMaybeConstrainedFPBuiltin( *this, E, Intrinsic::sinh, Intrinsic::experimental_constrained_sinh)); + case Builtin::BIsincos: + case Builtin::BIsincosf: + case Builtin::BIsincosl: + case Builtin::BI__builtin_sincos: + case Builtin::BI__builtin_sincosf: + case Builtin::BI__builtin_sincosl: + // Only use the llvm.sincos.* builtin on AArch64 with optimizations. + // Currently, getting codegen that is no worse than the direct call + // requires using AA during codegen. This is not done at optlevel=none, + // and not all targets support this (AArch64 is one of the few known to). + if (!getTarget().getTriple().isAArch64() || + CGM.getCodeGenOpts().OptimizationLevel == 0) + break; ---------------- MacDue wrote:
I can't control that most targets (outside of AArch64 and a few others) don't enable AA at codegen, which means the current lowering for `llvm.sincos` will generate worse code (an additional stack slot + load & store), that would not be present if using the direct call. It's annoying, but right now I don't have a fix for other targets, and I don't want to worsen codegen for them. https://github.com/llvm/llvm-project/pull/114086 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits