================ @@ -3067,21 +3074,41 @@ Value *LibCallSimplifier::optimizeSinCosPi(CallInst *CI, bool IsSin, IRBuilderBa bool IsFloat = Arg->getType()->isFloatTy(); - // Look for all compatible sinpi, cospi and sincospi calls with the same + // Look for all compatible sin/cos (or sinpi/cospi) calls with the same // argument. If there are enough (in some sense) we can make the // substitution. Function *F = CI->getFunction(); for (User *U : Arg->users()) - classifyArgUse(U, F, IsFloat, SinCalls, CosCalls, SinCosCalls); + classifyArgUse(U, F, IsFloat, SinCalls, CosCalls, SinCosCalls, IsPi); ---------------- kito-cheng wrote:
Thanks for the context! Since ConstantData args are already excluded (I've also added the same filter in my latest `InstCombine` version in the PR) and float args can't be global variables, I think the current approach should be fine for the sin/cos case. https://github.com/llvm/llvm-project/pull/184760 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
